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:
- Delete the secret
flux-system:
source /home/opc/siebel/<env_id>/k8sprofile kubectl -n <namespace> delete secret flux-system
- Set the
GIT_PASSWORD
environment variable:export GIT_PASSWORD=<git_accesstoken>
- 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>
- Update the Git access token in the SCM Git repository:
- Go to the environment directory:
cd /home/opc/siebel/<env_id>
- Open the
siebel-config.yaml
file:vi <Cloud manager repository name>/flux-crm/apps/base/siebel/siebel-config.yaml
- Update the value of the
git_accesstoken
parameter.
- Go to the environment directory:
- Commit the changes to the remote Git repository:
- Go to the SCM Git
repository:
cd /home/opc/siebel/<env_id>/<Cloud manager repository name>
- 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
- Perform flux reconcile
manually:
flux reconcile source git <namespace> -n <namespace> flux reconcile kustomization apps -n <namespace>
- Go to the SCM Git
repository: