From dca8f5b145ee489e4c448710e58e129b494a9ac1 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Sun, 17 Sep 2023 14:13:19 -0400 Subject: [PATCH] migrate(jenkins): Migrate to new common (#12473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Co-authored-by: Xstar97TheNoob <9399967+xstar97@users.noreply.github.com> Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com> --- charts/incubator/jenkins/Chart.yaml | 7 +-- charts/incubator/jenkins/questions.yaml | 26 +++++----- charts/incubator/jenkins/templates/NOTES.txt | 1 + .../incubator/jenkins/templates/_secret.tpl | 12 +---- .../incubator/jenkins/templates/common.yaml | 11 +++-- charts/incubator/jenkins/values.yaml | 48 +++++++++++-------- 6 files changed, 53 insertions(+), 52 deletions(-) create mode 100644 charts/incubator/jenkins/templates/NOTES.txt diff --git a/charts/incubator/jenkins/Chart.yaml b/charts/incubator/jenkins/Chart.yaml index cd0987d913b..5b3be6cd587 100644 --- a/charts/incubator/jenkins/Chart.yaml +++ b/charts/incubator/jenkins/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: "2.392.0" +appVersion: "2.422.0" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 14.0.1 deprecated: false description: The gold standard in devops tools for running CI/CD pipelines. home: https://truecharts.org/charts/incubator/jenkins @@ -19,8 +19,9 @@ maintainers: name: jenkins sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/jenkins + - https://github.com/jenkinsci/docker type: application -version: 3.0.15 +version: 4.0.0 annotations: truecharts.org/catagories: | - productivity diff --git a/charts/incubator/jenkins/questions.yaml b/charts/incubator/jenkins/questions.yaml index 79877ec8f0e..a85c63c135f 100644 --- a/charts/incubator/jenkins/questions.yaml +++ b/charts/incubator/jenkins/questions.yaml @@ -146,19 +146,18 @@ questions: # Include{ingressAdvanced} # Include{ingressList} # Include{securityContextRoot} - - - variable: runAsUser - label: runAsUser - description: The UserID of the user running the application - schema: - type: int - default: 1000 - - variable: runAsGroup - label: runAsGroup - description: The groupID this App of the user running the application - schema: - type: int - default: 1000 + - variable: runAsUser + label: "runAsUser" + description: "The UserID of the user running the application" + schema: + type: int + default: 1000 + - variable: runAsGroup + label: "runAsGroup" + description: "The groupID of the user running the application" + schema: + type: int + default: 1000 # Include{securityContextContainer} # Include{securityContextAdvanced} # Include{securityContextPod} @@ -168,7 +167,6 @@ questions: schema: type: int default: 1000 - # Include{resources} # Include{advanced} # Include{addons} diff --git a/charts/incubator/jenkins/templates/NOTES.txt b/charts/incubator/jenkins/templates/NOTES.txt new file mode 100644 index 00000000000..efcb74cb772 --- /dev/null +++ b/charts/incubator/jenkins/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "tc.v1.common.lib.chart.notes" $ -}} diff --git a/charts/incubator/jenkins/templates/_secret.tpl b/charts/incubator/jenkins/templates/_secret.tpl index d17a637568e..0f8d8c90d26 100644 --- a/charts/incubator/jenkins/templates/_secret.tpl +++ b/charts/incubator/jenkins/templates/_secret.tpl @@ -1,15 +1,7 @@ {{/* Define the secret */}} {{- define "jenkins.secret" -}} - -{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) -}} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ $secretName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: +enabled: true +data: JAVA_OPTS: {{ join " " (include "java.opts" . | fromYaml).opts | quote }} JENKINS_OPTS: {{ join " " (include "jenkins.opts" . | fromYaml).opts | quote }} JENKINS_JAVA_OPTS: {{ join " " (include "jenkins.java.opts" . | fromYaml).opts | quote }} diff --git a/charts/incubator/jenkins/templates/common.yaml b/charts/incubator/jenkins/templates/common.yaml index 430826388cd..60eee416a97 100644 --- a/charts/incubator/jenkins/templates/common.yaml +++ b/charts/incubator/jenkins/templates/common.yaml @@ -1,8 +1,11 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} -{{/* Render secret */}} -{{- include "jenkins.secret" . }} +{{/* Render secrets for jenkins */}} +{{- $secret := include "jenkins.secret" . | fromYaml -}} +{{- if $secret -}} + {{- $_ := set .Values.secret "jenkins-secret" $secret -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/jenkins/values.yaml b/charts/incubator/jenkins/values.yaml index 1801091ad87..7c15082e669 100644 --- a/charts/incubator/jenkins/values.yaml +++ b/charts/incubator/jenkins/values.yaml @@ -1,12 +1,14 @@ image: repository: tccr.io/truecharts/jenkins pullPolicy: IfNotPresent - tag: 2.392.0@sha256:362ac8a36b4a1d603a0bce6e5c35097b33d6aae0544ba1cef8f300d2788dd09b + tag: 2.422.0@sha256:c046d180b498bbeab33fbcd0900ef14bcd4272fc85350f5cbdfa19b5ac45e283 -podSecurityContext: - runAsGroup: 1000 - runAsUser: 1000 - fsGroup: 1000 +security: + container: + runAsGroup: 1000 + runAsUser: 1000 + pod: + fsGroup: 1000 # securityContext: # readOnlyRootFilesystem: false @@ -18,26 +20,29 @@ jenkins: plugins_force_upgrade: false upgrade_if_no_marker: false -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-secret' - -probes: - liveness: - type: HTTP - path: /login - readiness: - type: HTTP - path: /login - startup: - type: HTTP - path: /login +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + type: http + path: /login + readiness: + type: http + path: /login + startup: + type: tcp + envFrom: + - secretRef: + name: 'jenkins-secret' service: main: ports: main: - protocol: HTTP + protocol: http port: 10280 agent: enabled: true @@ -52,4 +57,5 @@ persistence: mountPath: /var/jenkins_home portal: - enabled: true + open: + enabled: true