Skip to content

Commit aa13bbb

Browse files
[CR-9364] refactoring cf-runtime chart (#262)
* refactor cf-runtime chart * refactor cf-runtime chart * refactor cf-runtime chart * refactor cf-runtime chart * refactor cf-runtime chart * refactor cf-runtime chart * refactor cf-runtime chart
1 parent ea70144 commit aa13bbb

32 files changed

+384
-359
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,6 @@
11
apiVersion: v2
22
name: cf-runtime
3-
description: A Helm chart for Kubernetes
4-
5-
# A chart can be either an 'application' or a 'library' chart.
6-
#
7-
# Application charts are a collection of templates that can be packaged into versioned archives
8-
# to be deployed.
9-
#
10-
# Library charts provide useful utilities or functions for the chart developer. They're included as
11-
# a dependency of application charts to inject those utilities and functions into the rendering
12-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
3+
description: A Helm chart for Codefresh Runner
134
type: application
14-
15-
# This is the chart version. This version number should be incremented each time you make changes
16-
# to the chart and its templates, including the app version.
17-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.5
19-
20-
# This is the version number of the application being deployed. This version number should be
21-
# incremented each time you make changes to the application. Versions are not expected to
22-
# follow Semantic Versioning. They should reflect the version the application is using.
23-
# It is recommended to use it with quotes.
24-
appVersion: "1.16.0"
5+
version: 0.1.6
6+
appVersion: "0.1.6"

charts/cf-runtime/templates/app-proxy/_helpers.tpl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,12 @@ Selector labels
2828
{{- define "cf-app-proxy.selectorLabels" -}}
2929
{{ include "cf-runtime.selectorLabels" . }}
3030
codefresh.io/application: app-proxy
31-
{{- end }}
31+
{{- end }}
32+
33+
{{- define "cf-app-proxy.docker-image" -}}
34+
{{- if ne .Values.dockerRegistry ""}}
35+
{{- .Values.dockerRegistry }}/{{ .Values.appProxy.image }}
36+
{{- else }}
37+
{{- .Values.appProxy.image }}
38+
{{- end }}
39+
{{- end }}

charts/cf-runtime/templates/app-proxy/deployment.app-proxy.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ spec:
2121
serviceAccountName: {{ include "cf-app-proxy.fullname" . }}
2222
containers:
2323
- name: app-proxy
24-
image: {{ .Values.appProxy.image }}
24+
image: {{ include "cf-app-proxy.docker-image" . }}
2525
imagePullPolicy: Always
26-
{{/* resources:*/}}
27-
{{/* {{ toYaml .Values.AppProxy.resources | indent 10 }}*/}}
26+
resources:
27+
{{ toYaml .Values.appProxy.resources | indent 12 }}
2828
env:
2929
{{- if .Values.appProxy.env }}
3030
{{- range $key, $value := .Values.appProxy.env }}
@@ -55,4 +55,4 @@ spec:
5555
timeoutSeconds: 5
5656
successThreshold: 1
5757
failureThreshold: 5
58-
{{end}}
58+
{{end}}

charts/cf-runtime/templates/app-proxy/ingress.app-proxy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
{{ if .Values.appProxy.ingress.class }}kubernetes.io/ingress.class: {{ .Values.appProxy.ingress.class }}{{ end }}
99
{{ range $key, $value := .Values.appProxy.ingress.annotations }}
1010
{{ $key }}: {{ $value | quote }}
11-
{{ end }}
11+
{{ end }}
1212
spec:
1313
rules:
1414
- host: {{ .Values.appProxy.ingress.host }}
@@ -24,4 +24,4 @@ spec:
2424
- {{ .Values.appProxy.ingress.host }}
2525
secretName: {{ .Values.appProxy.ingress.tlsSecret }}
2626
{{ end }}
27-
{{ end }}
27+
{{ end }}

charts/cf-runtime/templates/app-proxy/role-binding.app-proxy.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{{ if .Values.appProxy.enabled }}
2-
32
kind: RoleBinding
43
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
@@ -13,5 +12,4 @@ roleRef:
1312
kind: ClusterRole
1413
name: {{ include "cf-app-proxy.fullname" . }}
1514
apiGroup: rbac.authorization.k8s.io
16-
17-
{{ end }}
15+
{{ end }}
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{{ if .Values.appProxy.enabled }}
2-
32
kind: Role
43
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
@@ -9,5 +8,4 @@ rules:
98
- apiGroups: [ "" ]
109
resources: [ "secrets" ]
1110
verbs: [ "get" ]
12-
13-
{{end}}
11+
{{end}}
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{{ if .Values.appProxy.enabled }}
2-
32
apiVersion: v1
43
kind: ServiceAccount
54
metadata:
65
name: {{ include "cf-app-proxy.fullname" . }}
76
labels: {{- include "cf-app-proxy.labels" . | nindent 4 }}
8-
{{/* annotations:*/}}
9-
{{/* {{ range $key, $value := .Values.AppProxy.ServiceAccount.Annotations }}*/}}
10-
{{/* {{ $key }}: {{ $value | quote | unescape }}*/}}
11-
{{/* {{ end }}*/}}
12-
13-
{{ end }}
7+
annotations:
8+
{{ range $key, $value := .Values.appProxy.serviceAccount.annotations }}
9+
{{ $key }}: {{ $value | quote }}
10+
{{ end }}
11+
{{ end }}

charts/cf-runtime/templates/app-proxy/service.app-proxy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ spec:
1010
- protocol: TCP
1111
port: 80
1212
targetPort: 3000
13-
{{ end }}
13+
{{ end }}

charts/cf-runtime/templates/monitor/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,12 @@ Selector labels
3232
{{- define "cf-monitor.selectorLabels" -}}
3333
{{ include "cf-runtime.selectorLabels" . }}
3434
codefresh.io/application: monitor
35+
{{- end }}
36+
37+
{{- define "cf-monitor.docker-image" -}}
38+
{{- if ne .Values.dockerRegistry ""}}
39+
{{- .Values.dockerRegistry }}/{{ .Values.monitor.image }}
40+
{{- else }}
41+
{{- .Values.monitor.image }}
42+
{{- end }}
3543
{{- end }}

charts/cf-runtime/templates/monitor/deployment.monitor.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spec:
2020
serviceAccountName: {{ include "cf-monitor.fullname" . }}
2121
containers:
2222
- name: monitor
23-
{{/* resources:*/}}
24-
{{/* {{ toYaml .Values.Monitor.resources | indent 10 }}*/}}
25-
image: {{ .Values.monitor.image }}
23+
resources:
24+
{{ toYaml .Values.monitor.resources | indent 12 }}
25+
image: {{ include "cf-monitor.docker-image" . }}
2626
imagePullPolicy: Always
2727
env:
2828
{{- if .Values.monitor.env }}
@@ -33,10 +33,10 @@ spec:
3333
{{- end}}
3434
- name: SERVICE_NAME
3535
value: {{ include "cf-monitor.fullname" . }}
36-
{{/* {{- if .Values.monitor.useNamespaceWithRole TODO: WTF }}*/}}
37-
{{/* - name: ROLE_BINDING*/}}
38-
{{/* value: "true"*/}}
39-
{{/* {{- end }}*/}}
36+
{{- if .Values.monitor.useNamespaceWideRole }} # not use cluster role
37+
- name: ROLE_BINDING
38+
value: "true"
39+
{{- end }}
4040
- name: PORT
4141
value: "9020"
4242
- name: API_TOKEN

0 commit comments

Comments
 (0)