Skip to content

Instantly share code, notes, and snippets.

@Rishi16royy
Last active April 28, 2022 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rishi16royy/2a94e5d21c2592d08ab9b83c1d87a9ac to your computer and use it in GitHub Desktop.
Save Rishi16royy/2a94e5d21c2592d08ab9b83c1d87a9ac to your computer and use it in GitHub Desktop.
Yaml for setting up Atlantis on Kubernetes cluster.
apiVersion: v1
kind: Namespace
metadata:
name: atlantis
labels:
app.kubernetes.io/name: atlantis
app.kubernetes.io/part-of: atlantis
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: atlantis
namespace: atlantis
annotations:
eks.amazonaws.com/role-arn: <S3 Role ARN>
labels:
app.kubernetes.io/name: atlantis
app.kubernetes.io/part-of: atlantis
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: atlantis
namespace: atlantis
labels:
app.kubernetes.io/name: atlantis
app.kubernetes.io/part-of: atlantis
app: atlantis
spec:
serviceName: atlantis
replicas: 1
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 0
selector:
matchLabels:
app: atlantis
template:
metadata:
labels:
app: atlantis
spec:
serviceAccountName: atlantis
securityContext:
fsGroup: 1000 # Atlantis group (1000) read/write access to volumes.
containers:
- name: atlantis
image: runatlantis/atlantis:v0.17.3
env:
- name: ATLANTIS_REPO_ALLOWLIST
value: github.com/<Repo-Name>
### GitHub Config ###
- name: ATLANTIS_GH_USER
value: <User>
- name: ATLANTIS_GH_TOKEN
valueFrom:
secretKeyRef:
name: atlantis-vcs
key: token
- name: ATLANTIS_GH_WEBHOOK_SECRET
valueFrom:
secretKeyRef:
name: atlantis-vcs
key: webhook-secret
### End GitHub Config ###
- name: ATLANTIS_DATA_DIR
value: /atlantis
- name: ATLANTIS_PORT
value: "4141"
volumeMounts:
- name: atlantis-data
mountPath: /atlantis
ports:
- name: atlantis
containerPort: 4141
resources:
requests:
memory: 256Mi
cpu: 100m
limits:
memory: 256Mi
cpu: 100m
livenessProbe:
periodSeconds: 60
httpGet:
path: /healthz
port: 4141
scheme: HTTP
readinessProbe:
periodSeconds: 60
httpGet:
path: /healthz
port: 4141
scheme: HTTP
volumeClaimTemplates:
- metadata:
name: atlantis-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 5Gi
---
apiVersion: v1
kind: Service
metadata:
name: atlantis
namespace: atlantis
labels:
app.kubernetes.io/name: atlantis
app.kubernetes.io/part-of: atlantis
annotations:
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-type: nlb
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "false"
spec:
type: LoadBalancer
ports:
- name: atlantis
port: 80
targetPort: 4141
selector:
app: atlantis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment