forked from zero-filtre/k8s-user-provisioner
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmicroservice.yaml
93 lines (91 loc) · 2.97 KB
/
microservice.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: zerofiltretech-${env_name}
name: zerofiltretech-provisioner-${env_name}
spec:
minReadySeconds: 30
progressDeadlineSeconds: 120
replicas: 1
selector:
matchLabels:
app: zerofiltretech-provisioner-${env_name}
template:
metadata:
labels:
app: zerofiltretech-provisioner-${env_name}
annotations:
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: "internal-app"
vault.hashicorp.com/agent-inject-secret-config: "${env_name}/data/zerofiltre-provisioner"
vault.hashicorp.com/agent-inject-template-config: |
{{- with secret "${env_name}/data/zerofiltre-provisioner" -}}
VERIFICATION_TOKEN="{{ .Data.data.VERIFICATION_TOKEN}}"
KEYCLOAK_BASE_URL="{{ .Data.data.KEYCLOAK_BASE_URL }}"
KEYCLOAK_REALM="{{ .Data.data.KEYCLOAK_REALM }}"
KEYCLOAK_CLIENT_ID="{{ .Data.data.KEYCLOAK_CLIENT_ID }}"
KEYCLOAK_CLIENT_SECRET="{{ .Data.data.KEYCLOAK_CLIENT_SECRET }}"
GRAFANA_PASSWORD="{{ .Data.data.GRAFANA_PASSWORD }}"
GRAFANA_USER="{{ .Data.data.GRAFANA_USER }}"
KUBE_CONFIG={{ .Data.data.KUBE_CONFIG }}
{{- end -}}
spec:
serviceAccountName: internal-app
containers:
- name: zerofiltretech-provisioner-${env_name}
image: imzerofiltre/zerofiltretech-provisioner:0.0.1
imagePullPolicy: IfNotPresent
resources:
requests:
cpu: ${requests_cpu}
memory: ${requests_memory}
limits:
cpu: ${limits_cpu}
memory: ${limits_memory}
ports:
- containerPort: 5000
livenessProbe:
httpGet:
path: /
port: 5000
initialDelaySeconds: 100000
periodSeconds: 300
---
apiVersion: v1
kind: Service
metadata:
namespace: zerofiltretech-${env_name}
name: zerofiltretech-provisioner-${env_name}
spec:
ports:
- protocol: TCP
port: 5000
targetPort: 5000
selector:
app: zerofiltretech-provisioner-${env_name}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: zerofiltretech-${env_name}
name: zerofiltretech-provisioner-${env_name}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
# add an annotation indicating the issuer to use.
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
rules:
- host: ${domain_name}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: zerofiltretech-provisioner-${env_name}
port:
number: 5000
tls: # < placing a host in the TLS config will indicate a certificate should be created
- hosts:
- ${domain_name}
secretName: provisioner-zerofiltre-ingress-cert # < cert-manager will store the created certificate in this secret.