title: Create user in Kubernetes for kubectl
body: <p>I need to create users to assign them permissions with RBAC, I create them as follows:</p>
  
  <pre><code>echo -n "lucia" | base64
  bHVjaWE=
  echo -n "pass" | base64
  cGFzcw==
  
  apiVersion: v1
  kind: Secret
  metadata:
    name: lucia-secret
  type: Opaque
  data:
    username: bHVjaWE=
    password: cGFzcw==
  </code></pre>
  
  <p>Or create with:</p>
  
  <pre><code>kubectl create secret generic lucia-secret --from-literal=username='lucia',password='pass'
  </code></pre>
  
  <p>I don't know how to continue</p>
  
  <pre><code>USER_NICK=lucia
  
  kubectl config set-credentials $USER_NICK \
      --username=lucia \
      --password=pass
  
  kubectl get secret lucia-secret -o json | jq -r '.data["ca.crt"]' | base64 -d &gt; ca.crt
  
  endpoint=`kubectl config view -o jsonpath="{.clusters[?(@.name == \"$name\")].cluster.server}"`
  
  kubectl config set-cluster cluster-for-lucia \
    --embed-certs=true \
    --server=$endpoint \
    --certificate-authority=./ca.crt
  
  kubectl config set-context context-lucia \
    --cluster=cluster-for-lucia \
    --user=$USER_NICK \
    --namespace=default
  </code></pre>
  
  <p>ca.crt is null</p>
  
  <p>Thank you for your help!</p>