Giter Site home page Giter Site logo

k8s-add-user's Introduction

k8s-add-user

A simple script to add user in K8S cluster

Note1: This script backup your default configuration file ~/.kube/config. so don't worry about that.

Note2: This script is only compatible with Kubernetes version 1.24 and later.

https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.24.md#urgent-upgrade-notes

Steps

  1. change role section in line38(apiGroup, Resources, Verbs) based on your need.

sample role

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: ${ROLE_NAME}
rules:
- apiGroups:
  - ""
  resources:
  - pods
  - services
  - pods/log
  - pods/exec
  - pods/attach
  verbs:
  - get
  - list
  - watch
  - create
  - patch
  1. run your script to create resources. Then Answer the interactive questions.
chmod +x script.sh
./script.sh

Donate

Tether: TNCtD7pARiD7iEffov2ARXAP6fGNVvtFaA
Buy me a Book: 
https://www.buymeacoffee.com/mrtshoot

k8s-add-user's People

Contributors

mrtshoot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.