Skip to content

Commit 23aa954

Browse files
committed
kubernetes support for 1.16 and up
1 parent 9b08134 commit 23aa954

6 files changed

+48
-7
lines changed

requirements.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: postgresql
33
repository: https://kubernetes-charts.storage.googleapis.com/
4-
version: 5.3.8
5-
digest: sha256:8beae180ba7a5ca551f75da9552e59cadbbfcce2d0e2edf6c8a93dcfacd0df10
6-
generated: "2019-06-20T13:43:23.321244-04:00"
4+
version: 6.5.5
5+
digest: sha256:25655b1d890ab9555c02d53f7e32af63e577a8e3d0100215bec99c3a20b2a581
6+
generated: "2019-11-05T12:06:42.391348432+01:00"

requirements.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies:
22
- name: postgresql
3-
version: 5.3.8
3+
version: 6.5.5
44
repository: https://kubernetes-charts.storage.googleapis.com/
55
condition: postgresql.enabled

templates/_helpers.tpl

+33
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,36 @@ Creates the address of the TSA service.
6161
{{- $port := .Values.concourse.web.tsa.bindPort -}}
6262
{{ template "concourse.web.fullname" . }}:{{- print $port -}}
6363
{{- end -}}
64+
65+
{{/*
66+
Return the appropriate apiVersion for deployment.
67+
*/}}
68+
{{- define "concourse.deployment.apiVersion" -}}
69+
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}
70+
{{- print "extensions/v1beta1" -}}
71+
{{- else -}}
72+
{{- print "apps/v1" -}}
73+
{{- end -}}
74+
{{- end -}}
75+
76+
{{/*
77+
Return the appropriate apiVersion for statefulset.
78+
*/}}
79+
{{- define "concourse.statefulset.apiVersion" -}}
80+
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}
81+
{{- print "apps/v1beta2" -}}
82+
{{- else -}}
83+
{{- print "apps/v1" -}}
84+
{{- end -}}
85+
{{- end -}}
86+
87+
{{/*
88+
Return the appropriate apiVersion for ingress.
89+
*/}}
90+
{{- define "concourse.ingress.apiVersion" -}}
91+
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
92+
{{- print "extensions/v1beta1" -}}
93+
{{- else -}}
94+
{{- print "networking.k8s.io/v1beta1" -}}
95+
{{- end -}}
96+
{{- end -}}

templates/web-deployment.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.web.enabled -}}
2-
apiVersion: extensions/v1beta1
2+
apiVersion: {{ template "concourse.deployment.apiVersion" . }}
33
kind: Deployment
44
metadata:
55
name: {{ template "concourse.web.fullname" . }}
@@ -13,6 +13,10 @@ spec:
1313
{{- if .Values.web.strategy }}
1414
{{ toYaml .Values.web.strategy | indent 2 }}
1515
{{- end }}
16+
selector:
17+
matchLabels:
18+
app: {{ template "concourse.web.fullname" . }}
19+
release: {{ .Release.Name }}
1620
template:
1721
metadata:
1822
labels:

templates/web-ingress.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{- $releaseName := .Release.Name -}}
44
{{- $serviceName := default "web" .Values.web.nameOverride -}}
55
{{- $servicePort := .Values.concourse.web.bindPort -}}
6-
apiVersion: extensions/v1beta1
6+
apiVersion: {{ template "concourse.ingress.apiVersion" . }}
77
kind: Ingress
88
metadata:
99
name: {{ template "concourse.web.fullname" . }}

templates/worker-statefulset.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.worker.enabled -}}
2-
apiVersion: apps/v1beta1
2+
apiVersion: {{ template "concourse.statefulset.apiVersion" . }}
33
kind: StatefulSet
44
metadata:
55
name: {{ template "concourse.worker.fullname" . }}
@@ -11,6 +11,10 @@ metadata:
1111
spec:
1212
serviceName: {{ template "concourse.worker.fullname" . }}
1313
replicas: {{ .Values.worker.replicas }}
14+
selector:
15+
matchLabels:
16+
app: {{ template "concourse.worker.fullname" . }}
17+
release: {{ .Release.Name }}
1418
template:
1519
metadata:
1620
labels:

0 commit comments

Comments
 (0)