-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathk8s.dply.cue
129 lines (116 loc) · 2.98 KB
/
k8s.dply.cue
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
package k8s
deployment <Name>: {
apiVersion: *"extensions/v1beta1" | string
kind: "Deployment"
metadata name: *Name | string
spec: {
replicas: *1 | int
selector matchLabels app: *Name | string
template: {
metadata labels app: *Name | string
spec containers: [{name: *Name | string }]
}
}
}
service <Name>: {
apiVersion: *"v1" | string
kind: "Service"
metadata name: *Name | string
metadata annotations "dev.okteto.com/auto-ingress": *"true" | bool
spec: {
type: *"ClusterIP" | string
selector app: *Name | string
ports: [...{
name: *Name | string
port: int
}]
}
}
configMap <Name>: {
apiVersion: *"v1" | string
kind: "ConfigMap"
metadata name: *"config-\(Name)" | string
metadata labels app: *Name | string
}
persistentVolumeClaim <Name>: {
apiVersion: *"v1" | string
kind: "PersistentVolumeClaim"
metadata name: *"pv-claim-\(Name)" | string
spec accessModes: ["ReadWriteOnce"]
spec resources requests storage: *"100Mi" | string
}
job <Name>: {
apiVersion: *"batch/v1" | string
kind: "Job"
metadata name: *Name | string
spec template spec restartPolicy: *"Never" | string
spec template spec containers: [{ name: *Name | string }]
spec backoffLimit: *4 | int
}
ingress <Name>: {
apiVersion: "networking.k8s.io/v1beta1"
kind: "Ingress"
metadata name: "ingress-\(Name)"
spec rules: [{ }]
}
//////////////////
deployment api: {
spec template spec containers: [{
image: "docker.pkg.github.com/nmrshll/auth-rs-warp/api:latest"
envFrom: [{ configMapRef name: "config-postgres" }]
}]
spec template spec imagePullSecrets:[{
// manually: add credentials to cluster: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
name: "regcred-tender-apps"
}]
}
service api: {
spec type: "LoadBalancer"
metadata annotations "dev.okteto.com/auto-ingress": false
spec ports: [{ port: 7655 },{ name: "ws", port: 7654 }]
}
deployment postgres: {
spec template spec containers: [{
image: "postgres:10.4"
ports: [{ containerPort: 5432 }]
envFrom: [{ configMapRef name: "config-postgres" }]
volumeMounts: [{
name: "volume-postgres-data"
mountPath: "/var/lib/postgresql"
subPath: "data"
}]
}]
spec template spec volumes: [{
name: "volume-postgres-data"
persistentVolumeClaim claimName: "pv-claim-postgres"
}]
}
service postgres: {
spec ports: [{ port: 5432 }]
}
configMap postgres data: {
POSTGRES_DB: "postgresdb"
POSTGRES_USER: "postgresuser"
POSTGRES_PASSWORD: "postgrespassword"
POSTGRES_HOST: "postgres:5432"
}
persistentVolumeClaim postgres: {}
deployment adminer: {
spec template spec containers: [{
image: "adminer:4.2.5"
ports: [{ containerPort: 8080 }]
}]
}
service adminer: {
spec ports: [{
port: 7897
targetPort: 8080
}]
}
job migrations: {
spec template spec containers: [{
image: "docker.pkg.github.com/nmrshll/auth-rs-warp/api-migrations:latest"
envFrom: [{ secretRef name: "auth-rs-warp-postgres-db" }]
}]
spec template spec imagePullSecrets:[{ name: "regcred-tender-apps" }]
}