Store delegate tokens as Kubernetes secrets
Last updated on
You can store your delegate tokens as a Kubernetes secret instead of a ConfigMap.
To store the delegate token as a Kubernetes secret, do the following:
-
Create a Kubernetes secret. For details, go to the Kubernetes documentation: Secrets.
-
Create a
delegate-token.yamlfile.apiVersion: v1kind: Secretmetadata:name: token-secretnamespace: harness-delegate-ngtype: OpaquestringData:DELEGATE_TOKEN: <Delegate-token-value> -
Run the following to apply the YAML file.
kubectl -f delegate-token.yaml -
Modify the
delegate.yamlfile to provide the reference to the secret you created.- name: DELEGATE_TOKENvalueFrom:secretKeyRef:name: token-secretkey: DELEGATE_TOKEN