blob: d151411130411fb1619e1be9d8c81d2a26e52535 [file] [log] [blame]
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +04001kind: ClusterRole
2metadata:
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +04003 name: {{ .Values.clusterRoleName }}
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +04004rules:
5- apiGroups:
6 - ""
7 resources:
8 - namespaces
9 verbs:
10 - create
11---
12apiVersion: rbac.authorization.k8s.io/v1
13kind: ClusterRoleBinding
14metadata:
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040015 name: {{ .Values.clusterRoleName }}
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +040016roleRef:
17 apiGroup: rbac.authorization.k8s.io
18 kind: ClusterRole
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040019 name: {{ .Values.clusterRoleName }}
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +040020subjects:
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 }}
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040053 {{- if .Values.certificateIssuer }}
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040054 annotations:
55 acme.cert-manager.io/http01-edit-in-place: "true"
56 cert-manager.io/cluster-issuer: {{ .Values.ingress.certificateIssuer}}
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040057 {{- end }}
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040058spec:
59 ingressClassName: {{ .Values.ingress.className }}
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040060 {{- if .Values.certificateIssuer }}
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040061 tls:
62 - hosts:
63 - {{ .Values.ingress.domain }}
64 secretName: cert-welcome
Giorgi Lekveishvili9d037332023-07-06 19:48:49 +040065 {{- end }}
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040066 rules:
67 - host: {{ .Values.ingress.domain }}
68 http:
69 paths:
70 - path: /
71 pathType: Prefix
72 backend:
73 service:
74 name: welcome
75 port:
76 name: http
77---
78apiVersion: apps/v1
79kind: Deployment
80metadata:
81 name: welcome
82 namespace: {{ .Release.Namespace }}
83spec:
84 selector:
85 matchLabels:
86 app: welcome
87 replicas: 1
88 template:
89 metadata:
90 labels:
91 app: welcome
92 spec:
93 volumes:
94 - name: ssh-key
95 secret:
96 secretName: ssh-key
97 containers:
98 - name: welcome
99 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
100 imagePullPolicy: {{ .Values.image.pullPolicy }}
101 ports:
102 - name: http
103 containerPort: 8080
104 protocol: TCP
105 command:
106 - pcloud-installer
107 - welcome
108 - --repo-addr={{ .Values.repoAddr }}
109 - --ssh-key=/pcloud/ssh-key/private
110 - --port=8080
111 volumeMounts:
112 - name: ssh-key
113 readOnly: true
114 mountPath: /pcloud/ssh-key