-
Notifications
You must be signed in to change notification settings - Fork 19
/
k8s_example.yaml
131 lines (131 loc) · 2.84 KB
/
k8s_example.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-config
labels:
app: postgres
data:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:13
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres-config
---
apiVersion: v1
kind: Service
metadata:
labels:
app: postgres
name: postgres
spec:
ports:
- protocol: TCP
port: 5432
targetPort: 5432
selector:
app: postgres
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: hasura
hasuraService: custom
name: hasura
spec:
replicas: 1
selector:
matchLabels:
app: hasura
template:
metadata:
creationTimestamp: null
labels:
app: hasura
spec:
volumes:
- name: logs
emptyDir: {}
shareProcessNamespace: true
containers:
- name: hasura-metric-adapter
image: ....
env:
- name: LOG_FILE
value: /tmp/log/stdout.log
- name: LISTEN_ADDR
value: 0.0.0.0:9999
- name: OPENTEL_ENDPOINT
value: 0.0.0.0:4317
- name: HASURA_GRAPHQL_ADMIN_SECRET
value: test
volumeMounts:
- name: logs
mountPath: /tmp/log
ports:
- containerPort: 9999
protocol: TCP
- image: hasura/graphql-engine:v2.3.1
imagePullPolicy: IfNotPresent
volumeMounts:
- name: logs
mountPath: /tmp/log
command: [
"/bin/sh", "-c", "rm -rf /tmp/log/stdout.log && mkfifo /tmp/log/stdout.log && /bin/graphql-engine serve | tee /tmp/log/stdout.log"
]
name: hasura
env:
- name: HASURA_GRAPHQL_ADMIN_SECRET
value: test
- name: HASURA_GRAPHQL_DATABASE_URL
value: postgres://postgres:postgres@postgres:5432/postgres
## enable the console served by server
- name: HASURA_GRAPHQL_ENABLE_CONSOLE
value: "true"
- name: HASURA_GRAPHQL_ENABLED_LOG_TYPES
value: "startup, http-log, webhook-log, websocket-log, query-log"
## enable debugging mode. It is recommended to disable this in production
- name: HASURA_GRAPHQL_DEV_MODE
value: "true"
ports:
- containerPort: 8080
protocol: TCP
resources: {}
---
apiVersion: v1
kind: Service
metadata:
labels:
app: hasura
name: hasura
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: hasura
type: ClusterIP