| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 1 | kind: ClusterRole |
| 2 | metadata: |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 3 | name: {{ .Values.clusterRoleName }} |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 4 | rules: |
| 5 | - apiGroups: |
| 6 | - "" |
| 7 | resources: |
| 8 | - namespaces |
| 9 | verbs: |
| 10 | - create |
| 11 | --- |
| 12 | apiVersion: rbac.authorization.k8s.io/v1 |
| 13 | kind: ClusterRoleBinding |
| 14 | metadata: |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 15 | name: {{ .Values.clusterRoleName }} |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 16 | roleRef: |
| 17 | apiGroup: rbac.authorization.k8s.io |
| 18 | kind: ClusterRole |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 19 | name: {{ .Values.clusterRoleName }} |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 20 | subjects: |
| 21 | - kind: ServiceAccount |
| 22 | name: default |
| 23 | namespace: {{ .Release.Namespace }} |
| 24 | --- |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 25 | apiVersion: v1 |
| 26 | kind: Secret |
| 27 | metadata: |
| 28 | name: ssh-key |
| 29 | type: Opaque |
| 30 | data: |
| 31 | private: {{ .Values.sshPrivateKey }} |
| 32 | --- |
| 33 | apiVersion: v1 |
| 34 | kind: Service |
| 35 | metadata: |
| 36 | name: welcome |
| 37 | namespace: {{ .Release.Namespace }} |
| 38 | spec: |
| 39 | type: ClusterIP |
| 40 | selector: |
| 41 | app: welcome |
| 42 | ports: |
| 43 | - name: http |
| 44 | port: 80 |
| 45 | targetPort: http |
| 46 | protocol: TCP |
| 47 | --- |
| 48 | apiVersion: networking.k8s.io/v1 |
| 49 | kind: Ingress |
| 50 | metadata: |
| 51 | name: ingress |
| 52 | namespace: {{ .Release.Namespace }} |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 53 | {{- if .Values.certificateIssuer }} |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 54 | annotations: |
| 55 | acme.cert-manager.io/http01-edit-in-place: "true" |
| 56 | cert-manager.io/cluster-issuer: {{ .Values.ingress.certificateIssuer}} |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 57 | {{- end }} |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 58 | spec: |
| 59 | ingressClassName: {{ .Values.ingress.className }} |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 60 | {{- if .Values.certificateIssuer }} |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 61 | tls: |
| 62 | - hosts: |
| 63 | - {{ .Values.ingress.domain }} |
| 64 | secretName: cert-welcome |
| Giorgi Lekveishvili | 9d03733 | 2023-07-06 19:48:49 +0400 | [diff] [blame^] | 65 | {{- end }} |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 66 | 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 | --- |
| 78 | apiVersion: apps/v1 |
| 79 | kind: Deployment |
| 80 | metadata: |
| 81 | name: welcome |
| 82 | namespace: {{ .Release.Namespace }} |
| 83 | spec: |
| 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 |