blob: ddeeab612d083bbd1ba0b18d2e2388148f25b2ae [file] [log] [blame]
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +04001kind: ClusterRole
2metadata:
3 name: {{ .Global.PCloudEnvName }}-welcome
4rules:
5- apiGroups:
6 - ""
7 resources:
8 - namespaces
9 verbs:
10 - create
11---
12apiVersion: rbac.authorization.k8s.io/v1
13kind: ClusterRoleBinding
14metadata:
15 name: {{ .Global.PCloudEnvName }}-welcome
16roleRef:
17 apiGroup: rbac.authorization.k8s.io
18 kind: ClusterRole
19 name: {{ .Global.PCloudEnvName }}-welcome
20subjects:
21- kind: ServiceAccount
22 name: default
23 namespace: {{ .Release.Namespace }}
24---
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040025apiVersion: v1
26kind: Secret
27metadata:
28 name: ssh-key
29type: Opaque
30data:
31 private: {{ .Values.sshPrivateKey }}
32---
33apiVersion: v1
34kind: Service
35metadata:
36 name: welcome
37 namespace: {{ .Release.Namespace }}
38spec:
39 type: ClusterIP
40 selector:
41 app: welcome
42 ports:
43 - name: http
44 port: 80
45 targetPort: http
46 protocol: TCP
47---
48apiVersion: networking.k8s.io/v1
49kind: Ingress
50metadata:
51 name: ingress
52 namespace: {{ .Release.Namespace }}
53 annotations:
54 acme.cert-manager.io/http01-edit-in-place: "true"
55 cert-manager.io/cluster-issuer: {{ .Values.ingress.certificateIssuer}}
56spec:
57 ingressClassName: {{ .Values.ingress.className }}
58 tls:
59 - hosts:
60 - {{ .Values.ingress.domain }}
61 secretName: cert-welcome
62 rules:
63 - host: {{ .Values.ingress.domain }}
64 http:
65 paths:
66 - path: /
67 pathType: Prefix
68 backend:
69 service:
70 name: welcome
71 port:
72 name: http
73---
74apiVersion: apps/v1
75kind: Deployment
76metadata:
77 name: welcome
78 namespace: {{ .Release.Namespace }}
79spec:
80 selector:
81 matchLabels:
82 app: welcome
83 replicas: 1
84 template:
85 metadata:
86 labels:
87 app: welcome
88 spec:
89 volumes:
90 - name: ssh-key
91 secret:
92 secretName: ssh-key
93 containers:
94 - name: welcome
95 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
96 imagePullPolicy: {{ .Values.image.pullPolicy }}
97 ports:
98 - name: http
99 containerPort: 8080
100 protocol: TCP
101 command:
102 - pcloud-installer
103 - welcome
104 - --repo-addr={{ .Values.repoAddr }}
105 - --ssh-key=/pcloud/ssh-key/private
106 - --port=8080
107 volumeMounts:
108 - name: ssh-key
109 readOnly: true
110 mountPath: /pcloud/ssh-key