Skip to content

Commit e1f79db

Browse files
committed
Upgraded to Helm API v2 (Helm 3+)
1 parent 6e15b6b commit e1f79db

File tree

10 files changed

+101
-43
lines changed

10 files changed

+101
-43
lines changed

azure-pipelines.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: $(version).$(Rev:r)
22

33
variables:
4-
version: 3.0
4+
version: 4.0
55
buildConfiguration: "Release"
66
imageRepository: "emberstack/sftp"
77
DOCKER_CLI_EXPERIMENTAL: 'enabled'

src/deploy/helm/sftp/.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*.swp
1515
*.bak
1616
*.tmp
17+
*.orig
1718
*~
1819
# Various IDEs
1920
.project

src/deploy/helm/sftp/Chart.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
apiVersion: v1
2-
description: A Helm chart to deploy SFTP
3-
icon: https://raw.githubusercontent.com/EmberStack/CDN/master/Projects/docker-sftp/openssh.png
1+
apiVersion: v2
42
name: sftp
3+
description: A Helm chart to deploy SFTP
4+
type: application
55
version: 0.1.0
6+
appVersion: 0.1.0
7+
8+
icon: https://raw.githubusercontent.com/EmberStack/CDN/master/Projects/docker-sftp/openssh.png
69
keywords:
710
- sftp
811
- openssh
@@ -15,4 +18,3 @@ sources:
1518
maintainers:
1619
- name: winromulus
1720
email: helm-charts@emberstack.com
18-
engine: gotpl

src/deploy/helm/sftp/LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2019 emberstack
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2019 emberstack
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/deploy/helm/sftp/templates/_helpers.tpl

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,29 @@ Create chart name and version as used by the chart label.
3535
Common labels
3636
*/}}
3737
{{- define "sftp.labels" -}}
38-
app.kubernetes.io/name: {{ include "sftp.name" . }}
3938
helm.sh/chart: {{ include "sftp.chart" . }}
40-
app.kubernetes.io/instance: {{ .Release.Name }}
39+
{{ include "sftp.selectorLabels" . }}
4140
{{- if .Chart.AppVersion }}
4241
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
4342
{{- end }}
4443
app.kubernetes.io/managed-by: {{ .Release.Service }}
4544
{{- end -}}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "sftp.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "sftp.name" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
{{- end -}}
53+
54+
{{/*
55+
Create the name of the service account to use
56+
*/}}
57+
{{- define "sftp.serviceAccountName" -}}
58+
{{- if .Values.serviceAccount.create -}}
59+
{{ default (include "sftp.fullname" .) .Values.serviceAccount.name }}
60+
{{- else -}}
61+
{{ default "default" .Values.serviceAccount.name }}
62+
{{- end -}}
63+
{{- end -}}

src/deploy/helm/sftp/templates/config-secret.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kind: Secret
44
metadata:
55
name: {{ template "sftp.fullname" . }}
66
labels:
7-
{{ include "sftp.labels" . | indent 4 }}
7+
{{- include "sftp.labels" . | nindent 4 }}
88
type: Opaque
99
stringData:
1010
sftp.json: |-

src/deploy/helm/sftp/templates/deployment.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,32 @@ kind: Deployment
33
metadata:
44
name: {{ include "sftp.fullname" . }}
55
labels:
6-
{{ include "sftp.labels" . | indent 4 }}
6+
{{- include "sftp.labels" . | nindent 4 }}
77
spec:
88
replicas: {{ .Values.replicaCount }}
99
selector:
1010
matchLabels:
11-
app.kubernetes.io/name: {{ include "sftp.name" . }}
12-
app.kubernetes.io/instance: {{ .Release.Name }}
11+
{{- include "sftp.selectorLabels" . | nindent 6 }}
1312
template:
1413
metadata:
1514
labels:
16-
app.kubernetes.io/name: {{ include "sftp.name" . }}
17-
app.kubernetes.io/instance: {{ .Release.Name }}
15+
{{- include "sftp.selectorLabels" . | nindent 8 }}
1816
spec:
1917
{{- with .Values.imagePullSecrets }}
2018
imagePullSecrets:
2119
{{- toYaml . | nindent 8 }}
2220
{{- end }}
21+
serviceAccountName: {{ include "sftp.serviceAccountName" . }}
22+
securityContext:
23+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
2324
{{- with .Values.initContainers }}
2425
initContainers:
2526
{{- toYaml . | nindent 8 }}
2627
{{- end }}
2728
containers:
2829
- name: {{ .Chart.Name }}
30+
securityContext:
31+
{{- toYaml .Values.securityContext | nindent 12 }}
2932
{{- if .Values.image.tag }}
3033
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
3134
{{- else }}
@@ -47,7 +50,13 @@ spec:
4750
{{- with .Values.storage.volumeMounts }}
4851
{{- toYaml . | nindent 12 }}
4952
{{- end }}
50-
{{- end }}
53+
{{- end }}
54+
livenessProbe:
55+
tcpSocket:
56+
port: ssh
57+
readinessProbe:
58+
tcpSocket:
59+
port: ssh
5160
resources:
5261
{{- toYaml .Values.resources | nindent 12 }}
5362
{{- if or .Values.configuration .Values.storage.volumes }}

src/deploy/helm/sftp/templates/service.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ kind: Service
33
metadata:
44
name: {{ include "sftp.fullname" . }}
55
labels:
6-
{{ include "sftp.labels" . | indent 4 }}
7-
{{- if .Values.service.annotations }}
6+
{{- include "sftp.labels" . | nindent 4 }}
7+
{{- with .Values.service.annotations }}
88
annotations:
9-
{{ toYaml .Values.service.annotations | indent 4 }}
10-
{{- end }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
1111
spec:
1212
{{- if ne .Values.service.type "NodePort" }}
1313
{{- if .Values.service.clusterIP }}
@@ -35,5 +35,4 @@ spec:
3535
protocol: TCP
3636
name: ssh
3737
selector:
38-
app.kubernetes.io/name: {{ include "sftp.name" . }}
39-
app.kubernetes.io/instance: {{ .Release.Name }}
38+
{{- include "sftp.selectorLabels" . | nindent 4 }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "sftp.serviceAccountName" . }}
6+
labels:
7+
{{- include "sftp.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- end -}}

src/deploy/helm/sftp/values.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,31 @@ imagePullSecrets: []
1313
nameOverride: ""
1414
fullnameOverride: ""
1515

16-
1716
configuration: null
1817

18+
serviceAccount:
19+
# Specifies whether a service account should be created
20+
create: true
21+
# Annotations to add to the service account
22+
annotations: {}
23+
# The name of the service account to use.
24+
# If not set and create is true, a name is generated using the fullname template
25+
name:
26+
27+
podSecurityContext: {}
28+
# fsGroup: 2000
29+
30+
securityContext: {}
31+
# capabilities:
32+
# drop:
33+
# - ALL
34+
# readOnlyRootFilesystem: true
35+
# runAsNonRoot: true
36+
# runAsUser: 1000
1937
storage:
2038
volumeMounts: []
2139
volumes: []
2240

23-
2441
initContainers: []
2542

2643
service:

0 commit comments

Comments
 (0)