This commit is contained in:
2023-10-14 20:41:17 +02:00
parent dd13693aaf
commit 2ea7352215
9 changed files with 643 additions and 104 deletions

58
apps/okd/deploy.tf Normal file
View File

@@ -0,0 +1,58 @@
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
runAsGroup: 1000
containers:
- name: okd
securityContext:
fsGroup: 1000
runAsGroup: 1000
runAsNonRoot: true
runAsUser: 1000
env:
- name: BRIDGE_USER_AUTH
value: disabled
image: "${var.images.okd.registry}/${var.images.okd.repository}:${var.images.okd.tag}"
imagePullPolicy: "${var.images.okd.pullPolicy}"
ports:
- containerPort: 9000
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: okd
serviceAccountName: okd
EOF
}