60 lines
1.8 KiB
HCL
60 lines
1.8 KiB
HCL
resource "kubectl_manifest" "deploy" {
|
|
yaml_body = <<-EOF
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: "${var.component}-${var.instance}"
|
|
namespace: "${var.namespace}"
|
|
labels: ${jsonencode(local.common_labels)}
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels: ${jsonencode(local.common_labels)}
|
|
template:
|
|
metadata:
|
|
labels: ${jsonencode(local.common_labels)}
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 1000
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
containers:
|
|
- name: gramo
|
|
securityContext:
|
|
fsGroup: 1000
|
|
runAsGroup: 1000
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
env:
|
|
- name: BRIDGE_USER_AUTH
|
|
value: disabled
|
|
image: "${var.images.gramo.registry}/${var.images.gramo.repository}:${var.images.gramo.tag}"
|
|
imagePullPolicy: "${var.images.gramo.pull_policy}"
|
|
ports:
|
|
- containerPort: 3000
|
|
name: http
|
|
protocol: TCP
|
|
livenessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
scheme: HTTP
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 1
|
|
readinessProbe:
|
|
failureThreshold: 3
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
scheme: HTTP
|
|
periodSeconds: 10
|
|
successThreshold: 1
|
|
timeoutSeconds: 1
|
|
restartPolicy: Always
|
|
serviceAccount: "${var.component}-${var.instance}"
|
|
serviceAccountName: "${var.component}-${var.instance}"
|
|
EOF
|
|
}
|