Kubernetes
Use Onboardbase in your Kubernetes environment.
TIP
You can authenticate the CLI with Environment variables.
Supported environment variables are:
ONBOARDBASE_TOKEN
- A service tokenONBOARDBASE_PROJECT
- an onboardbase project nameONBOARDBASE_ENVIRONMENT
- an environment in the specified project
Onboardbase can generate secrets that work in a Kubernetes environment. This is possible using the Onboardbase secrets --docker
command.
kubectl create secret generic onboardbase-env-vars --from-env-file <(onboardbase secrets --docker)
View the generated secrets with:
kubectl describe secret onboardbase-env-vars
Next, create a Pod that will use the generated secret (onboardbase-env-vars)
to create an environment variable for every key defined in the secret's data using the below spec (onboardbase-env-vars-pod.yaml)
:
apiVersion: v1
kind: Pod
metadata:
name: onboardbase-env-vars
spec:
restartPolicy: Never
containers:
- name: onboardbase-env-vars
image: ubuntu
args: ["printenv"] # start command here
# Populates every key in the secret as an env var
envFrom:
- secretRef:
name: onboardbase-env-vars
Finally, create a pod from the specification:
kubectl apply -f onboardbase-env-vars-pod.yaml
Confirm that the secrets were printed with:
kubectl logs onboardbase-env-vars
Updated 8 months ago