Skip to content

Commit e71233f

Browse files
authored
feat: add ballast (#574)
1 parent 2348abb commit e71233f

File tree

7 files changed

+170
-6
lines changed

7 files changed

+170
-6
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A Helm chart for Codefresh Runner
33
name: cf-runtime
4-
version: 7.5.12
4+
version: 7.6.0
55
keywords:
66
- codefresh
77
- runner
@@ -17,10 +17,8 @@ annotations:
1717
artifacthub.io/containsSecurityUpdates: "true"
1818
# Supported kinds: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`:
1919
artifacthub.io/changes: |
20-
- kind: security
21-
description: "updated engine with security fixes"
22-
- kind: security
23-
description: "updated dind-volume-provisioner with security fixes"
20+
- kind: added
21+
description: "Add ballast deployment"
2422
dependencies:
2523
- name: cf-common
2624
repository: oci://quay.io/codefresh/charts

charts/cf-runtime/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Codefresh Runner
22

3-
![Version: 7.5.12](https://img.shields.io/badge/Version-7.5.12-informational?style=flat-square)
3+
![Version: 7.6.0](https://img.shields.io/badge/Version-7.6.0-informational?style=flat-square)
44

55
Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes.
66

@@ -1098,6 +1098,17 @@ Go to [https://<YOUR_ONPREM_DOMAIN_HERE>/admin/runtime-environments/system](http
10981098
| appProxy.serviceAccount.namespaced | bool | `true` | Use Role(true)/ClusterRole(true) |
10991099
| appProxy.tolerations | list | `[]` | Set tolerations |
11001100
| appProxy.updateStrategy | object | `{"type":"RollingUpdate"}` | Upgrade strategy |
1101+
| ballast | object | See below | Ballast parameters |
1102+
| ballast.dind.image | object | `{"digest":"sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a","registry":"registry.k8s.io","repository":"pause","tag":3.1}` | Set image |
1103+
| ballast.dind.podAnnotations | object | `{}` | Set pod annotations |
1104+
| ballast.dind.podSecurityContext | object | `{}` | Add additional env vars |
1105+
| ballast.dind.replicasCount | int | `1` | Set number of pods |
1106+
| ballast.dind.resources | object | `{}` | Set resources |
1107+
| ballast.engine.image | object | `{"digest":"sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a","registry":"registry.k8s.io","repository":"pause","tag":3.1}` | Set image |
1108+
| ballast.engine.podAnnotations | object | `{}` | Set pod annotations |
1109+
| ballast.engine.podSecurityContext | object | `{}` | Add additional env vars |
1110+
| ballast.engine.replicasCount | int | `1` | Set number of pods |
1111+
| ballast.engine.resources | object | `{}` | Set resources |
11011112
| dockerRegistry | string | `""` | |
11021113
| event-exporter | object | See below | Event exporter parameters |
11031114
| event-exporter.affinity | object | `{}` | Set affinity |
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{{- define "ballast.resources.deployment" -}}
2+
{{- $cfCommonTplSemver := printf "cf-common-%s" (index .Subcharts "cf-common").Chart.Version }}
3+
{{- $name := .Values.name }}
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: {{ include "ballast.fullname" . }}-{{ $name }}
8+
labels:
9+
{{- include "ballast.labels" . | nindent 4 }}
10+
spec:
11+
replicas: {{ .Values.replicasCount }}
12+
selector:
13+
matchLabels:
14+
{{- include "ballast.selectorLabels" . | nindent 6 }}
15+
app.kubernetes.io/component: {{ $name }}
16+
template:
17+
metadata:
18+
labels:
19+
{{- include "ballast.selectorLabels" . | nindent 8 }}
20+
app.kubernetes.io/component: {{ $name }}
21+
{{- with .Values.podAnnotations }}
22+
annotations:
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
spec:
26+
priorityClassName: cf-ballast
27+
{{- if .Values.schedulerName }}
28+
schedulerName: {{ .Values.schedulerName }}
29+
{{- end }}
30+
{{- include (printf "%s.image.pullSecrets" $cfCommonTplSemver) . | nindent 8 }}
31+
{{- if .Values.podSecurityContext.enabled }}
32+
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
33+
{{- end }}
34+
containers:
35+
- name: pause
36+
image: {{ include (printf "%s.image.name" $cfCommonTplSemver) (dict "image" .Values.image "context" .) }}
37+
imagePullPolicy: {{ .Values.image.pullPolicy | default "Always" }}
38+
resources:
39+
{{- toYaml .Values.resources | nindent 12 }}
40+
{{- with .Values.nodeSelector }}
41+
nodeSelector:
42+
{{- toYaml . | nindent 8 }}
43+
{{- end }}
44+
{{- with .Values.affinity }}
45+
affinity:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
48+
{{- with .Values.tolerations }}
49+
tolerations:
50+
{{- toYaml . | nindent 6 }}
51+
{{- end }}
52+
{{- end -}}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "ballast.name" -}}
5+
{{- printf "%s-%s" (include "cf-runtime.name" .) "ballast" | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "ballast.fullname" -}}
14+
{{- printf "%s-%s" (include "cf-runtime.fullname" .) "ballast" | trunc 63 | trimSuffix "-" }}
15+
{{- end }}
16+
17+
{{/*
18+
Common labels
19+
*/}}
20+
{{- define "ballast.labels" -}}
21+
{{ include "cf-runtime.labels" . }}
22+
codefresh.io/application: ballast
23+
{{- end }}
24+
25+
{{/*
26+
Selector labels
27+
*/}}
28+
{{- define "ballast.selectorLabels" -}}
29+
{{ include "cf-runtime.selectorLabels" . }}
30+
codefresh.io/application: ballast
31+
{{- end }}
32+
33+
{{/*
34+
Create the name of the service account to use
35+
*/}}
36+
{{- define "ballast.serviceAccountName" -}}
37+
{{- if .Values.serviceAccount.create }}
38+
{{- default (include "ballast.fullname" .) .Values.serviceAccount.name }}
39+
{{- else }}
40+
{{- default "default" .Values.serviceAccount.name }}
41+
{{- end }}
42+
{{- end }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- range $key, $val := .Values.ballast }}
2+
---
3+
{{- $ballastContext := deepCopy $ }}
4+
{{- $_ := set $ballastContext "Values" $val }}
5+
{{- $_ := set $ballastContext.Values "global" (get $.Values "global") }}
6+
{{- $_ := set $ballastContext.Values "nameOverride" (get $.Values "nameOverride") }}
7+
{{- $_ := set $ballastContext.Values "fullnameOverride" (get $.Values "fullnameOverride") }}
8+
{{- $_ := set $ballastContext.Values "name" $key }}
9+
{{- $_ := set $ballastContext.Values "nodeSelector" (get (index $ "Values" "runtime" $key) "nodeSelector") }}
10+
{{- $_ := set $ballastContext.Values "affinity" (get (index $ "Values" "runtime" $key) "affinity") }}
11+
{{- $_ := set $ballastContext.Values "tolerations" (get (index $ "Values" "runtime" $key) "tolerations") }}
12+
{{- $_ := set $ballastContext.Values "schedulerName" (get (index $ "Values" "runtime" $key) "schedulerName") }}
13+
14+
{{- if $ballastContext.Values.enabled }}
15+
{{- include "ballast.resources.deployment" $ballastContext }}
16+
{{- end }}
17+
18+
{{- end }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{{- if or .Values.ballast.dind.enabled .Values.ballast.engine.enabled -}}
2+
apiVersion: scheduling.k8s.io/v1
3+
kind: PriorityClass
4+
metadata:
5+
name: cf-ballast
6+
value: -1000000
7+
globalDefault: false
8+
{{- end -}}

charts/cf-runtime/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,41 @@ event-exporter:
878878
tolerations: []
879879
# -- Set affinity
880880
affinity: {}
881+
# -- Ballast parameters
882+
# @default -- See below
883+
ballast:
884+
dind:
885+
enabled: false
886+
# -- Set number of pods
887+
replicasCount: 1
888+
# -- Set pod annotations
889+
podAnnotations: {}
890+
# -- Set image
891+
image:
892+
registry: registry.k8s.io
893+
repository: pause
894+
tag: 3.10
895+
digest: sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a
896+
# -- Add additional env vars
897+
podSecurityContext: {}
898+
# -- Set resources
899+
resources: {}
900+
engine:
901+
enabled: false
902+
# -- Set number of pods
903+
replicasCount: 1
904+
# -- Set pod annotations
905+
podAnnotations: {}
906+
# -- Set image
907+
image:
908+
registry: registry.k8s.io
909+
repository: pause
910+
tag: 3.10
911+
digest: sha256:ee6521f290b2168b6e0935a181d4cff9be1ac3f505666ef0e3c98fae8199917a
912+
# -- Add additional env vars
913+
podSecurityContext: {}
914+
# -- Set resources
915+
resources: {}
881916
# -- Array of extra objects to deploy with the release
882917
extraResources: []
883918
# E.g.

0 commit comments

Comments
 (0)