Updating Git Access Token

Git 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.

To update the Git access token, perform the following tasks:

  1. Delete the secret flux-system:
    source /home/opc/siebel/<env_id>/k8sprofile 
    kubectl -n <namespace> delete secret flux-system
  2. Set the GIT_PASSWORD environment variable:
    export GIT_PASSWORD=<git_accesstoken>
  3. Execute the flux bootstrap with the new token:
    flux.sh bootstrap git --components-extra=image-reflector-controller,image-automation-controller --url=https://<GIT_HOSTNAME>/<GIT_USER>/<Cloud manager repository>  --namespace=<namespace> --branch=master --path='flux-crm/clusters/staging' --log-level debug --watch-all-namespaces=false --image-pull-secret ocirsecret --registry <CONTAINER_REGISTRY_URL>/fluxcd --username=<GIT_USER> --silent --token-auth --ca-file=<GIT_SELFSIGNED_CACERT_PATH>
  4. Update the Git 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 <Cloud manager repository name>/flux-crm/apps/base/siebel/siebel-config.yaml
    3. Update the value of the git_accesstoken parameter.
  5. Commit the changes to the remote Git repository:
    1. Go to the SCM Git repository:
      cd /home/opc/siebel/<env_id>/<Cloud manager repository name>
    2. Commit the changes to the Git repository:
      git add .
      git commit -m "updated git 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>