Updating GitLab Access Token

GitLab access token allows only authorized users to access the Git repository. You must update the Git access token regularly to ensure only authorized users can access the Git repository.

  1. Execute the flux bootstrap with the new token:
    source /home/opc/siebel/<env_id>/k8sprofile
    export GITLAB_TOKEN=<gitlab_accesstoken>
    flux bootstrap gitlab --components-extra=image-reflector-controller,image-automation-controller --hostname=https://<GITLAB_HOSTNAME> --token-auth --owner=<GITLAB_USER> --repository=<NAMESPACE>-cloud-manager --ca-file=<GITLAB_SELFSIGNED_CACERT_PATH>  --branch=master --path='flux-crm/clusters/staging' --log-level debug --image-pull-secret ocirsecret --registry phx.ocir.io/siebeldev/fluxcd -n <NAMESPACE> --watch-all-namespaces=false
    Note: Here, if you are using SCM development build, the registry will be iad.ocir.io/siebeldev/fluxcd.
  2. Update the GitLab access token in the SCM Git repository:
    1. Go to the environment directory:
      cd /home/opc/siebel/<env_id>
    2. Open the siebel-config.yaml file:
      vi <namespace>-cloud-manager/flux-crm/apps/base/siebel/siebel-config.yaml
    3. Update the value of the gitlab_accesstoken parameter.
  3. Commit the changes to the remote Git repository:
    1. Go to the <namespace>-cloud-manager directory:
      cd /home/opc/siebel/<ENV_ID>/<namespace>-cloud-manager
    2. Commit the changes to the Git repository:
      git add .
      git commit -m "updated gitlab access token and custom secrets"
      git config pull.rebase false
      git pull 
      git push
    3. Perform flux reconcile manually:
      flux reconcile source git <namespace> -n <namespace>
      flux reconcile kustomization apps -n <namespace>