-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yml
76 lines (72 loc) · 1.7 KB
/
deploy.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
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: deploycat-db
namespace: deploycat-system
spec:
instances: 3
bootstrap:
initdb:
database: deploycat
owner: deploycat
# secret:
# name: app-db
storage:
storageClass: longhorn
size: 1Gi
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: deploycat
rules:
- apiGroups: ["*"]
resources: ["*"]
verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: deploycat-binding
roleRef: # points to my Role
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: deploycat # name of role
subjects: # points to my ServiceAccount
- kind: ServiceAccount
name: app # service account to bind to
namespace: deploycat-system # ns of service account
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: app
namespace: deploycat-system
---
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: app
namespace: deploycat-system
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/min-scale: "1"
spec:
serviceAccountName: app
containers:
- name: app
image: ghcr.io/deploy-cat/deploy-cat-web:latest
ports:
- containerPort: 3000
env:
- name: DEPLOYCAT_KUBECONFIG_FROM_CLUSTER
value: "true"
- name: DEPLOYCAT_PROMETHEUS_URL
value: "http://prometheus-47978363-kube-p-prometheus.deploycat-system.svc.cluster.local:9090"
- name: DEPLOYCAT_DATABASE_URL
valueFrom:
secretKeyRef:
name: deploycat-db-app
key: uri