forked from apache/openwhisk-deploy-kube
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcouchdb.yml
99 lines (97 loc) · 2.23 KB
/
couchdb.yml
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
94
95
96
97
98
99
# The couchdb service is defined here instead of in cluster-config/services
# because some deployments will not put the database within the kube cluster.
---
apiVersion: v1
kind: Service
metadata:
name: couchdb
namespace: openwhisk
labels:
name: couchdb
spec:
selector:
name: couchdb
ports:
- port: 5984
targetPort: 5984
name: couchdb
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: couchdb
namespace: openwhisk
labels:
name: couchdb
spec:
replicas: 1
template:
metadata:
labels:
name: couchdb
spec:
restartPolicy: Always
containers:
- name: couchdb
imagePullPolicy: Always
image: openwhisk/kube-couchdb
command: ["/init.sh"]
ports:
- name: couchdb
containerPort: 5984
env:
- name: "DB_PREFIX"
valueFrom:
configMapKeyRef:
name: db.config
key: db_prefix
- name: "DB_HOST"
value: "127.0.0.1"
- name: "COUCHDB_USER"
valueFrom:
secretKeyRef:
name: db.auth
key: db_username
- name: "COUCHDB_PASSWORD"
valueFrom:
secretKeyRef:
name: db.auth
key: db_password
- name: "DB_PORT"
value: "5984"
- name: "NODENAME"
value: "couchdb0"
readinessProbe:
httpGet:
port: 5984
# Tempting to say "/$(DB_PREFIX)_activations", but probe runs
# externally, therefore can't access the container environment...
path: "/test_activations"
initialDelaySeconds: 60
periodSeconds: 10
failureThreshold: 10
timeoutSeconds: 1
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: couchdb-netpol
namespace: openwhisk
spec:
podSelector:
matchLabels:
name: couchdb
ingress:
# Allow controller, invoker, and any pod with access=db to connect to couchdb
- from:
- podSelector:
matchLabels:
name: controller
- podSelector:
matchLabels:
name: invoker
- podSelector:
matchLabels:
access: db
ports:
- port: 5984