Code Monkey home page Code Monkey logo

k8s-rbac-user's Introduction

k8s-rbac-user:

Instructions :

  1. aws iam create-user --user-name demo-app1-user
  2. aws iam create-access-key --user-name demo-app1-user | tee /tmp/create_output.json

cat << EoF > rbacuser_creds.sh export AWS_SECRET_ACCESS_KEY=$(jq -r .AccessKey.SecretAccessKey /tmp/create_output.json) export AWS_ACCESS_KEY_ID=$(jq -r .AccessKey.AccessKeyId /tmp/create_output.json) EoF

4.Create IAM Role and IAM Policy a.Create IAM Role--> k8s-developer (create empty role by following the steps) Steps -> create Roles -> Another AWS account -> Add ur current AWS account -> save

b. Create IAM Policy --> k8s-developer-policy { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam:::role/k8s-developer" } ] } Add following policy to iam user(demo-app1-user) created

  1. Execute the following commands a. execute ->. rbacuser_creds.sh b. execute -> aws sts get-caller-identity c. unset AWS_SECRET_ACCESS_KEY d. unset AWS_ACCESS_KEY_ID

6.Add user and group aws-auth file (kubectl edit configmap aws-auth -n kube-system) ##Sample apiVersion: v1 data: mapRoles: | - rolearn: arn:aws:iam:::role/ username: system:node:{{EC2PrivateDNSName}} groups: - system:bootstrappers - system:nodes - rolearn: arn:aws:iam:::role/k8s-developer username: demo-app1-user mapUsers: | - userarn: arn:aws:iam:::user/demo-app1-user username: demo-app1-user groups: - k8s-developer

  1. apply roles and role-binding
  2. Execute the following commands a. execute ->. rbacuser_creds.sh b. execute -> aws sts get-caller-identity
  3. Test ngnix.yaml (kubectl create -f ngnix.yml -n demo-app1)

k8s-rbac-user's People

Contributors

chaitu-papa 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.