-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathk8s.yaml
109 lines (108 loc) · 2.41 KB
/
k8s.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
apiVersion: v1
kind: Namespace
metadata:
name: graphik
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pod-reader
namespace: graphik
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["get", "watch", "list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pod-reader-binding
namespace: graphik
subjects:
# Google Cloud user account
# - kind: User
# name: [email protected]
# Kubernetes service account
- kind: ServiceAccount
name: default
# # IAM service account
# - kind: User
# name: test-account@test-project-123456.google.com.iam.gserviceaccount.com
# # Google Group
# - kind: Group
# name: [email protected]
roleRef:
kind: Role
name: pod-reader
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Service
metadata:
name: graphik
namespace: graphik
labels:
app: graphik
spec:
ports:
- port: 7820
name: api
- port: 7821
name: admin
clusterIP: None
selector:
app: graphik
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: graphik
namespace: graphik
spec:
serviceName: graphik
replicas: 3
selector:
matchLabels:
app: graphik
template:
metadata:
labels:
app: graphik
spec:
containers:
- name: graphik
env:
- name: GRAPHIK_OPEN_ID
value: https://accounts.google.com/.well-known/openid-configuration
- name: GRAPHIK_ROOT_USERS
value: [email protected]
- name: GRAPHIK_ENVIRONMENT
value: k8s
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
image: graphikdb/graphik:v1.4.1
imagePullPolicy: Always
ports:
- containerPort: 7821
- containerPort: 7820
volumeMounts:
- name: database-storage
mountPath: /tmp/graphik
volumeClaimTemplates:
- metadata:
name: database-storage
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi