Skip to content

Instantly share code, notes, and snippets.

View kevin-yen's full-sized avatar

Kevin Yen kevin-yen

  • Pixel Canvas, Inc
  • Los Angeles Area
View GitHub Profile
@superseb
superseb / create_user_and_kubeconfig_rancher2.sh
Last active November 1, 2023 18:51
Create local user and generate kubeconfig in Rancher 2 via API
#!/bin/bash
RANCHERENDPOINT=https://your_rancher_endpoint/v3
# The name of the cluster where the user needs to be added
CLUSTERNAME=your_cluster_name
# Username, password and realname of the user
USERNAME=username
PASSWORD=password
REALNAME=myrealname
# Role of the user
GLOBALROLE=user