|
| 1 | +# Copyright (c) 2021 Gitpod GmbH. All rights reserved. |
| 2 | +# Licensed under the MIT License. See License-MIT.txt in the project root for license information. |
| 3 | + |
| 4 | +{{ $comp := .Values.components.openVsxProxy -}} |
| 5 | +{{- $this := dict "root" . "gp" $.Values "comp" $comp -}} |
| 6 | +{{- if not $comp.disabled -}} |
| 7 | +kind: StatefulSet |
| 8 | +apiVersion: apps/v1 |
| 9 | +metadata: |
| 10 | + name: openvsx-proxy |
| 11 | + labels: |
| 12 | + app: {{ template "gitpod.fullname" . }} |
| 13 | + component: openvsx-proxy |
| 14 | + kind: statefulset |
| 15 | + stage: {{ .Values.installation.stage }} |
| 16 | +spec: |
| 17 | + selector: |
| 18 | + matchLabels: |
| 19 | + app: {{ template "gitpod.fullname" . }} |
| 20 | + component: openvsx-proxy |
| 21 | + kind: pod |
| 22 | + stage: {{ .Values.installation.stage }} |
| 23 | + serviceName: openvsx-proxy |
| 24 | + replicas: {{ $comp.replicas | default 1 }} |
| 25 | + template: |
| 26 | + metadata: |
| 27 | + name: openvsx-proxy |
| 28 | + labels: |
| 29 | + app: {{ template "gitpod.fullname" . }} |
| 30 | + component: openvsx-proxy |
| 31 | + kind: pod |
| 32 | + stage: {{ .Values.installation.stage }} |
| 33 | + spec: |
| 34 | +{{ include "gitpod.pod.affinity" $this | indent 6 }} |
| 35 | + serviceAccount: openvsx-proxy |
| 36 | + containers: |
| 37 | + - name: openvsx-proxy |
| 38 | + image: {{ template "gitpod.comp.imageFull" $this }} |
| 39 | + args: |
| 40 | + - /config/config.json |
| 41 | + readinessProbe: |
| 42 | + httpGet: |
| 43 | + path: /openvsx-proxy-status |
| 44 | + port: 8080 |
| 45 | +{{ include "gitpod.container.imagePullPolicy" $this | indent 8 }} |
| 46 | +{{ include "gitpod.container.resources" $this | indent 8 }} |
| 47 | +{{ include "gitpod.container.ports" $this | indent 8 }} |
| 48 | + volumeMounts: |
| 49 | + - name: config |
| 50 | + mountPath: "/config" |
| 51 | +{{ include "gitpod.container.defaultEnv" (dict "root" . "gp" $.Values "comp" $comp) | indent 8 }} |
| 52 | +{{ if $comp.enableRedis }} |
| 53 | + - name: redis |
| 54 | + image: redis:6.2 |
| 55 | + command: |
| 56 | + - redis-server |
| 57 | + - "/config/redis.conf" |
| 58 | + env: |
| 59 | + - name: MASTER |
| 60 | + value: "true" |
| 61 | + ports: |
| 62 | + - containerPort: 6379 |
| 63 | +{{ include "gitpod.container.imagePullPolicy" $this | indent 8 }} |
| 64 | +{{ include "gitpod.container.resources" $this | indent 8 }} |
| 65 | + volumeMounts: |
| 66 | + - mountPath: /config |
| 67 | + name: config |
| 68 | + - mountPath: /data |
| 69 | + name: redis-data |
| 70 | +{{ end }} |
| 71 | + volumes: |
| 72 | + - name: config |
| 73 | + configMap: |
| 74 | + name: {{ template "gitpod.comp.configMap" $this }} |
| 75 | +{{ toYaml .Values.defaults | indent 6 }} |
| 76 | + |
| 77 | +{{ if $comp.enableRedis }} |
| 78 | + volumeClaimTemplates: |
| 79 | + - metadata: |
| 80 | + name: redis-data |
| 81 | + labels: |
| 82 | + app: {{ template "gitpod.fullname" . }} |
| 83 | + component: openvsx-proxy |
| 84 | + kind: volumeclaim |
| 85 | + stage: {{ .Values.installation.stage }} |
| 86 | + spec: |
| 87 | + accessModes: [ "ReadWriteOnce" ] |
| 88 | + resources: |
| 89 | + requests: |
| 90 | + storage: 8Gi |
| 91 | +{{ end }} |
| 92 | + |
| 93 | +{{ end }} |
0 commit comments