cloud-native-robotz-hackathon / infrastructure

0 stars 0 forks source link

Playbook to update robot credentials #18

Open rbo opened 1 week ago

rbo commented 1 week ago

Provide a playbook in robot/ to fetch the microshift credentials and update edge-gatway argocd credentials.

By hand it works like this:

argocd login --username admin openshift-gitops-server-openshift-gitops.apps.edge-gateway.lan:443

export ROBOT=data
scp $ROBOT.robot.lan:/var/lib/microshift/resources/kubeadmin/kubeconfig ${ROBOT}.kubeconfig
export KUBECONFIG=${ROBOT}.kubeconfig
oc config set-cluster ${ROBOT} --server=https://${ROBOT}.robot.lan:6443 --insecure-skip-tls-verify=true
oc config set-context $ROBOT  --user=user --cluster=${ROBOT}
oc config use-context $ROBOT

argocd cluster add $(oc config current-context )

At the end, it is a secret in the openshift-gitops namespace:

apiVersion: v1
data:
  config: xxxx
  name: xxxx
  server: xxx
kind: Secret
metadata:
  annotations:
    managed-by: argocd.argoproj.io
  labels:
    argocd.argoproj.io/secret-type: cluster
  name: cluster-data.robot.lan-3162858094
  namespace: openshift-gitops
type: Opaque

image