-
Notifications
You must be signed in to change notification settings - Fork 3
/
kubernetes.yaml
84 lines (84 loc) · 2.31 KB
/
kubernetes.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
apiVersion: v1
kind: Service
metadata:
name: uro
namespace: default
labels:
app: uro
spec:
type: NodePort
ports:
- name: http-port
port: 4000
protocol: TCP
selector:
app: uro
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: uro-deployment
namespace: default
labels:
app: uro
spec:
replicas: 1
selector:
matchLabels:
app: uro
template:
metadata:
labels:
app: uro
spec:
serviceAccountName: cockroachdb
volumes:
- name: client-certs
emptyDir: {}
initContainers:
# The init-certs container sends a certificate signing request to the
# kubernetes cluster.
# You can see pending requests using: kubectl get csr
# CSRs can be approved using: kubectl certificate approve <csr name>
#
# In addition to the client certificate and key, the init-certs entrypoint will symlink
# the cluster CA to the certs directory.
- name: init-certs
image: cockroachdb/cockroach-k8s-request-cert:0.4
imagePullPolicy: IfNotPresent
command:
- "/bin/ash"
- "-ecx"
- "/request-cert -namespace=${POD_NAMESPACE} -certs-dir=/cockroach-certs -type=client -user=uro-prod -symlink-ca-from=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
volumeMounts:
- name: client-certs
mountPath: /cockroach-certs
containers:
- name: uro
env:
- name: SECRET_KEY_BASE
valueFrom:
secretKeyRef:
name: uro-prod
key: secret-key-base
- name: DATABASE_PASS
valueFrom:
secretKeyRef:
name: uro-prod
key: pass
- name: DATABASE_URL
value: "postgres://uro-prod@cockroachdb-public:26257/uro_prod?sslmode=verify-full&sslcert=/cockroach-certs/client.uro-prod.crt&sslkey=/cockroach-certs/client.uro-prod.key&sslrootcert=/cockroach-certs/ca.crt"
image: groupsinfra/uro:latest
imagePullPolicy: Always
volumeMounts:
- name: client-certs
mountPath: /cockroach-certs
ports:
- containerPort: 4000
name: http
restartPolicy: Always