Skip to content

Instantly share code, notes, and snippets.

@timarenz
Created November 4, 2020 11:42
Show Gist options
  • Save timarenz/23e54ee5964f88a9d5e5059cea932419 to your computer and use it in GitHub Desktop.
Save timarenz/23e54ee5964f88a9d5e5059cea932419 to your computer and use it in GitHub Desktop.
Run Terraform Cloud Agents as Kubernetes deployment
---
apiVersion: v1
kind: Secret
metadata:
name: terraform-cloud-agent-secret
type: Opaque
data:
tfc_agent_token: dGhpc25lZWRzdG9iZWNoYW5nZWQ=
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: terraform-cloud-agent
labels:
app: tfc-agent
spec:
replicas: 3
selector:
matchLabels:
app: tfc-agent
template:
metadata:
labels:
app: tfc-agent
spec:
containers:
- name: tfc-agent
image: hashicorp/tfc-agent:latest
env:
- name: TFC_AGENT_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: TFC_AGENT_TOKEN
valueFrom:
secretKeyRef:
name: terraform-cloud-agent-secret
key: tfc_agent_token
@RemyNtshaykolo
Copy link

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment