diff --git a/CHANGELOG.md b/CHANGELOG.md index ec1bc0d68d2066e097fc7f2cac1a9191580b11e7..e3eb517a5e77b2bc13453b28583d2ec8c04a338c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --- +## [8.2.9-bb.1] (2024-10-15) + +### Added + +- Added customScripts functionality to toolbox container + ## [8.2.9-bb.0] (2024-10-02) ### Changed @@ -24,7 +30,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - update registry1.dso.mil/ironbank/gitlab/gitlab/gitlab-workhorse 17.2.8 -> 17.2.9 - update registry1.dso.mil/ironbank/gitlab/gitlab/kubectl 17.2.8 -> 17.2.9 - ## [8.2.8-bb.1] (2024-10-02) ### Changed diff --git a/README.md b/README.md index 63b581e8a3f739468acd5e28b1a949d9cd8e8ff7..bf32d5fca2c1a309105fd83947e55a4622da4fc5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ <!-- Warning: Do not manually edit this file. See notes on gluon + helm-docs at the end of this file for more information. --> # gitlab -  +  GitLab is the most comprehensive AI-powered DevSecOps Platform. @@ -851,6 +851,7 @@ helm install gitlab chart/ | gitlab.toolbox.containerSecurityContext.runAsUser | int | `1000` | | | gitlab.toolbox.containerSecurityContext.runAsGroup | int | `1000` | | | gitlab.toolbox.containerSecurityContext.capabilities.drop[0] | string | `"ALL"` | | +| gitlab.toolbox.customScripts | string | `nil` | | | gitlab.gitlab-exporter.enabled | bool | `false` | | | gitlab.gitlab-exporter.init.resources.limits.cpu | string | `"200m"` | | | gitlab.gitlab-exporter.init.resources.limits.memory | string | `"200Mi"` | | diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 1fc58f40c25d9cb5dcc3f410e7148ff697640589..2412e6c49b12d25f5f58a417a59b2194c240ef3d 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v1 name: gitlab -version: 8.2.9-bb.0 +version: 8.2.9-bb.1 appVersion: v17.2.9 description: GitLab is the most comprehensive AI-powered DevSecOps Platform. keywords: diff --git a/chart/charts/gitlab/charts/toolbox/templates/configmap-custom-scripts.yaml b/chart/charts/gitlab/charts/toolbox/templates/configmap-custom-scripts.yaml new file mode 100644 index 0000000000000000000000000000000000000000..00263cfbea6e1e7fb7423565f00604ffc2f91021 --- /dev/null +++ b/chart/charts/gitlab/charts/toolbox/templates/configmap-custom-scripts.yaml @@ -0,0 +1,17 @@ +{{- if .Values.enabled -}} +{{- if .Values.customScripts -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }}-custom-scripts + namespace: {{ $.Release.Namespace }} + labels: + {{- include "gitlab.standardLabels" . | nindent 4 }} + {{- include "gitlab.commonLabels" . | nindent 4 }} +data: + {{- range $key, $value := .Values.customScripts }} + {{ $key }}: | + {{ $value }} + {{- end }} +{{- end }} +{{- end }} diff --git a/chart/charts/gitlab/charts/toolbox/templates/deployment.yaml b/chart/charts/gitlab/charts/toolbox/templates/deployment.yaml index ed39b6a94661c6409cd992933bccd03e567750ec..dfea7752b6a74715eff29adecd26d3593b5e9250 100644 --- a/chart/charts/gitlab/charts/toolbox/templates/deployment.yaml +++ b/chart/charts/gitlab/charts/toolbox/templates/deployment.yaml @@ -162,6 +162,11 @@ spec: mountPath: /home/git/gitlab readOnly: true {{- end }} + {{- if .Values.customScripts }} + - name: {{ template "fullname" . }}-custom-scripts + mountPath: /scripts/custom + readOnly: true + {{- end }} {{- include "gitlab.certificates.volumeMount" . | nindent 12 }} resources: {{- toYaml .Values.resources | nindent 12 }} @@ -259,4 +264,11 @@ spec: medium: "Memory" {{- include "gitlab.certificates.volumes" . | nindent 6 }} {{- include "gitlab.nodeSelector" . | nindent 6 }} +{{- if .Values.customScripts }} + - name: {{ template "fullname" . }}-custom-scripts + projected: + sources: + - configMap: + name: {{ template "fullname" . }}-custom-scripts +{{- end }} {{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index c0136111fe5add645552acd910d591205b0b0afa..b6875f505bb870a903c1bb00b286ac73386d4715 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -1627,6 +1627,11 @@ gitlab: capabilities: drop: - ALL + customScripts: + # this will be mounted into the toolbox container at `/scripts/custom/testing.rb` + # execute it in the toolbox with `gitlab-rails runner /scripts/custom/testing.rb` + #testing.rb: | + # puts "testing" gitlab-exporter: enabled: false diff --git a/docs/DEVELOPMENT_MAINTENANCE.md b/docs/DEVELOPMENT_MAINTENANCE.md index b9b6dc16a0e83e7422feb1af60faf3fe742a45a1..814bb5255f4f8fc912870785c97ebe11a30b9790 100644 --- a/docs/DEVELOPMENT_MAINTENANCE.md +++ b/docs/DEVELOPMENT_MAINTENANCE.md @@ -248,6 +248,53 @@ If that is not present it will use the global chart serviceAccount automountServ ## chart/templates/tests/* - Add templates for CI helm tests. +## chart/charts/gitlab/charts/toolbox/templates/configmap-custom-scripts.yaml +- Added custom configmap to mount ruby scripts to toolbox + ```yaml + {{- if .Values.enabled -}} + {{- if .Values.customScripts -}} + apiVersion: v1 + kind: ConfigMap + metadata: + name: {{ template "fullname" . }}-custom-scripts + namespace: {{ $.Release.Namespace }} + labels: + {{- include "gitlab.standardLabels" . | nindent 4 }} + {{- include "gitlab.commonLabels" . | nindent 4 }} + data: + {{- range $key, $value := .Values.customScripts }} + {{ $key }}: | + {{ $value }} + {{- end }} + {{- end }} + {{- end }} + ``` + +## chart/charts/gitlab/charts/toolbox/templates/deployment.yaml +- Added volumeMount and volume for custom ruby script configmap + volumeMounts: + + ```yaml + ... + {{- if .Values.customScripts }} + - name: {{ template "fullname" . }}-custom-scripts + mountPath: /scripts/custom + readOnly: true + {{- end }} + ... + ``` + volumes: + ```yaml + ... + {{- if .Values.customScripts }} + - name: {{ template "fullname" . }}-custom-scripts + projected: + sources: + - configMap: + name: {{ template "fullname" . }}-custom-scripts + {{- end }} + ``` + ## chart/charts/gitlab/charts/toolbox/templates/backup-job.yaml - Added istio shutdown to command on lines 85 and 87. ```yaml @@ -326,7 +373,7 @@ If that is not present it will use the global chart serviceAccount automountServ - Add `minio.jobAnnotations`: sidecar.istio.io/inject: "false". - Add `gitlab.toolbox.annotations`: `sidecar.istio.io/proxyMemory: 512Mi` and `sidecar.istio.io/proxyMemoryLimit: 512Mi`. - Change default value for `global.ingress.configureCertmanager` to `false` - +- Add `gitlab.toolbox.customScripts` with example `testing.rb` script for custom ruby scripts in toolbox. # chart/Chart.yaml - Change version key to Big Bang composite version.