home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

chos4 (1941B)


      1 #!/usr/bin/env bash
      2 # Update creds and link to the openshift4 devcluster
      3 
      4 set -e
      5 
      6 CONTROL_PATH=$(mktemp)
      7 # scp -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/kubeconfig $HOME/.kube/config.os4
      8 # scp -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/kubeadmin-password $HOME/.kube/kubeadmin.password.os4
      9 # scp -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/webaccess $HOME/.kube/webaccess.os4
     10 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/kubeconfig $HOME/sync/work/chos4/config.os4
     11 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/kubeadmin-password $HOME/sync/work/chos4/kubeadmin.password.os4
     12 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/vincent/auth/webaccess $HOME/sync/work/chos4/webaccess.os4
     13 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/paac/auth/kubeconfig $HOME/sync/work/chos4/config.paac
     14 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/paac/auth/kubeadmin-password $HOME/sync/work/chos4/kubeadmin.password.paac
     15 scp -o ControlPath=${CONTROL_PATH} -q pipelines@bootstrap.ospqa.com:os4-build/profiles/paac/auth/webaccess $HOME/sync/work/chos4/webaccess.paac
     16 
     17 for file in kubeadmin.password.os4 webaccess.os4 config.os4 kubeadmin.password.paac webaccess.paac config.paac; do
     18     if ! test -f $HOME/.kube/$file; then
     19         ln -s $HOME/sync/work/chos4/$file ~/.kube/$file
     20     fi
     21 done
     22 
     23 export KUBECONFIG=~/.kube/config.os4
     24 oc login -u kubeadmin -p $(cat ~/.kube/kubeadmin.password.os4)
     25 
     26 echo ">>> scale machineset to 2"
     27 for machineset in $(oc get machineset -n openshift-machine-api -o name); do
     28     oc scale --replicas=2 ${machineset} -n openshift-machine-api
     29 done
     30 
     31 if [[ "$1" == "install" ]]; then
     32     op-inst
     33 fi
     34 
     35 echo ">>> your cluster is ready :)"
     36 read