Skip to content

NewUserSetup

devopswithcloud edited this page Mar 4, 2022 · 1 revision

Creating Namespace, User & User Credentials

Install kubectl

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF

sudo apt-get update
sudo apt-get install -y kubectl=1.19.1-00
sudo apt-mark hold kubectl

Create a new namespace named development in Master node

$ kubectl create ns development

Generate a private key for maha and Certificate Signing Request (CSR) for maha

$ openssl genrsa -out maha.key 2048

$ openssl req -new -key maha.key \ -out maha.csr -subj "/CN=maha/O=development"

Generate a self-signed certificate. Use the CA keys for the Kubernetes cluster and set the certificate expiration.

$ sudo openssl x509 -req -in maha.csr \ 
  -CA /etc/kubernetes/pki/ca.crt \ 
  -CAkey /etc/kubernetes/pki/ca.key \ -CAcreateserial \ -out maha.crt -days 45