Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Yen kevin-yen

  • Western Asset Management
View GitHub Profile
@superseb
superseb / create_user_and_kubeconfig_rancher2.sh
Created Jun 15, 2018
Create local user and generate kubeconfig in Rancher 2 via API
View create_user_and_kubeconfig_rancher2.sh
#!/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