From 5058fc2a6e5ebe42e29da8c89e96bdfdad285bba Mon Sep 17 00:00:00 2001
From: Alexander Robson <58195221+aj-robson@users.noreply.github.com>
Date: Fri, 5 May 2023 15:05:39 +0100
Subject: [PATCH 01/40] chore: Update git ls-files cmd with missing arg (#832)
---
variables.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/variables.mk b/variables.mk
index 9c987952..b6a6a771 100644
--- a/variables.mk
+++ b/variables.mk
@@ -28,7 +28,7 @@ VERSION := $(shell cat VERSION.txt)
GITCOMMIT := $(shell git rev-parse --short HEAD)
GITBRANCH := $(shell git rev-parse --abbrev-ref HEAD)
GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
-GITIGNOREDBUTTRACKEDCHANGES := $(shell git ls-files -i --exclude-standard)
+GITIGNOREDBUTTRACKEDCHANGES := $(shell git ls-files -i -c --exclude-standard)
ifneq ($(GITUNTRACKEDCHANGES),)
GITCOMMIT := $(GITCOMMIT)-dirty
endif
From 7bccdc21b1ec33210dea04d8bb293abf036224c2 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Tue, 9 May 2023 00:12:54 +0200
Subject: [PATCH 02/40] chore: update to latest lts, update plugins, remove
devbots, add devcontainer (#835)
Update to the latest lts
Update plugins
Remove devbots
Initial devcontainer config
---
.devbots/needs-triage.yml | 4 ---
.devcontainer/devcontainer.json | 43 ++++++++++++++++++++++++++++++
chart/jenkins-operator/README.md | 4 +--
chart/jenkins-operator/values.yaml | 8 +++---
config.base.env | 2 +-
pkg/plugins/base_plugins.go | 6 ++---
test/e2e/configuration_test.go | 6 ++---
test/e2e/jenkins_test.go | 2 +-
test/e2e/test_utility.go | 2 +-
test/helm/helm_test.go | 2 +-
10 files changed, 59 insertions(+), 20 deletions(-)
delete mode 100644 .devbots/needs-triage.yml
create mode 100644 .devcontainer/devcontainer.json
diff --git a/.devbots/needs-triage.yml b/.devbots/needs-triage.yml
deleted file mode 100644
index d71c6782..00000000
--- a/.devbots/needs-triage.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-# Configuration for devbots-needs-triage - https://devbots.xyz/documentation/needs-triage/
-
-enabled: true
-label: "needs triage"
\ No newline at end of file
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..c726b0b5
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,43 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the
+// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube
+{
+ "name": "Kubernetes - Minikube-in-Docker",
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
+ "image": "mcr.microsoft.com/devcontainers/base:bullseye",
+
+ "features": {
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {
+ "enableNonRootDocker": "true",
+ "moby": "true"
+ },
+ "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
+ "version": "latest",
+ "helm": "latest",
+ "minikube": "latest"
+ },
+ "ghcr.io/devcontainers/features/go:1": {
+ "version": "1.15",
+ "golangciLintVersion": "1.26.0"
+ },
+ "ghcr.io/mpriscella/features/kind:1": {
+ "version": "latest"
+ },
+ "ghcr.io/edouard-lopez/devcontainer-features/bats:0": {
+ "version": "latest"
+ }
+ }
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
+ // "forwardPorts": [],
+
+ // Use 'postCreateCommand' to run commands after the container is created.
+ // "postCreateCommand": "kubectl version",
+
+ // Use 'postStartCommand' to run commands after the container is created like starting minikube.
+ // "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1",
+
+ // Configure tool-specific properties.
+ // "customizations": {},
+
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
+ // "remoteUser": "root"
+}
diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md
index b1878296..c692235d 100644
--- a/chart/jenkins-operator/README.md
+++ b/chart/jenkins-operator/README.md
@@ -1,6 +1,6 @@
# jenkins-operator
- 
+ 
Kubernetes native operator which fully manages Jenkins on Kubernetes
@@ -52,7 +52,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.enabled | bool | `true` | |
| jenkins.env | list | `[]` | |
| jenkins.hostAliases | object | `{}` | |
-| jenkins.image | string | `"jenkins/jenkins:2.387.2-lts"` | |
+| jenkins.image | string | `"jenkins/jenkins:2.387.3-lts"` | |
| jenkins.imagePullPolicy | string | `"Always"` | |
| jenkins.imagePullSecrets | list | `[]` | |
| jenkins.labels | object | `{}` | |
diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml
index 1ee2335a..bf6a6f6e 100644
--- a/chart/jenkins-operator/values.yaml
+++ b/chart/jenkins-operator/values.yaml
@@ -33,7 +33,7 @@ jenkins:
# image is the name (and tag) of the Jenkins instance
# Default: jenkins/jenkins:lts
# It's recommended to use LTS (tag: "lts") version
- image: jenkins/jenkins:2.387.2-lts
+ image: jenkins/jenkins:2.387.3-lts
# env contains jenkins container environment variables
env: []
@@ -87,13 +87,13 @@ jenkins:
#
# basePlugins:
# - name: kubernetes
- # version: 3909.v1f2c633e8590
+ # version: 3923.v294a_d4250b_91
# - name: workflow-job
- # version: 1289.vd1c337fd5354
+ # version: 1292.v27d8cc3e2602
# - name: workflow-aggregator
# version: 596.v8c21c963d92d
# - name: git
- # version: 5.0.0
+ # version: 5.0.1
# - name: job-dsl
# version: "1.83"
# - name: configuration-as-code
diff --git a/config.base.env b/config.base.env
index 78c45675..2a74da58 100644
--- a/config.base.env
+++ b/config.base.env
@@ -13,5 +13,5 @@ GEN_CRD_API=gen-crd-api-reference-docs
IMAGE_PULL_MODE=local
HELM_VERSION=3.1.2
CLUSTER_DOMAIN=cluster.local
-LATEST_LTS_VERSION=2.387.2
+LATEST_LTS_VERSION=2.387.3
KIND_CLUSTER_NAME=jenkins
diff --git a/pkg/plugins/base_plugins.go b/pkg/plugins/base_plugins.go
index 40f9948a..a8f23d30 100644
--- a/pkg/plugins/base_plugins.go
+++ b/pkg/plugins/base_plugins.go
@@ -2,12 +2,12 @@ package plugins
const (
configurationAsCodePlugin = "configuration-as-code:1625.v27444588cc3d"
- gitPlugin = "git:5.0.0"
+ gitPlugin = "git:5.0.1"
jobDslPlugin = "job-dsl:1.83"
- kubernetesPlugin = "kubernetes:3909.v1f2c633e8590"
+ kubernetesPlugin = "kubernetes:3923.v294a_d4250b_91"
kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c"
workflowAggregatorPlugin = "workflow-aggregator:596.v8c21c963d92d"
- workflowJobPlugin = "workflow-job:1289.vd1c337fd5354"
+ workflowJobPlugin = "workflow-job:1292.v27d8cc3e2602"
)
// basePluginsList contains plugins to install by operator.
diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go
index 33d27e3d..65c742cd 100644
--- a/test/e2e/configuration_test.go
+++ b/test/e2e/configuration_test.go
@@ -25,12 +25,12 @@ const e2e = "e2e"
var expectedBasePluginsList = []plugins.Plugin{
plugins.Must(plugins.New("configuration-as-code:1625.v27444588cc3d")),
- plugins.Must(plugins.New("git:5.0.0")),
- plugins.Must(plugins.New("kubernetes:3909.v1f2c633e8590")),
+ plugins.Must(plugins.New("git:5.0.1")),
+ plugins.Must(plugins.New("kubernetes:3923.v294a_d4250b_91")),
plugins.Must(plugins.New("kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c")),
plugins.Must(plugins.New("job-dsl:1.83")),
plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")),
- plugins.Must(plugins.New("workflow-job:1289.vd1c337fd5354")),
+ plugins.Must(plugins.New("workflow-job:1292.v27d8cc3e2602")),
}
func createUserConfigurationSecret(namespace string, stringData map[string]string) {
diff --git a/test/e2e/jenkins_test.go b/test/e2e/jenkins_test.go
index 003bd9fb..4c3a45d9 100644
--- a/test/e2e/jenkins_test.go
+++ b/test/e2e/jenkins_test.go
@@ -244,7 +244,7 @@ func restartJenkinsMasterPod(jenkins *v1alpha2.Jenkins) {
Eventually(func() (bool, error) {
jenkinsPod = getJenkinsMasterPod(jenkins)
return jenkinsPod.DeletionTimestamp != nil, nil
- }, 30*retryInterval, retryInterval).Should(BeTrue())
+ }, 45*retryInterval, retryInterval).Should(BeTrue())
_, _ = fmt.Fprintf(GinkgoWriter, "Jenkins master pod has been restarted\n")
}
diff --git a/test/e2e/test_utility.go b/test/e2e/test_utility.go
index 2db6fae8..81c80b9c 100644
--- a/test/e2e/test_utility.go
+++ b/test/e2e/test_utility.go
@@ -21,7 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
)
-const JenkinsTestImage = "jenkins/jenkins:2.387.2-lts"
+const JenkinsTestImage = "jenkins/jenkins:2.387.3-lts"
var (
Cfg *rest.Config
diff --git a/test/helm/helm_test.go b/test/helm/helm_test.go
index 185d98b9..6430b8ba 100644
--- a/test/helm/helm_test.go
+++ b/test/helm/helm_test.go
@@ -47,7 +47,7 @@ var _ = Describe("Jenkins Controller", func() {
cmd := exec.Command("../../bin/helm", "upgrade", "jenkins", "../../chart/jenkins-operator", "--namespace", namespace.Name, "--debug",
"--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name),
- "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.387.2-lts"),
+ "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.387.3-lts"),
"--set-string", fmt.Sprintf("operator.image=%s", *imageName), "--install")
output, err := cmd.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), string(output))
From 44a7d2460a97a74ae1dd21e286a342bec805c794 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Tue, 9 May 2023 00:26:02 +0200
Subject: [PATCH 03/40] feat(repo): add stale bot (#836)
---
.github/workflows/auto-stale-issue.yaml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 .github/workflows/auto-stale-issue.yaml
diff --git a/.github/workflows/auto-stale-issue.yaml b/.github/workflows/auto-stale-issue.yaml
new file mode 100644
index 00000000..fbed5626
--- /dev/null
+++ b/.github/workflows/auto-stale-issue.yaml
@@ -0,0 +1,22 @@
+name: "Stale issue automation"
+on:
+ workflow_dispatch:
+ schedule:
+ - cron: "0 9 * * *"
+
+permissions:
+ issues: write
+ pull-requests: write
+
+jobs:
+ stale:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/stale@v8
+ with:
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
+ operations-per-run: 200
+ days-before-issue-stale: 60
+ days-before-issue-close: 10
+ exempt-pr-labels: "not-stale"
+ exempt-issue-labels: "not-stale"
From 3275be357a4972df55aac27ddfa1faf17f2d96a4 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Fri, 26 May 2023 16:10:24 +0200
Subject: [PATCH 04/40] feat: use zstd instead of gz by default, fix the backup
script (#841)
---
backup/pvc/Dockerfile | 5 +++-
backup/pvc/bin/backup.sh | 20 +++++++++----
backup/pvc/bin/get-latest.sh | 2 +-
backup/pvc/bin/restore.sh | 16 +++++++++-
backup/pvc/bin/run.sh | 2 +-
backup/pvc/e2e/backup_and_restore/test.sh | 4 +--
backup/pvc/e2e/get-latest/test.sh | 24 +++++++--------
backup/pvc/e2e/limit_backup_count/test.sh | 30 +++++++++----------
.../test.sh | 4 +--
9 files changed, 67 insertions(+), 40 deletions(-)
diff --git a/backup/pvc/Dockerfile b/backup/pvc/Dockerfile
index 834c8c92..3b283e16 100644
--- a/backup/pvc/Dockerfile
+++ b/backup/pvc/Dockerfile
@@ -13,7 +13,10 @@ ARG GID
ENV USER=user
-RUN addgroup --gid "$GID" "$USER" && \
+RUN apt update \
+ && apt install -y procps zstd \
+ && rm -rf /var/lib/apt/lists/* \
+ && addgroup --gid "$GID" "$USER" && \
adduser \
--disabled-password \
--gecos "" \
diff --git a/backup/pvc/bin/backup.sh b/backup/pvc/bin/backup.sh
index 74f32f88..fad869da 100644
--- a/backup/pvc/bin/backup.sh
+++ b/backup/pvc/bin/backup.sh
@@ -6,7 +6,7 @@ set -eo pipefail
[[ -z "${BACKUP_DIR}" ]] && echo "Required 'BACKUP_DIR' env not set" && exit 1;
[[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
BACKUP_TMP_DIR=$(mktemp -d)
-trap "test -d "${BACKUP_TMP_DIR}" && rm -fr "${BACKUP_TMP_DIR}"" EXIT ERR SIGINT SIGTERM
+trap "test -d "${BACKUP_TMP_DIR}" && rm -fr "${BACKUP_TMP_DIR}"" EXIT SIGINT SIGTERM
backup_number=$1
echo "Running backup"
@@ -15,12 +15,22 @@ echo "Running backup"
# config.xml in child directories is state that should. For example-
# branches/myorg/branches/myrepo/branches/master/config.xml should be retained while
# branches/myorg/config.xml should not
-tar -C "${JENKINS_HOME}" -czf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" --exclude jobs/*/workspace* --no-wildcards-match-slash --anchored --exclude jobs/*/config.xml -c jobs && \
-mv "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" "${BACKUP_DIR}/${backup_number}.tar.gz"
+tar --zstd -C "${JENKINS_HOME}" -cf "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" \
+ --exclude jobs/*/workspace* \
+ --no-wildcards-match-slash --anchored \
+ --ignore-failed-read \
+ --exclude jobs/*/config.xml -c jobs || ret=$?
+
+if [[ "$ret" -eq 0 ]]; then
+ echo "Backup was completed without warnings"
+ mv "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" "${BACKUP_DIR}/${backup_number}.tar.zstd"
+elif [[ "$ret" -eq 1 ]]; then
+ echo "Backup was completed with some warnings"
+ mv "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" "${BACKUP_DIR}/${backup_number}.tar.zstd"
+fi
rm -rf "${BACKUP_TMP_DIR}"
-
-[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.gz ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.gz' is empty" && exit 1;
+[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.zstd ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.zstd' is empty" && exit 1;
echo Done
exit 0
diff --git a/backup/pvc/bin/get-latest.sh b/backup/pvc/bin/get-latest.sh
index 2f418a5f..5deba063 100644
--- a/backup/pvc/bin/get-latest.sh
+++ b/backup/pvc/bin/get-latest.sh
@@ -4,7 +4,7 @@ set -eo pipefail
[[ -z "${BACKUP_DIR}" ]] && echo "Required 'BACKUP_DIR' env not set" && exit 1
-latest=$(find ${BACKUP_DIR} -name '*.tar.gz' -exec basename {} \; | sort -g | tail -n 1)
+latest=$(find ${BACKUP_DIR} -name '*.tar.zstd' -exec basename {} \; | sort -g | tail -n 1)
if [[ "${latest}" == "" ]]; then
echo "-1"
diff --git a/backup/pvc/bin/restore.sh b/backup/pvc/bin/restore.sh
index 5b6f504b..994208d3 100644
--- a/backup/pvc/bin/restore.sh
+++ b/backup/pvc/bin/restore.sh
@@ -7,9 +7,23 @@ set -eo pipefail
[[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
backup_number=$1
+backup_file="${BACKUP_DIR}/${backup_number}"
echo "Running restore backup with backup number #${backup_number}"
-tar -C ${JENKINS_HOME} -zxf "${BACKUP_DIR}/${backup_number}.tar.gz"
+if [[ -f "$backup_file.tar.gz" ]]; then
+ echo "Old format tar.gz found, restoring it"
+ OPTS=""
+ EXT="tar.gz"
+elif [[ -f "$backup_file.tar.zstd" ]]; then
+ echo "Backup file found, proceeding"
+ OPTS="--zstd"
+ EXT="tar.zstd"
+else
+ echo "ERR: Backup file not found: $backup_file"
+ exit 1
+fi
+
+tar $OPTS -C "${JENKINS_HOME}" -xf "${BACKUP_DIR}/${backup_number}.${EXT}"
echo Done
exit 0
diff --git a/backup/pvc/bin/run.sh b/backup/pvc/bin/run.sh
index d764c696..56c2d687 100644
--- a/backup/pvc/bin/run.sh
+++ b/backup/pvc/bin/run.sh
@@ -11,6 +11,6 @@ do
if [[ ! -z "${BACKUP_COUNT}" ]]; then
echo "Trimming to only ${BACKUP_COUNT} recent backups in preparation for new backup"
#TODO: add the list of exceeding backup before delete
- find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.gz' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}'
+ find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.*' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}'
fi
done
diff --git a/backup/pvc/e2e/backup_and_restore/test.sh b/backup/pvc/e2e/backup_and_restore/test.sh
index df5d1519..e69901c5 100755
--- a/backup/pvc/e2e/backup_and_restore/test.sh
+++ b/backup/pvc/e2e/backup_and_restore/test.sh
@@ -30,7 +30,7 @@ trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${RESTORE_FOLDE
backup_number=1
docker exec ${cid} /home/user/bin/backup.sh ${backup_number}
-backup_file="${BACKUP_DIR}/${backup_number}.tar.gz"
+backup_file="${BACKUP_DIR}/${backup_number}.tar.zstd"
[[ ! -f ${backup_file} ]] && echo "Backup file ${backup_file} not found" && exit 1;
docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/restore.sh ${backup_number}"
@@ -38,4 +38,4 @@ docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/r
echo "Compare directories"
diff --brief --recursive "${RESTORE_FOLDER}" "${JENKINS_HOME_AFTER_RESTORE}"
echo "Directories are the same"
-echo PASS
\ No newline at end of file
+echo PASS
diff --git a/backup/pvc/e2e/get-latest/test.sh b/backup/pvc/e2e/get-latest/test.sh
index b9b228d4..a0aabe9a 100755
--- a/backup/pvc/e2e/get-latest/test.sh
+++ b/backup/pvc/e2e/get-latest/test.sh
@@ -19,17 +19,17 @@ mkdir -p ${BACKUP_DIR}
mkdir -p ${JENKINS_HOME}
mkdir -p ${BACKUP_DIR}/lost+found
-touch ${BACKUP_DIR}/1.tar.gz
-touch ${BACKUP_DIR}/2.tar.gz
-touch ${BACKUP_DIR}/3.tar.gz
-touch ${BACKUP_DIR}/4.tar.gz
-touch ${BACKUP_DIR}/5.tar.gz
-touch ${BACKUP_DIR}/6.tar.gz
-touch ${BACKUP_DIR}/7.tar.gz
-touch ${BACKUP_DIR}/8.tar.gz
-touch ${BACKUP_DIR}/9.tar.gz
-touch ${BACKUP_DIR}/10.tar.gz
-touch ${BACKUP_DIR}/11.tar.gz
+touch ${BACKUP_DIR}/1.tar.zstd
+touch ${BACKUP_DIR}/2.tar.zstd
+touch ${BACKUP_DIR}/3.tar.zstd
+touch ${BACKUP_DIR}/4.tar.zstd
+touch ${BACKUP_DIR}/5.tar.zstd
+touch ${BACKUP_DIR}/6.tar.zstd
+touch ${BACKUP_DIR}/7.tar.zstd
+touch ${BACKUP_DIR}/8.tar.zstd
+touch ${BACKUP_DIR}/9.tar.zstd
+touch ${BACKUP_DIR}/10.tar.zstd
+touch ${BACKUP_DIR}/11.tar.zstd
# Create an instance of the container under testing
cid="$(docker run -e JENKINS_HOME=${JENKINS_HOME} -v ${JENKINS_HOME}:${JENKINS_HOME}:ro -e BACKUP_DIR=${BACKUP_DIR} -v ${BACKUP_DIR}:${BACKUP_DIR}:rw -d ${docker_image})"
@@ -39,7 +39,7 @@ echo "Docker container ID '${cid}'"
trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${JENKINS_HOME}" EXIT
latest=$(docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/get-latest.sh")
-rm ${BACKUP_DIR}/*.tar.gz
+rm ${BACKUP_DIR}/*.tar.zstd
empty_latest=$(docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/get-latest.sh")
if [[ "${DEBUG}" ]]; then
diff --git a/backup/pvc/e2e/limit_backup_count/test.sh b/backup/pvc/e2e/limit_backup_count/test.sh
index 7c4c66ee..469b3e44 100755
--- a/backup/pvc/e2e/limit_backup_count/test.sh
+++ b/backup/pvc/e2e/limit_backup_count/test.sh
@@ -19,17 +19,17 @@ mkdir -p ${BACKUP_DIR}
mkdir -p ${JENKINS_HOME}
mkdir -p ${BACKUP_DIR}/lost+found
-touch ${BACKUP_DIR}/1.tar.gz
-touch ${BACKUP_DIR}/2.tar.gz
-touch ${BACKUP_DIR}/3.tar.gz
-touch ${BACKUP_DIR}/4.tar.gz
-touch ${BACKUP_DIR}/5.tar.gz
-touch ${BACKUP_DIR}/6.tar.gz
-touch ${BACKUP_DIR}/7.tar.gz
-touch ${BACKUP_DIR}/8.tar.gz
-touch ${BACKUP_DIR}/9.tar.gz
-touch ${BACKUP_DIR}/10.tar.gz
-touch ${BACKUP_DIR}/11.tar.gz
+touch ${BACKUP_DIR}/1.tar.zstd
+touch ${BACKUP_DIR}/2.tar.zstd
+touch ${BACKUP_DIR}/3.tar.zstd
+touch ${BACKUP_DIR}/4.tar.zstd
+touch ${BACKUP_DIR}/5.tar.zstd
+touch ${BACKUP_DIR}/6.tar.zstd
+touch ${BACKUP_DIR}/7.tar.zstd
+touch ${BACKUP_DIR}/8.tar.zstd
+touch ${BACKUP_DIR}/9.tar.zstd
+touch ${BACKUP_DIR}/10.tar.zstd
+touch ${BACKUP_DIR}/11.tar.zstd
# Create an instance of the container under testing
cid="$(docker run -e BACKUP_COUNT=2 -e JENKINS_HOME=${JENKINS_HOME} -v ${JENKINS_HOME}:${JENKINS_HOME}:ro -e BACKUP_DIR=${BACKUP_DIR} -v ${BACKUP_DIR}:${BACKUP_DIR}:rw -d ${docker_image})"
@@ -39,7 +39,7 @@ echo "Docker container ID '${cid}'"
trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${JENKINS_HOME}" EXIT
sleep 11
-touch ${BACKUP_DIR}/12.tar.gz
+touch ${BACKUP_DIR}/12.tar.zstd
sleep 11
if [[ "${DEBUG}" ]]; then
@@ -48,7 +48,7 @@ if [[ "${DEBUG}" ]]; then
fi
# only two latest backup should exists
-[[ $(ls -1 ${BACKUP_DIR} | grep 'tar.gz' | wc -l) -eq 2 ]] || exit 1
-[[ -f ${BACKUP_DIR}/11.tar.gz ]] || exit 2
-[[ -f ${BACKUP_DIR}/12.tar.gz ]] || exit 3
+[[ $(ls -1 ${BACKUP_DIR} | grep 'tar.zstd' | wc -l) -eq 2 ]] || exit 1
+[[ -f ${BACKUP_DIR}/11.tar.zstd ]] || exit 2
+[[ -f ${BACKUP_DIR}/12.tar.zstd ]] || exit 3
echo PASS
diff --git a/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh b/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh
index 7b963357..662809c8 100755
--- a/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh
+++ b/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh
@@ -29,8 +29,8 @@ docker exec ${cid} /home/user/bin/backup.sh ${backup_number}
[ "$(docker exec ${cid} ls /tmp | grep 'tmp')" ] && echo "tmp directory not empty" && exit 1;
-backup_file="${BACKUP_DIR}/${backup_number}.tar.gz"
+backup_file="${BACKUP_DIR}/${backup_number}.tar.zstd"
[[ ! -f ${backup_file} ]] && echo "Backup file ${backup_file} not found" && exit 1;
echo "tmp directory empty, backup in backup directory present"
-echo PASS
\ No newline at end of file
+echo PASS
From 00bb04745b8e895df2af84f91f5381c339d7a820 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Tue, 30 May 2023 09:36:55 +0200
Subject: [PATCH 05/40] Fix: add tollerations again (#842)
Signed-off-by: tombokombo
Co-authored-by: Tomas Hulata
---
chart/jenkins-operator/README.md | 1 +
chart/jenkins-operator/templates/jenkins.yaml | 3 +++
chart/jenkins-operator/values.yaml | 9 ++++++---
pkg/plugins/base_plugins.go | 6 +++---
test/e2e/configuration_test.go | 6 +++---
5 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md
index c692235d..857b8b52 100644
--- a/chart/jenkins-operator/README.md
+++ b/chart/jenkins-operator/README.md
@@ -88,6 +88,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.seedJobAgentImage | string | `""` | |
| jenkins.seedJobs | list | `[]` | |
| jenkins.serviceAccount.annotations | object | `{}` | |
+| jenkins.tolerations | list | `[]` | |
| jenkins.validateSecurityWarnings | bool | `false` | |
| jenkins.volumeMounts | list | `[]` | |
| jenkins.volumes[0].name | string | `"backup"` | |
diff --git a/chart/jenkins-operator/templates/jenkins.yaml b/chart/jenkins-operator/templates/jenkins.yaml
index 1ce3b0cc..c4d39b76 100644
--- a/chart/jenkins-operator/templates/jenkins.yaml
+++ b/chart/jenkins-operator/templates/jenkins.yaml
@@ -95,6 +95,9 @@ spec:
{{- with .Values.jenkins.nodeSelector }}
nodeSelector: {{ toYaml . | nindent 6 }}
{{- end }}
+ {{- with .Values.jenkins.tolerations }}
+ tolerations: {{ toYaml . | nindent 6 }}
+ {{- end }}
{{- with .Values.jenkins.annotations }}
annotations: {{ toYaml . | nindent 6 }}
{{- end }}
diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml
index bf6a6f6e..7df657a0 100644
--- a/chart/jenkins-operator/values.yaml
+++ b/chart/jenkins-operator/values.yaml
@@ -27,6 +27,9 @@ jenkins:
# nodeSelector are injected into metadata nodeSelector field
nodeSelector: {}
+ # tolerations are injected into metadata tolerations field
+ tolerations: []
+
# annotations are injected into metadata annotations field
annotations: {}
@@ -87,13 +90,13 @@ jenkins:
#
# basePlugins:
# - name: kubernetes
- # version: 3923.v294a_d4250b_91
+ # version: 3937.vd7b_82db_e347b_
# - name: workflow-job
- # version: 1292.v27d8cc3e2602
+ # version: 1301.v054d9cea_9593
# - name: workflow-aggregator
# version: 596.v8c21c963d92d
# - name: git
- # version: 5.0.1
+ # version: 5.0.2
# - name: job-dsl
# version: "1.83"
# - name: configuration-as-code
diff --git a/pkg/plugins/base_plugins.go b/pkg/plugins/base_plugins.go
index a8f23d30..39ca3264 100644
--- a/pkg/plugins/base_plugins.go
+++ b/pkg/plugins/base_plugins.go
@@ -2,12 +2,12 @@ package plugins
const (
configurationAsCodePlugin = "configuration-as-code:1625.v27444588cc3d"
- gitPlugin = "git:5.0.1"
+ gitPlugin = "git:5.0.2"
jobDslPlugin = "job-dsl:1.83"
- kubernetesPlugin = "kubernetes:3923.v294a_d4250b_91"
+ kubernetesPlugin = "kubernetes:3937.vd7b_82db_e347b_"
kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c"
workflowAggregatorPlugin = "workflow-aggregator:596.v8c21c963d92d"
- workflowJobPlugin = "workflow-job:1292.v27d8cc3e2602"
+ workflowJobPlugin = "workflow-job:1301.v054d9cea_9593"
)
// basePluginsList contains plugins to install by operator.
diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go
index 65c742cd..ff8c8662 100644
--- a/test/e2e/configuration_test.go
+++ b/test/e2e/configuration_test.go
@@ -25,12 +25,12 @@ const e2e = "e2e"
var expectedBasePluginsList = []plugins.Plugin{
plugins.Must(plugins.New("configuration-as-code:1625.v27444588cc3d")),
- plugins.Must(plugins.New("git:5.0.1")),
- plugins.Must(plugins.New("kubernetes:3923.v294a_d4250b_91")),
+ plugins.Must(plugins.New("git:5.0.2")),
+ plugins.Must(plugins.New("kubernetes:3937.vd7b_82db_e347b_")),
plugins.Must(plugins.New("kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c")),
plugins.Must(plugins.New("job-dsl:1.83")),
plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")),
- plugins.Must(plugins.New("workflow-job:1292.v27d8cc3e2602")),
+ plugins.Must(plugins.New("workflow-job:1301.v054d9cea_9593")),
}
func createUserConfigurationSecret(namespace string, stringData map[string]string) {
From d9ea2ee83b9a0d56551e9340b97db9e280c8bee2 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Sun, 4 Jun 2023 13:35:14 +0200
Subject: [PATCH 06/40] feat: attempt to move restore before seed job creation
(#844)
---
pkg/configuration/user/reconcile.go | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pkg/configuration/user/reconcile.go b/pkg/configuration/user/reconcile.go
index d5671e2a..303a54cf 100644
--- a/pkg/configuration/user/reconcile.go
+++ b/pkg/configuration/user/reconcile.go
@@ -56,6 +56,10 @@ func (r *reconcileUserConfiguration) ReconcileCasc() (reconcile.Result, error) {
func (r *reconcileUserConfiguration) ReconcileOthers() (reconcile.Result, error) {
backupAndRestore := backuprestore.New(r.Configuration, r.logger)
+ if err := backupAndRestore.Restore(r.jenkinsClient); err != nil {
+ return reconcile.Result{}, err
+ }
+
result, err := r.ensureSeedJobs()
if err != nil {
return reconcile.Result{}, err
@@ -64,10 +68,6 @@ func (r *reconcileUserConfiguration) ReconcileOthers() (reconcile.Result, error)
return result, nil
}
- if err := backupAndRestore.Restore(r.jenkinsClient); err != nil {
- return reconcile.Result{}, err
- }
-
if err := backupAndRestore.Backup(false); err != nil {
return reconcile.Result{}, err
}
From 4e5f9d562f287f7b3a2b24bb580412597c98cad8 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Mon, 5 Jun 2023 22:54:54 +0200
Subject: [PATCH 07/40] chore: add v0.8.0 doc (#845)
---
.../content/en/docs/Getting Started/_index.md | 2 +-
.../en/docs/Getting Started/latest/_index.md | 10 +-
.../latest/configuring-backup-and-restore.md | 8 +-
.../latest/deploying-jenkins.md | 4 +-
.../latest/installing-the-operator.md | 2 +-
.../docs/Getting Started/latest/openshift.md | 4 +-
.../latest/separate-namespaces.md | 4 +-
.../en/docs/Getting Started/v0.7.x/_index.md | 19 +
.../en/docs/Getting Started/v0.7.x/aks.md | 24 +
.../v0.7.x/configuring-backup-and-restore.md | 111 +
.../configuring-seed-jobs-and-pipelines.md | 336 +++
.../v0.7.x/custom-backup-and-restore.md | 184 ++
.../v0.7.x/customizing-jenkins.md | 203 ++
.../v0.7.x/deploying-jenkins.md | 114 +
.../v0.7.x/installing-the-operator.md | 988 ++++++
.../en/docs/Getting Started/v0.7.x/ldap.md | 127 +
.../docs/Getting Started/v0.7.x/openshift.md | 10 +
.../en/docs/Getting Started/v0.7.x/schema.md | 2679 +++++++++++++++++
.../v0.7.x/separate-namespaces.md | 583 ++++
19 files changed, 5396 insertions(+), 16 deletions(-)
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/_index.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/aks.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/configuring-backup-and-restore.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/configuring-seed-jobs-and-pipelines.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/custom-backup-and-restore.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/customizing-jenkins.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/deploying-jenkins.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/installing-the-operator.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/ldap.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/openshift.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/schema.md
create mode 100644 website/content/en/docs/Getting Started/v0.7.x/separate-namespaces.md
diff --git a/website/content/en/docs/Getting Started/_index.md b/website/content/en/docs/Getting Started/_index.md
index 7ef77c3a..b6e5a290 100644
--- a/website/content/en/docs/Getting Started/_index.md
+++ b/website/content/en/docs/Getting Started/_index.md
@@ -2,7 +2,7 @@
title: "Getting Started"
linkTitle: "Getting Started"
weight: 2
-date: 2021-08-19
+date: 2023-06-04
description: >
How to work with Jenkins Operator
---
diff --git a/website/content/en/docs/Getting Started/latest/_index.md b/website/content/en/docs/Getting Started/latest/_index.md
index 736eb379..156dcaee 100644
--- a/website/content/en/docs/Getting Started/latest/_index.md
+++ b/website/content/en/docs/Getting Started/latest/_index.md
@@ -1,19 +1,19 @@
---
-title: "Latest (v0.7.x)"
-linkTitle: "Latest (v0.7.x)"
+title: "Latest (v0.8.x)"
+linkTitle: "Latest (v0.8.x)"
weight: 1
-date: 2021-12-08
+date: 2023-31-05
description: >
How to work with the latest, currently supported Jenkins Operator version.
---
{{% pageinfo %}}
-This document describes a getting started guide for **Jenkins Operator** `v0.7.x` and also additional configuration.
+This document describes a getting started guide for **Jenkins Operator** `v0.8.x` and also additional configuration.
{{% /pageinfo %}}
## First Steps
Prepare your Kubernetes cluster and set up your `kubectl` access.
-Once you have a running Kubernetes cluster you can focus on installing **Jenkins Operator** according to the
+Once you have a running Kubernetes cluster you can focus on installing **Jenkins Operator** according to the
[Installation](/kubernetes-operator/docs/getting-started/latest/installing-the-operator/) guide.
diff --git a/website/content/en/docs/Getting Started/latest/configuring-backup-and-restore.md b/website/content/en/docs/Getting Started/latest/configuring-backup-and-restore.md
index 188cb83c..4809ed17 100644
--- a/website/content/en/docs/Getting Started/latest/configuring-backup-and-restore.md
+++ b/website/content/en/docs/Getting Started/latest/configuring-backup-and-restore.md
@@ -7,8 +7,8 @@ description: >
Prevent loss of job history
---
-> Because of Jenkins Operator's architecture, the configuration of Jenkins should be done using ConfigurationAsCode
-> or GroovyScripts and jobs should be defined as SeedJobs. It means that there is no point in backing up any job configuration
+> Because of Jenkins Operator's architecture, the configuration of Jenkins should be done using ConfigurationAsCode
+> or GroovyScripts and jobs should be defined as SeedJobs. It means that there is no point in backing up any job configuration
> up. Therefore, the backup script makes a copy of jobs history only.
Backup and restore is done by a container sidecar.
@@ -54,7 +54,7 @@ spec:
disableCSRFProtection: false
containers:
- name: jenkins-master
- image: jenkins/jenkins:2.277.4-lts-alpine
+ image: jenkins/jenkins:2.401.1-lts
imagePullPolicy: IfNotPresent
resources:
limits:
@@ -71,7 +71,7 @@ spec:
value: /jenkins-home
- name: BACKUP_COUNT
value: "3" # keep only the 2 most recent backups
- image: virtuslab/jenkins-operator-backup-pvc:v0.1.1 # look at backup/pvc directory
+ image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.3 # look at backup/pvc directory
imagePullPolicy: IfNotPresent
volumeMounts:
- mountPath: /jenkins-home # Jenkins home volume
diff --git a/website/content/en/docs/Getting Started/latest/deploying-jenkins.md b/website/content/en/docs/Getting Started/latest/deploying-jenkins.md
index d00f68c0..0f732824 100644
--- a/website/content/en/docs/Getting Started/latest/deploying-jenkins.md
+++ b/website/content/en/docs/Getting Started/latest/deploying-jenkins.md
@@ -14,7 +14,7 @@ This document describes the procedure for deploying Jenkins.
## Prerequisites
The Operator needs to have been deployed beforehand. The procedure for deploying Jenkins described here doesn't apply to
-installation of Operator via Helm chart unless `jenkins.enabled` was set to false.
+installation of Operator via Helm chart unless `jenkins.enabled` was set to false.
That’s because by default, installation via Helm chart also covers deploying Jenkins.
@@ -43,7 +43,7 @@ spec:
disableCSRFProtection: false
containers:
- name: jenkins-master
- image: jenkins/jenkins:2.319.1-lts-alpine
+ image: jenkins/jenkins:2.401.1-lts
imagePullPolicy: Always
livenessProbe:
failureThreshold: 12
diff --git a/website/content/en/docs/Getting Started/latest/installing-the-operator.md b/website/content/en/docs/Getting Started/latest/installing-the-operator.md
index 81cc0170..9289c6e6 100644
--- a/website/content/en/docs/Getting Started/latest/installing-the-operator.md
+++ b/website/content/en/docs/Getting Started/latest/installing-the-operator.md
@@ -941,7 +941,7 @@ spec:
args:
- --leader-elect
- --validate-security-warnings
- image: virtuslab/jenkins-operator:v0.7.0
+ image: quay.io/jenkins-kubernetes-operator/operator:v0.8.0
name: jenkins-operator
imagePullPolicy: IfNotPresent
securityContext:
diff --git a/website/content/en/docs/Getting Started/latest/openshift.md b/website/content/en/docs/Getting Started/latest/openshift.md
index 610ce015..7048affd 100644
--- a/website/content/en/docs/Getting Started/latest/openshift.md
+++ b/website/content/en/docs/Getting Started/latest/openshift.md
@@ -7,4 +7,6 @@ description: >
Additional configuration for OpenShift
---
-## Release 0.7.0 is not compatible with OpenShift.
\ No newline at end of file
+## Release 0.8.0 is not compatible with jenkins image shipped by redhat in OpenShift.
+
+But probably it will run correctly with the jenkins lts version. If you find any issue please report it here: https://github.com/jenkinsci/kubernetes-operator/issues/826.
diff --git a/website/content/en/docs/Getting Started/latest/separate-namespaces.md b/website/content/en/docs/Getting Started/latest/separate-namespaces.md
index 472df44d..9e2d0fed 100644
--- a/website/content/en/docs/Getting Started/latest/separate-namespaces.md
+++ b/website/content/en/docs/Getting Started/latest/separate-namespaces.md
@@ -281,7 +281,7 @@ spec:
- /manager
args:
- --leader-elect
- image: virtuslab/jenkins-operator:v0.7.0
+ image: image: quay.io/jenkins-kubernetes-operator/operator:v0.8.0
name: jenkins-operator
imagePullPolicy: IfNotPresent
securityContext:
@@ -536,7 +536,7 @@ spec:
disableCSRFProtection: false
containers:
- name: jenkins-master
- image: jenkins/jenkins:2.319.1-lts-alpine
+ image: jenkins/jenkins:2.401.1-lts
imagePullPolicy: Always
livenessProbe:
failureThreshold: 12
diff --git a/website/content/en/docs/Getting Started/v0.7.x/_index.md b/website/content/en/docs/Getting Started/v0.7.x/_index.md
new file mode 100644
index 00000000..266b4f21
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/_index.md
@@ -0,0 +1,19 @@
+---
+title: "Latest (v0.8.x)"
+linkTitle: "Latest (v0.8.x)"
+weight: 1
+date: 2021-12-08
+description: >
+ How to work with the latest, currently supported Jenkins Operator version.
+---
+
+{{% pageinfo %}}
+This document describes a getting started guide for **Jenkins Operator** `v0.8.x` and also additional configuration.
+{{% /pageinfo %}}
+
+## First Steps
+
+Prepare your Kubernetes cluster and set up your `kubectl` access.
+
+Once you have a running Kubernetes cluster you can focus on installing **Jenkins Operator** according to the
+[Installation](/kubernetes-operator/docs/getting-started/latest/installing-the-operator/) guide.
diff --git a/website/content/en/docs/Getting Started/v0.7.x/aks.md b/website/content/en/docs/Getting Started/v0.7.x/aks.md
new file mode 100644
index 00000000..5422a1c4
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/aks.md
@@ -0,0 +1,24 @@
+---
+title: "AKS"
+linkTitle: "AKS"
+weight: 8
+date: 2021-12-08
+description: >
+ Additional configuration for Azure Kubernetes Service
+---
+
+Azure AKS managed Kubernetes service adds to every pod the following environment variables:
+
+```yaml
+- name: KUBERNETES_PORT_443_TCP_ADDR
+ value:
+- name: KUBERNETES_PORT
+ value: tcp://
+- name: KUBERNETES_PORT_443_TCP
+ value: tcp://
+- name: KUBERNETES_SERVICE_HOST
+ value:
+```
+
+The operator is aware of it and omits these environment variables when checking if a Jenkins pod environment has been changed. It prevents the
+restart of a Jenkins pod over and over again.
diff --git a/website/content/en/docs/Getting Started/v0.7.x/configuring-backup-and-restore.md b/website/content/en/docs/Getting Started/v0.7.x/configuring-backup-and-restore.md
new file mode 100644
index 00000000..0ca8e54c
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/configuring-backup-and-restore.md
@@ -0,0 +1,111 @@
+---
+title: "Configuring backup and restore"
+linkTitle: "Configuring backup and restore"
+weight: 5
+date: 2023-01-08
+description: >
+ Prevent loss of job history
+---
+
+> Because of Jenkins Operator's architecture, the configuration of Jenkins should be done using ConfigurationAsCode
+> or GroovyScripts and jobs should be defined as SeedJobs. It means that there is no point in backing up any job configuration
+> up. Therefore, the backup script makes a copy of jobs history only.
+
+Backup and restore is done by a container sidecar.
+
+### PVC
+
+#### Create PVC
+
+Save to the file named pvc.yaml:
+```yaml
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name:
+ namespace:
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 500Gi
+```
+
+Run the following command:
+```bash
+$ kubectl -n create -f pvc.yaml
+```
+
+#### Configure Jenkins CR
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: jenkins-cr
+spec:
+ jenkinsAPISettings:
+ authorizationStrategy: createUser
+ master:
+ securityContext:
+ runAsUser: 1000
+ fsGroup: 1000
+ disableCSRFProtection: false
+ containers:
+ - name: jenkins-master
+ image: jenkins/jenkins:2.277.4-lts-alpine
+ imagePullPolicy: IfNotPresent
+ resources:
+ limits:
+ cpu: 1500m
+ memory: 3Gi
+ requests:
+ cpu: "1"
+ memory: 500Mi
+ - name: backup # container responsible for the backup and restore
+ env:
+ - name: BACKUP_DIR
+ value: /backup
+ - name: JENKINS_HOME
+ value: /jenkins-home
+ - name: BACKUP_COUNT
+ value: "3" # keep only the 2 most recent backups
+ image: virtuslab/jenkins-operator-backup-pvc:v0.1.1 # look at backup/pvc directory
+ imagePullPolicy: IfNotPresent
+ volumeMounts:
+ - mountPath: /jenkins-home # Jenkins home volume
+ name: jenkins-home
+ - mountPath: /backup # backup volume
+ name: backup
+ resources:
+ limits:
+ cpu: 1000m
+ memory: 3Gi
+ requests:
+ cpu: "1"
+ memory: 500Mi
+ volumes:
+ - name: backup # PVC volume where backups will be stored
+ persistentVolumeClaim:
+ claimName:
+ backup:
+ containerName: backup # container name is responsible for backup
+ action:
+ exec:
+ command:
+ - /home/user/bin/backup.sh # this command is invoked on "backup" container to make backup, for example /home/user/bin/backup.sh , is passed by operator
+ interval: 30 # how often make backup in seconds
+ makeBackupBeforePodDeletion: true # make a backup before pod deletion
+ restore:
+ containerName: backup # container name is responsible for restore backup
+ action:
+ exec:
+ command:
+ - /home/user/bin/restore.sh # this command is invoked on "backup" container to make restore backup, for example /home/user/bin/restore.sh , is passed by operator
+ #recoveryOnce: # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restored
+ getLatestAction:
+ exec:
+ command:
+ - /home/user/bin/get-latest.sh # this command is invoked on "backup" container to get last backup number before pod deletion; not having it in the CR may cause loss of data
+```
diff --git a/website/content/en/docs/Getting Started/v0.7.x/configuring-seed-jobs-and-pipelines.md b/website/content/en/docs/Getting Started/v0.7.x/configuring-seed-jobs-and-pipelines.md
new file mode 100644
index 00000000..69af62b1
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/configuring-seed-jobs-and-pipelines.md
@@ -0,0 +1,336 @@
+---
+title: "Configuring Seed Jobs and Pipelines"
+linkTitle: "Configuring Seed Jobs and Pipelines"
+weight: 4
+date: 2021-12-08
+description: >
+ How to configure Jenkins with Operator
+---
+
+## Configure Seed Jobs and Pipelines
+
+Jenkins operator uses [job-dsl][job-dsl] and [kubernetes-credentials-provider][kubernetes-credentials-provider] plugins for configuring jobs
+and deploy keys.
+
+## Prepare job definitions and pipelines
+
+First you have to prepare pipelines and job definition in your GitHub repository using the following structure:
+
+```
+cicd/
+├── jobs
+│ └── k8s.jenkins
+└── pipelines
+ └── k8s.jenkins
+```
+
+**`cicd/jobs/k8s.jenkins`** is a job definition:
+
+```
+#!/usr/bin/env groovy
+
+pipelineJob('k8s-e2e') {
+ displayName('Kubernetes Plugin E2E Test')
+
+ logRotator {
+ numToKeep(10)
+ daysToKeep(30)
+ }
+
+ configure { project ->
+ project / 'properties' / 'org.jenkinsci.plugins.workflow.job.properties.DurabilityHintJobProperty' {
+ hint('PERFORMANCE_OPTIMIZED')
+ }
+ }
+
+ definition {
+ cpsScm {
+ scm {
+ git {
+ remote {
+ url('https://github.com/jenkinsci/kubernetes-operator.git')
+ credentials('jenkins-operator')
+ }
+ branches('*/master')
+ }
+ }
+ scriptPath('cicd/pipelines/k8s.jenkins')
+ }
+ }
+}
+```
+
+**`cicd/pipelines/k8s.jenkins`** is an actual Jenkins pipeline:
+
+```
+#!/usr/bin/env groovy
+
+def label = "k8s-${UUID.randomUUID().toString()}"
+def home = "/home/jenkins"
+def workspace = "${home}/workspace/build-jenkins-operator"
+def workdir = "${workspace}/src/github.com/jenkinsci/kubernetes-operator/"
+
+podTemplate(label: label,
+ containers: [
+ containerTemplate(name: 'alpine', image: 'alpine:3.11', ttyEnabled: true, command: 'cat'),
+ ],
+ ) {
+ node(label) {
+ stage('Run shell') {
+ container('alpine') {
+ sh 'echo "hello world"'
+ }
+ }
+ }
+}
+```
+
+## Configure Seed Jobs
+
+Jenkins Seed Jobs are configured using `Jenkins.spec.seedJobs` section from your custom resource manifest:
+
+```
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ seedJobs:
+ - id: jenkins-operator
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
+```
+
+**Jenkins Operator** will automatically discover and configure all the seed jobs.
+
+You can verify if deploy keys were successfully configured in the Jenkins **Credentials** tab.
+
+
+
+You can verify if your pipelines were successfully configured in the Jenkins Seed Job console output.
+
+
+
+If your GitHub repository is **private** you have to configure SSH or username/password authentication.
+
+### SSH authentication
+
+#### Generate SSH Keys
+
+There are two methods of SSH private key generation:
+
+```bash
+$ openssl genrsa -out 2048
+```
+
+or
+
+```bash
+$ ssh-keygen -t rsa -b 2048
+$ ssh-keygen -p -f -m pem
+```
+
+Then copy content from generated file.
+
+#### Public key
+
+If you want to upload your public key to your Git server you need to extract it.
+
+If key was generated by `openssl` then you need to type this to extract public key:
+
+```bash
+$ openssl rsa -in -pubout > .pub
+```
+
+If key was generated by `ssh-keygen` the public key content is located in .pub and there is no need to extract public key
+
+#### Configure SSH authentication
+
+Configure a seed job like this:
+
+```
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ seedJobs:
+ - id: jenkins-operator-ssh
+ credentialType: basicSSHUserPrivateKey
+ credentialID: k8s-ssh
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: git@github.com:jenkinsci/kubernetes-operator.git
+```
+
+and create a Kubernetes Secret (name of secret should be the same from `credentialID` field):
+
+```
+apiVersion: v1
+kind: Secret
+metadata:
+ name: k8s-ssh
+ labels:
+ "jenkins.io/credentials-type": "basicSSHUserPrivateKey"
+ annotations:
+ "jenkins.io/credentials-description" : "ssh github.com:jenkinsci/kubernetes-operator"
+stringData:
+ privateKey: |
+ -----BEGIN RSA PRIVATE KEY-----
+ MIIJKAIBAAKCAgEAxxDpleJjMCN5nusfW/AtBAZhx8UVVlhhhIKXvQ+dFODQIdzO
+ oDXybs1zVHWOj31zqbbJnsfsVZ9Uf3p9k6xpJ3WFY9b85WasqTDN1xmSd6swD4N8
+ ...
+ username: github_user_name
+```
+
+### Username & password authentication
+
+Configure the seed job like:
+
+```
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ seedJobs:
+ - id: jenkins-operator-user-pass
+ credentialType: usernamePassword
+ credentialID: k8s-user-pass
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
+```
+
+and create a Kubernetes Secret (name of secret should be the same from `credentialID` field):
+
+```
+apiVersion: v1
+kind: Secret
+metadata:
+ name: k8s-user-pass
+stringData:
+ username: github_user_name
+ password: password_or_token
+```
+
+### External authentication
+You can use `external` credential type if you want to configure authentication using Configuration As Code or Groovy Script.
+
+Example:
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ seedJobs:
+ - id: jenkins-operator-external
+ credentialType: external
+ credentialID: k8s-external
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
+```
+
+Remember that `credentialID` must match the id of the credentials configured in Jenkins. Consult the
+[Jenkins docs for using credentials][jenkins-using-credentials] for details.
+
+## HTTP Proxy for downloading plugins
+
+To use forwarding proxy with an operator to download plugins you need to add the following environment variable to Jenkins Custom Resource (CR), e.g.:
+
+```yaml
+spec:
+ master:
+ containers:
+ - name: jenkins-master
+ env:
+ - name: CURL_OPTIONS
+ value: -L -x
+```
+
+In `CURL_OPTIONS` var you can set additional arguments to `curl` command.
+
+## Pulling Docker images from private repositories
+
+To pull a Docker Image from private repository you can use `imagePullSecrets`.
+
+Please follow the instructions on [creating a secret with a docker config](https://kubernetes.io/docs/concepts/containers/images/?origin_team=T42NTAGHM#creating-a-secret-with-a-docker-config).
+
+### Docker Hub Configuration
+To use Docker Hub additional steps are required.
+
+Edit the previously created secret:
+```bash
+kubectl -n edit secret
+```
+
+The `.dockerconfigjson` key's value needs to be replaced with a modified version.
+
+After modifications, it needs to be encoded as a Base64 value before setting the `.dockerconfigjson` key.
+
+Example config file to modify and use:
+```
+{
+ "auths":{
+ "https://index.docker.io/v1/":{
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "auth.docker.io":{
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "registry.docker.io":{
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "docker.io":{
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "https://registry-1.docker.io/v2/": {
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "registry-1.docker.io/v2/": {
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "registry-1.docker.io": {
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ },
+ "https://registry-1.docker.io": {
+ "username":"user",
+ "password":"password",
+ "email":"yourdockeremail@gmail.com",
+ "auth":"base64 of string user:password"
+ }
+ }
+}
+```
+
+[job-dsl]:https://github.com/jenkinsci/job-dsl-plugin
+[kubernetes-credentials-provider]:https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/
+[jenkins-using-credentials]:https://www.jenkins.io/doc/book/using/using-credentials/
diff --git a/website/content/en/docs/Getting Started/v0.7.x/custom-backup-and-restore.md b/website/content/en/docs/Getting Started/v0.7.x/custom-backup-and-restore.md
new file mode 100644
index 00000000..d336a366
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/custom-backup-and-restore.md
@@ -0,0 +1,184 @@
+---
+title: "Custom backup and restore providers"
+linkTitle: "Custom backup and restore providers"
+weight: 7
+date: 2021-12-08
+description: >
+ Custom backup and restore provider
+---
+
+With enough effort one can create a custom backup and restore provider
+for the Jenkins Operator.
+
+## Requirements
+
+Two commands (e.g. scripts) are required:
+
+- a backup command, e.g. `backup.sh` that takes one argument, a **backup number**
+- a restore command, e.g. `backup.sh` that takes one argument, a **backup number**
+
+Both scripts need to return an exit code of `0` on success and `1` or greater for failure.
+
+One of those scripts (or the entry point of the container) needs to be responsible
+for backup cleanup or rotation if required, or an external system.
+
+## How it works
+
+The mechanism relies on basic Kubernetes and UNIX functionalities.
+
+The backup (and restore) container runs as a sidecar in the same
+Kubernetes pod as the Jenkins master.
+
+Name of the backup and restore containers can be set as necessary using
+`spec.backup.containerName` and `spec.restore.containerName`.
+In most cases it will be the same container, but we allow for less common use cases.
+
+The operator will call a backup or restore commands inside a sidecar container when necessary:
+
+- backup command (defined in `spec.backup.action.exec.command`)
+ will be called every `N` seconds configurable in: `spec.backup.interval`
+ and on pod shutdown (if enabled in `spec.backup.makeBackupBeforePodDeletion`)
+ with an integer representing the current backup number as first and only argument
+- restore command (defined in `spec.restore.action.exec.command`)
+ will be called at Jenkins startup
+ with an integer representing the backup number to restore as first and only argument
+ (can be overridden using `spec.restore.recoveryOnce`)
+
+## Example AWS S3 backup using the CLI
+
+This example shows abbreviated version of a simple AWS S3 backup implementation
+using: `aws-cli`, `bash` and `kube2iam`.
+
+In addition to your normal `Jenkins` `CustomResource` some additional settings
+for backup and restore are required, e.g.:
+
+```yaml
+kind: Jenkins
+apiVersion: jenkins.io/v1alpha1
+metadata:
+ name: example
+ namespace: jenkins
+spec:
+ master:
+ masterAnnotations:
+ iam.amazonaws.com/role: "my-example-backup-role" # tell kube2iam where the AWS IAM role is
+ containers:
+ - name: jenkins-master
+ ...
+ - name: backup # container responsible for backup and restore
+ image: quay.io/virtuslab/aws-cli:1.16.263-2
+ workingDir: /home/user/bin/
+ command: # our container entry point
+ - sleep
+ - infinity
+ env:
+ - name: BACKUP_BUCKET
+ value: my-example-bucket # the S3 bucket name to use
+ - name: BACKUP_PATH
+ value: my-backup-path # the S3 bucket path prefix to use
+ - name: JENKINS_HOME
+ value: /jenkins-home # the path to mount jenkins home dir in the backup container
+ volumeMounts:
+ - mountPath: /jenkins-home # Jenkins home volume
+ name: jenkins-home
+ - mountPath: /home/user/bin/backup.sh
+ name: backup-scripts
+ subPath: backup.sh
+ readOnly: true
+ - mountPath: /home/user/bin/restore.sh
+ name: backup-scripts
+ subPath: restore.sh
+ readOnly: true
+ volumes:
+ - name: backup-scripts
+ configMap:
+ defaultMode: 0754
+ name: jenkins-operator-backup-s3
+ securityContext: # make sure both containers use the same UID and GUID
+ runAsUser: 1000
+ fsGroup: 1000
+ ...
+ backup:
+ containerName: backup # container name responsible for backup
+ interval: 3600 # how often make a backup in seconds
+ makeBackupBeforePodDeletion: true # trigger backup just before deleting the pod
+ action:
+ exec:
+ command:
+ # this command is invoked on "backup" container to create a backup,
+ # is passed by operator,
+ # for example /home/user/bin/backup.sh
+ - /home/user/bin/backup.sh
+ restore:
+ containerName: backup # container name is responsible for restore backup
+ action:
+ exec:
+ command:
+ # this command is invoked on "backup" container to restore a backup,
+ # is passed by operator
+ # for example /home/user/bin/restore.sh
+ - /home/user/bin/restore.sh
+# recoveryOnce: # if want to restore specific backup configure this field and then Jenkins will be restarted and desired backup will be restored
+```
+
+The actual backup and restore scripts will be provided in a `ConfigMap`:
+
+```yaml
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: jenkins-operator-backup-s3
+ namespace: jenkins
+ labels:
+ app: jenkins-operator
+data:
+ backup.sh: |-
+ #!/bin/bash -xeu
+ [[ ! $# -eq 1 ]] && echo "Usage: $0 backup_number" && exit 1;
+ [[ -z "${BACKUP_BUCKET}" ]] && echo "Required 'BACKUP_BUCKET' env not set" && exit 1;
+ [[ -z "${BACKUP_PATH}" ]] && echo "Required 'BACKUP_PATH' env not set" && exit 1;
+ [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
+
+ backup_number=$1
+ echo "Running backup #${backup_number}"
+
+ BACKUP_TMP_DIR=$(mktemp -d)
+ tar -C ${JENKINS_HOME} -czf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" --exclude jobs/*/workspace* -c jobs && \
+
+ aws s3 cp ${BACKUP_TMP_DIR}/${backup_number}.tar.gz s3://${BACKUP_BUCKET}/${BACKUP_PATH}/${backup_number}.tar.gz
+ echo Done
+
+ restore.sh: |-
+ #!/bin/bash -xeu
+ [[ ! $# -eq 1 ]] && echo "Usage: $0 backup_number" && exit 1
+ [[ -z "${BACKUP_BUCKET}" ]] && echo "Required 'BACKUP_BUCKET' env not set" && exit 1;
+ [[ -z "${BACKUP_PATH}" ]] && echo "Required 'BACKUP_PATH' env not set" && exit 1;
+ [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1;
+
+ backup_number=$1
+ echo "Running restore #${backup_number}"
+
+ BACKUP_TMP_DIR=$(mktemp -d)
+ aws s3 cp s3://${BACKUP_BUCKET}/${BACKUP_PATH}/${backup_number}.tar.gz ${BACKUP_TMP_DIR}/${backup_number}.tar.gz
+
+ tar -C ${JENKINS_HOME} -zxf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz"
+ echo Done
+```
+
+In our example we will use S3 bucket lifecycle policy to keep
+the number of backups under control, e.g. Cloud Formation fragment:
+```yaml
+ Type: AWS::S3::Bucket
+ Properties:
+ BucketName: my-example-bucket
+ ...
+ LifecycleConfiguration:
+ Rules:
+ - Id: BackupCleanup
+ Status: Enabled
+ Prefix: my-backup-path
+ ExpirationInDays: 7
+ NoncurrentVersionExpirationInDays: 14
+ AbortIncompleteMultipartUpload:
+ DaysAfterInitiation: 3
+```
diff --git a/website/content/en/docs/Getting Started/v0.7.x/customizing-jenkins.md b/website/content/en/docs/Getting Started/v0.7.x/customizing-jenkins.md
new file mode 100644
index 00000000..77073eaf
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/customizing-jenkins.md
@@ -0,0 +1,203 @@
+---
+title: "Customizing Jenkins"
+linkTitle: "Customizing Jenkins"
+weight: 3
+date: 2021-12-08
+description: >
+ How to customize Jenkins
+---
+
+## How to customize Jenkins
+Jenkins can be customized with plugins.
+Plugin's configuration is applied as groovy scripts or the [configuration as code plugin](https://github.com/jenkinsci/configuration-as-code-plugin).
+Any plugin working for Jenkins can be installed by the Jenkins Operator.
+
+Pre-installed plugins:
+
+* configuration-as-code v1.55
+* git v4.10.0
+* job-dsl v1.78.1
+* kubernetes-credentials-provider v0.20
+* kubernetes v1.30.11
+* workflow-aggregator v2.6
+* workflow-job v2.42
+
+Rest of the plugins can be found in [plugins repository](https://plugins.jenkins.io/).
+
+
+#### Install plugins
+
+Edit Custom Resource under `spec.master.plugins`:
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ master:
+ plugins:
+ - name: simple-theme-plugin
+ version: "0.7"
+```
+
+Under `spec.master.basePlugins` you can find plugins for a valid **Jenkins Operator**:
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ master:
+ basePlugins:
+ - name: kubernetes
+ version: "1.30.11"
+ - name: workflow-job
+ version: "2.42"
+ - name: workflow-aggregator
+ version: "2.6"
+ - name: git
+ version: "4.10.0"
+ - name: job-dsl
+ version: "1.78.1"
+ - name: configuration-as-code
+ version: "1.55"
+ - name: kubernetes-credentials-provider
+ version: "0.20"
+```
+
+You can change their versions.
+
+The **Jenkins Operator** will then automatically install plugins after the Jenkins master pod restart.
+
+#### Apply plugin's config
+
+By using a [ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) you can create your own **Jenkins** customized configuration.
+Then you must reference the **`ConfigMap`** in the **Jenkins** pod customization file in `spec.groovyScripts` or `spec.configurationAsCode`
+
+Create a **`ConfigMap`** with specific name (eg. `jenkins-operator-user-configuration`). Then, modify the **Jenkins** manifest:
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ configurationAsCode:
+ configurations:
+ - name: jenkins-operator-user-configuration
+ groovyScripts:
+ configurations:
+ - name: jenkins-operator-user-configuration
+```
+
+Here is an example of `jenkins-operator-user-configuration`:
+```yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: jenkins-operator-user-configuration
+data:
+ 1-configure-theme.groovy: |
+ import jenkins.*
+ import jenkins.model.*
+ import hudson.*
+ import hudson.model.*
+ import org.jenkinsci.plugins.simpletheme.ThemeElement
+ import org.jenkinsci.plugins.simpletheme.CssTextThemeElement
+ import org.jenkinsci.plugins.simpletheme.CssUrlThemeElement
+
+ Jenkins jenkins = Jenkins.getInstance()
+
+ def decorator = Jenkins.instance.getDescriptorByType(org.codefirst.SimpleThemeDecorator.class)
+
+ List configElements = new ArrayList<>();
+ configElements.add(new CssTextThemeElement("DEFAULT"));
+ configElements.add(new CssUrlThemeElement("https://cdn.rawgit.com/afonsof/jenkins-material-theme/gh-pages/dist/material-light-green.css"));
+ decorator.setElements(configElements);
+ decorator.save();
+
+ jenkins.save()
+ 1-system-message.yaml: |
+ jenkins:
+ systemMessage: "Configuration as Code integration works!!!"
+```
+
+* `*.groovy` is Groovy script configuration
+* `*.yaml is` configuration as code
+
+If you want to correct your configuration you can edit it while the **Jenkins Operator** is running.
+Jenkins will reconcile and apply the new configuration.
+
+## How to use secrets from a Groovy scripts
+
+If you configured `spec.groovyScripts.secret.name`, then this secret is available to use from map Groovy scripts.
+The secrets are loaded to `secrets` map.
+
+Create a [secret](https://kubernetes.io/docs/concepts/configuration/secret/) with for example the name `jenkins-conf-secrets`.
+
+```yaml
+kind: Secret
+apiVersion: v1
+type: Opaque
+metadata:
+ name: jenkins-conf-secrets
+ namespace: default
+data:
+ SYSTEM_MESSAGE: SGVsbG8gd29ybGQ=
+```
+
+Then modify the **Jenkins** pod manifest by changing `spec.groovyScripts.secret.name` to `jenkins-conf-secrets`.
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ configurationAsCode:
+ configurations:
+ - name: jenkins-operator-user-configuration
+ secret:
+ name: jenkins-conf-secrets
+ groovyScripts:
+ configurations:
+ - name: jenkins-operator-user-configuration
+ secret:
+ name: jenkins-conf-secrets
+```
+
+Now you can test that the secret is mounted by applying this `ConfigMap` for Groovy script:
+
+```yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: jenkins-operator-user-configuration
+data:
+ 1-system-message.groovy: |
+ import jenkins.*
+ import jenkins.model.*
+ import hudson.*
+ import hudson.model.*
+ Jenkins jenkins = Jenkins.getInstance()
+
+ jenkins.setSystemMessage(secrets["SYSTEM_MESSAGE"])
+ jenkins.save()
+```
+
+Or by applying this configuration as code:
+```yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: jenkins-operator-user-configuration
+data:
+ 1-system-message.yaml: |
+ jenkins:
+ systemMessage: ${SYSTEM_MESSAGE}
+```
+
+
+After this, you should see the `Hello world` system message from the **Jenkins** homepage.
diff --git a/website/content/en/docs/Getting Started/v0.7.x/deploying-jenkins.md b/website/content/en/docs/Getting Started/v0.7.x/deploying-jenkins.md
new file mode 100644
index 00000000..4f046ee0
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/deploying-jenkins.md
@@ -0,0 +1,114 @@
+---
+title: "Deploying Jenkins"
+linkTitle: "Deploying Jenkins"
+weight: 2
+date: 2021-12-08
+description: >
+ Deploy production ready Jenkins manifest
+---
+
+{{% pageinfo %}}
+This document describes the procedure for deploying Jenkins.
+{{% /pageinfo %}}
+
+
+## Prerequisites
+The Operator needs to have been deployed beforehand. The procedure for deploying Jenkins described here doesn't apply to
+installation of Operator via Helm chart unless `jenkins.enabled` was set to false.
+That’s because by default, installation via Helm chart also covers deploying Jenkins.
+
+
+## Deploying Jenkins instance
+Once Jenkins Operator is up and running let's deploy actual Jenkins instance.
+Create manifest e.g. **`jenkins_instance.yaml`** with following data and save it on drive.
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+ namespace: default
+spec:
+ configurationAsCode:
+ configurations: []
+ secret:
+ name: ""
+ groovyScripts:
+ configurations: []
+ secret:
+ name: ""
+ jenkinsAPISettings:
+ authorizationStrategy: createUser
+ master:
+ disableCSRFProtection: false
+ containers:
+ - name: jenkins-master
+ image: jenkins/jenkins:2.319.1-lts-alpine
+ imagePullPolicy: Always
+ livenessProbe:
+ failureThreshold: 12
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 100
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 5
+ readinessProbe:
+ failureThreshold: 10
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 80
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 1
+ resources:
+ limits:
+ cpu: 1500m
+ memory: 3Gi
+ requests:
+ cpu: "1"
+ memory: 500Mi
+ seedJobs:
+ - id: jenkins-operator
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
+```
+
+Deploy a Jenkins to Kubernetes:
+
+```bash
+kubectl create -f jenkins_instance.yaml
+```
+Watch the Jenkins instance being created:
+
+```bash
+kubectl get pods -w
+```
+
+Get the Jenkins credentials:
+
+```bash
+kubectl get secret jenkins-operator-credentials- -o 'jsonpath={.data.user}' | base64 -d
+kubectl get secret jenkins-operator-credentials- -o 'jsonpath={.data.password}' | base64 -d
+```
+
+Connect to the Jenkins instance (minikube):
+
+```bash
+minikube service jenkins-operator-http- --url
+```
+
+Connect to the Jenkins instance (actual Kubernetes cluster):
+
+```bash
+kubectl port-forward jenkins- 8080:8080
+```
+Then open browser with address `http://localhost:8080`.
+
+
diff --git a/website/content/en/docs/Getting Started/v0.7.x/installing-the-operator.md b/website/content/en/docs/Getting Started/v0.7.x/installing-the-operator.md
new file mode 100644
index 00000000..81cc0170
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/installing-the-operator.md
@@ -0,0 +1,988 @@
+---
+title: "Installing the Operator"
+linkTitle: "Installing the Operator"
+weight: 1
+date: 2023-01-08
+description: >
+ How to install Jenkins Operator
+---
+
+{{% pageinfo %}}
+This document describes installation procedure for **Jenkins Operator**.
+All container images can be found at [virtuslab/jenkins-operator](https://hub.docker.com/r/virtuslab/jenkins-operator) Docker Hub repository.
+{{% /pageinfo %}}
+
+## Requirements
+
+To run **Jenkins Operator**, you will need:
+
+- access to a Kubernetes cluster version `1.17+`
+- `kubectl` version `1.17+`
+
+
+Listed below are the two ways to deploy Jenkins Operator.
+
+## Deploy Jenkins Operator using YAML's
+
+First, install Jenkins Custom Resource Definition:
+
+```bash
+kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/config/crd/bases/jenkins.io_jenkins.yaml
+```
+
+Then, install the Operator and other required resources:
+
+```bash
+kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml
+```
+
+Watch **Jenkins Operator** instance being created:
+
+```bash
+kubectl get pods -w
+```
+
+Now **Jenkins Operator** should be up and running in the `default` namespace.
+For deploying Jenkins, refer to [Deploy Jenkins section](/kubernetes-operator/docs/getting-started/latest/deploying-jenkins/).
+
+## Deploy Jenkins Operator using Helm Chart
+
+Alternatively, you can also use Helm to install the Operator (and optionally, by default, Jenkins). It requires the Helm 3+ for deployment.
+
+Create a namespace for the operator:
+
+```bash
+$ kubectl create namespace
+```
+
+To install, you need only to type these commands:
+
+```bash
+$ helm repo add jenkins https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart
+$ helm install jenkins/jenkins-operator -n
+```
+
+To add custom labels and annotations, you can use `values.yaml` file or pass them into `helm install` command, e.g.:
+
+```bash
+$ helm install jenkins/jenkins-operator -n --set jenkins.labels.LabelKey=LabelValue,jenkins.annotations.AnnotationKey=AnnotationValue
+```
+You can further customize Jenkins using `values.yaml`:
+Jenkins instance configuration
+
+
+
+
+
+ |
+Field |
+Default value |
+Description |
+
+
+
+
+
+
+jenkins
+ |
+
+ operator is section for configuring operator deployment
+
+
+
+enabled
+ |
+
+true
+ |
+
+Enabled can enable or disable the Jenkins instance.
+Set to false if you have configured CR already and/or you want to deploy an operator only.
+ |
+
+
+
+apiVersion
+ |
+jenkins.io/v1alpha2 |
+
+Version of the CR manifest. The recommended and default value is jenkins.io/v1alpha2.
+More info
+ |
+
+
+
+name
+ |
+
+jenkins
+ |
+
+Name of resource. The pod name will be jenkins-<name> (name will be set as suffix).
+ |
+
+
+
+namespace
+ |
+
+default
+ |
+
+Namespace the resources will be deployed to. It's not recommended to use default namespace.
+Create new namespace for jenkins (e.g. kubectl create -n jenkins)
+ |
+
+
+
+labels
+ |
+
+{}
+ |
+
+Labels are injected into metadata labels field.
+ |
+
+
+
+annotations
+ |
+
+{}
+ |
+
+Annotations are injected into metadata annotations field.
+ |
+
+
+
+image
+ |
+
+jenkins/jenkins:lts
+ |
+
+Image is the name (and tag) of the Jenkins instance.
+It's recommended to use LTS (tag: "lts") version.
+ |
+
+
+
+env
+ |
+
+[]
+ |
+
+Env contains jenkins container environment variables.
+ |
+
+
+
+imagePullPolicy
+ |
+
+Always
+ |
+
+Defines policy for pulling images
+ |
+
+
+
+priorityClassName
+ |
+
+""
+ |
+
+PriorityClassName indicates the importance of a Pod relative to other Pods.
+More info
+ |
+
+
+
+disableCSRFProtection
+ |
+
+false
+ |
+
+disableCSRFProtection can enable or disable operator built-in CSRF protection.
+Set it to true if you are using OpenShift Jenkins Plugin.
+More info
+ |
+
+
+
+imagePullSecrets
+ |
+
+[]
+ |
+
+Used if you want to pull images from private repository
+More info
+ |
+
+
+
+notifications
+ |
+
+[]
+ |
+
+Notifications is feature that notify user about Jenkins reconciliation status
+More info
+ |
+
+
+
+basePlugins
+ |
+
+
+- name: kubernetes
+ version: "1.25.2"
+- name: workflow-job
+ version: "2.39"
+- name: workflow-aggregator
+ version: "2.6"
+- name: git
+ version: "4.2.2"
+- name: job-dsl
+ version: "1.77"
+- name: configuration-as-code
+ version: "1.38"
+- name: kubernetes-credentials
+ -provider
+ version: "0.13"
+
+ |
+
+Plugins installed and required by the operator
+shouldn't contain plugins defined by user
+You can change their versions here
+More info
+ |
+
+
+
+plugins
+ |
+
+[]
+ |
+
+Plugins required by the user. You can define plugins here.
+More info
+Example:
+
+plugins:
+ - name: simple-theme-plugin
+ version: 0.5.1
+
+ |
+
+
+
+seedJobs
+ |
+
+[]
+ |
+
+Placeholder for jenkins seed jobs
+For seed job creation tutorial, check: Prepare seed jobs
+ Configure seed jobs
+ Example:
+
+
+seedJobs:
+- id: jenkins-operator
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl:
+ - https://github.com/jenkinsci/kubernetes-operator.git
+
+
+ |
+
+
+
+resources
+ |
+
+
+limits:
+ cpu: 1500m
+ memory: 3Gi
+requests:
+ cpu: 1
+ memory: 500M
+
+ |
+
+Resource limit/request for Jenkins
+More info
+ |
+
+
+
+volumes
+ |
+
+
+- name: backup
+ persistentVolumeClaim:
+ claimName: jenkins-backup
+
+ |
+
+Volumes used by Jenkins
+By default, we are only using PVC volume for storing backups.
+ |
+
+
+
+volumeMounts
+ |
+
+[]
+ |
+
+volumeMounts are mounts for Jenkins pod.
+ |
+
+
+
+securityContext
+ |
+
+runAsUser: 1000
+fsGroup: 1000
+ |
+
+SecurityContext for pod.
+ |
+
+
+service |
+not implemented |
+Http Jenkins service. See https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/schema/#github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Service for details. |
+
+
+slaveService |
+not implemented |
+Slave Jenkins service. See https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/schema/#github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Service for details. |
+
+
+
+livenessProbe
+ |
+
+
+livenessProbe:
+ failureThreshold: 12
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 80
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 5
+
+ |
+
+livenessProbe for Pod
+ |
+
+
+
+readinessProbe
+ |
+
+
+readinessProbe:
+ failureThreshold: 3
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 30
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 1
+
+ |
+
+readinessProbe for Pod
+ |
+
+
+
+
+backup
+
+
+
+
+Backup
+
+
+
+ |
+
+ |
+
+Backup is section for configuring operator's backup feature
+By default backup feature is enabled and pre-configured
+This section simplifies the configuration described here: Configuring backup and restore
+For customization tips see Custom backup and restore
+ |
+
+
+
+configuration
+
+
+
+Configuration
+
+
+
+ |
+ |
+
+Section where we can configure Jenkins instance.
+See Customizing Jenkins for details
+ |
+
+
+ |
+
+
+
+
+### Configuring operator deployment
+
+
+
+
+ |
+ Field |
+ Default value |
+ Description |
+
+
+
+
+
+
+ operator
+ |
+
+ operator is section for configuring operator deployment
+
+
+
+ replicaCount
+ |
+
+ 1
+ |
+
+ Number of Replicas.
+ |
+
+
+
+ image
+ |
+
+ virtuslab/jenkins-operator:v0.4.0
+ |
+
+ Name (and tag) of the Jenkins Operator image.
+ |
+
+
+
+ imagePullPolicy
+ |
+
+ IfNotPresent
+ |
+
+ Defines policy for pulling images.
+ |
+
+
+
+ imagePullSecrets
+ |
+
+ []
+ |
+
+ Used if you want to pull images from private repository.
+ |
+
+
+
+ nameOverride
+ |
+
+ ""
+ |
+
+ nameOverride overrides the app name.
+ |
+
+
+
+ fullnameOverride
+ |
+
+ ""
+ |
+
+ fullnameOverride overrides the deployment name
+ |
+
+
+
+ resources
+ |
+
+ {}
+ |
+
+ |
+
+
+
+ nodeSelector
+ |
+
+ {}
+ |
+
+ |
+
+
+
+ tolerations
+ |
+
+ {}
+ |
+
+ |
+
+
+
+ affinity
+ |
+
+ {}
+ |
+
+ |
+
+
+ |
+
+
+
+
+
+
+Backup
+
+
+(Appears on:
+JenkinsConfiguration)
+
+
+Backup defines configuration of Jenkins backup.
+
+
+
+
+
+| Field |
+Default value |
+Description |
+
+
+
+
+
+ enabled
+ |
+
+ true
+ |
+
+ Enabled is enable/disable switch for backup feature.
+ |
+
+
+
+ image
+ |
+
+ virtuslab/jenkins-operator-backup-pvc:v0.1.1
+ |
+
+ Image used by backup feature.
+ |
+
+
+
+ containerName
+ |
+
+ backup
+ |
+
+ Backup container name.
+ |
+
+
+
+ interval
+ |
+
+ 30
+ |
+
+ Defines how often make backup in seconds.
+ |
+
+
+
+ makeBackupBeforePodDeletion
+ |
+
+ true
+ |
+
+ When enabled will make backup before pod deletion.
+ |
+
+
+
+ backupCommand
+ |
+
+ /home/user/bin/backup.sh
+ |
+
+ Backup container command.
+ |
+
+
+
+ restoreCommand
+ |
+
+ /home/user/bin/restore.sh
+ |
+
+ Backup restore command.
+ |
+
+
+
+ pvc
+ |
+
+ Persistent Volume Claim Kubernetes resource
+
+
+
+
+
+ enabled
+ |
+
+ true
+ |
+
+ Enable/disable switch for PVC
+ |
+
+
+
+ enabled
+ |
+
+ true
+ |
+
+ Enable/disable switch for PVC
+ |
+
+
+
+ size
+ |
+
+ 5Gi
+ |
+
+ Size of PVC
+ |
+
+
+
+ className
+ |
+
+ ""
+ |
+
+ StorageClassName for PVC
+ More info
+ |
+
+
+
+ |
+
+
+
+ env
+ |
+
+
+- name: BACKUP_DIR
+ value: /backup
+- name: JENKINS_HOME
+ value: /jenkins-home
+- name: BACKUP_COUNT
+ value: "3"
+
+ |
+
+ Contains container environment variables.
+ PVC backup provider handles these variables:
+ BACKUP_DIR - path for storing backup files (default: "/backup")
+ JENKINS_HOME - path to jenkins home (default: "/jenkins-home")
+ BACKUP_COUNT - define how much recent backups will be kept
+ |
+
+
+
+
+ volumeMounts
+ |
+
+
+- name: jenkins-home
+ mountPath: /jenkins-home
+- mountPath: /backup
+ name: backup
+
+ |
+
+ Holds the mount points for volumes.
+ |
+
+
+
+
+ Configuration
+
+
+ (Appears on:
+ Jenkins instance configuration)
+
+
+
+
+
+ | Field |
+ Default value |
+ Description |
+
+
+
+
+
+ configurationAsCode
+ |
+
+ {}
+ |
+
+ ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin.
+Example:
+
+- configMapName: jenkins-casc
+ content: {}
+
+ |
+
+
+
+ groovyScripts
+ |
+
+ {}
+ |
+
+ GroovyScripts defines configuration of Jenkins customization via groovy scripts.
+ Example:
+
+- configMapName: jenkins-gs
+ content: {}
+
+ |
+
+
+
+ secretRefName
+ |
+
+ ""
+ |
+
+ secretRefName of existing secret (previously created).
+ |
+
+
+
+ secretData
+ |
+
+ {}
+ |
+
+ If secretRefName is empty, secretData creates new secret and fills with data provided in secretData.
+ |
+
+
+
+
+## Note on Operator's nightly built images
+If you wish to use the newest, not yet released version of the Operator, you can use one of nightly built snapshot images, however the maintainers of this project cannot guarantee their stability.
+
+You can find nightly built images by heading to [virtuslab/jenkins-operator](https://hub.docker.com/r/virtuslab/jenkins-operator) Docker Hub repository and looking for images with tag in the form of `{git-hash}`, {git-hash} being the hash of master branch commit that you want to use snapshot of.
+
+## Note on restricted Jenkins controller pod volumeMounts
+Current design of the Operator puts an emphasis on creating a full GitOps flow of work for Jenkins users.
+One of the key points of this design is maintaining an immutable state of Jenkins.
+
+One of the prerequisites of this is an ephemeral Jenkins home directory. To achieve that, Operator mounts emptyDir Volume
+(jenkins-home) as Jenkins home directory.
+It is not possible to overwrite volumeMount and specify any other Volume for Jenkins home directory,
+as attempting to do so will result in Operator error.
+
+jenkins-home is not the only Jenkins controller pod volumeMount that is non-configurable and managed by Operator,
+below is the full list of those volumeMounts:
+
+* jenkins-home
+* scripts
+* init-configuration
+* operator-credentials
+
+## Validating Webhook
+Validating webhook can be used in order to increase the Operator's capabilities to monitor security issues. It will look for security vulnerabilities in the base and requested plugins. It can be easily installed via Helm charts by setting webhook.enabled in values.yaml.
+
+
+**Note**: The webhook takes some time to get up and running. It's recommended to first deploy the Operator and later Jenkins Custom Resource by using toggles in `values.yaml`.
+For the installation with yaml manifests (without using Helm chart), first, install cert-manager:
+
+```bash
+kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.1/cert-manager.yaml
+```
+
+It takes some time to get cert-manager up and running.
+Then, install the webhook and other required resources:
+
+```bash
+kubectl apply -f https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-webhook.yaml
+```
+
+Now, download the manifests for the operator and other resources from [here](https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/deploy/all-in-one-v1alpha2.yaml) and provide these additional fields in the Operator manifest:
+
+
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: jenkins-operator
+ labels:
+ control-plane: controller-manager
+spec:
+ selector:
+ matchLabels:
+ control-plane: controller-manager
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ control-plane: controller-manager
+ spec:
+ serviceAccountName: jenkins-operator
+ securityContext:
+ runAsUser: 65532
+ containers:
+ - command:
+ - /manager
+ args:
+ - --leader-elect
+ - --validate-security-warnings
+ image: virtuslab/jenkins-operator:v0.7.0
+ name: jenkins-operator
+ imagePullPolicy: IfNotPresent
+ securityContext:
+ allowPrivilegeEscalation: false
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ readinessProbe:
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ resources:
+ limits:
+ cpu: 200m
+ memory: 100Mi
+ requests:
+ cpu: 100m
+ memory: 20Mi
+ env:
+ - name: WATCH_NAMESPACE
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.namespace
+ volumeMounts:
+ - mountPath: /tmp/k8s-webhook-server/serving-certs
+ name: webhook-certs
+ readOnly: true
+ volumes:
+ - name: webhook-certs
+ secret:
+ defaultMode: 420
+ secretName: jenkins-webhook-certificate
+ terminationGracePeriodSeconds: 10
+
+
+
+To enable security validation in the Jenkins Custom Resource, set
+
+>jenkins.ValidateSecurityWarnings=true
diff --git a/website/content/en/docs/Getting Started/v0.7.x/ldap.md b/website/content/en/docs/Getting Started/v0.7.x/ldap.md
new file mode 100644
index 00000000..ca2b1179
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/ldap.md
@@ -0,0 +1,127 @@
+---
+title: "LDAP"
+linkTitle: "LDAP"
+weight: 9
+date: 2021-12-08
+description: >
+ Additional configuration for LDAP
+---
+
+Configuring LDAP is not supported out of the box, but can be achieved through
+plugins and some well tuned configurations.
+
+The plugin we will use is:
+
+> Note: This is an example of how LDAP authentication can be achieved. The LDAP
+> plugin is from a third-party, and there may be other alternatives that suits
+> your use case better. Use this guide with a grain of salt.
+
+## Requirements
+
+- LDAP server accessible from the Kubernetes cluster where your Jenkins
+ instance will live.
+
+- Credentials to a manager account in your AD. Jenkins Operator will use
+ this account to authenticate with Jenkins for health checks, seed jobs, etc.
+
+## Steps
+
+In your Jenkins configuration, add the following plugin:
+
+```yaml
+plugins:
+ # Check https://plugins.jenkins.io/ldap/ to find the latest version.
+ - name: ldap
+ version: "2.7"
+```
+
+Easiest step is to then start up Jenkins then navigate to your instance's
+"Configure Global Security" page and configure it accordingly.
+
+`http://jenkins.example.com/configureSecurity/`
+
+Once it's set up and tested, you can navigate to your JCasC page and export
+the LDAP settings.
+
+`https://jenkins.example.com/configuration-as-code/`
+
+Feed the relevant new settings into your Kubernetes ConfigMap for your JCasC
+settings.
+
+Here's a snippet of the LDAP-related configurations:
+
+```yaml
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: jenkins-casc
+data:
+ ldap.yaml: |
+ jenkins:
+ securityRealm:
+ ldap:
+ configurations:
+ - displayNameAttributeName: "name"
+ groupSearchBase: "OU=Groups,OU=MyCompany"
+ groupSearchFilter: "(& (cn={0}) (objectclass=group) )"
+ inhibitInferRootDN: false
+ managerDN: "CN=Jenkins Admin,OU=UsersSystem,OU=UsersOther,OU=MyCompany,DC=mycompany,DC=local"
+ managerPasswordSecret: "${LDAP_MANAGER_PASSWORD}"
+ rootDN: "DC=mycompany,DC=local"
+ server: "MyCompany.local"
+ userSearch: "SamAccountName={0}"
+ userSearchBase: "OU=MyCompany"
+ disableMailAddressResolver: false
+ disableRolePrefixing: true
+ groupIdStrategy: "caseInsensitive"
+ userIdStrategy: "caseInsensitive"
+```
+
+> Note the use of `${LDAP_MANAGER_PASSWORD}` above. You can reference
+> Kubernetes secrets in your JCasC ConfigMaps by adding the following to your
+> Jenkins object:
+>
+> ```yaml
+> kind: Jenkins
+> spec:
+> configurationAsCode:
+> configurations:
+> - name: jenkins-casc
+> secret:
+> # This here
+> name: jenkins-casc-secrets
+> ```
+>
+> ```yaml
+> apiVersion: v1
+> kind: Secret
+> metadata:
+> name: jenkins-cred-conf-secrets
+> stringData:
+> LDAP_MANAGER_PASSWORD:
+> ```
+>
+> Schema reference: [v1alpha2.ConfigurationAsCode](./schema/#github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.ConfigurationAsCode)
+
+Finally you must configure the Jenkins operator to use the manager's
+credentials from the AD.
+
+This is because this procedure will disable Jenkins' own user database, and the
+Jenkins operator still needs to be able to talk to Jenkins in an authorized
+manner.
+
+Create the following Kubernetes secret:
+
+```yaml
+apiVersion: v1
+kind: Secret
+metadata:
+ name: jenkins-operator-credentials-
+ namespace:
+stringData:
+ user:
+ password:
+```
+
+> Note: Values in stringData do not need to be base64 encoded. They are
+> encoded by Kubernetes when the manifest is applied.
diff --git a/website/content/en/docs/Getting Started/v0.7.x/openshift.md b/website/content/en/docs/Getting Started/v0.7.x/openshift.md
new file mode 100644
index 00000000..9c0c349b
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/openshift.md
@@ -0,0 +1,10 @@
+---
+title: "OpenShift"
+linkTitle: "OpenShift"
+weight: 10
+date: 2021-12-08
+description: >
+ Additional configuration for OpenShift
+---
+
+## Release 0.7.0 is not compatible with OpenShift.
diff --git a/website/content/en/docs/Getting Started/v0.7.x/schema.md b/website/content/en/docs/Getting Started/v0.7.x/schema.md
new file mode 100644
index 00000000..03ce4739
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/schema.md
@@ -0,0 +1,2679 @@
+---
+title: "Schema"
+linkTitle: "Schema"
+weight: 11
+date: 2023-01-08
+description: >
+ API Schema definitions for Jenkins CRD
+---
+
+{{% pageinfo %}}
+This document contains API scheme for `jenkins-operator` Custom Resource Definition manifest
+{{% /pageinfo %}}
+
+Packages:
+
+jenkins.io
+
+
Package v1alpha2 contains API Schema definitions for the jenkins.io v1alpha2 API group
+
+Resource Types:
+
+Jenkins
+
+
+
Jenkins is the Schema for the jenkins API
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+apiVersion
+string |
+
+
+jenkins.io/v1alpha2
+
+ |
+
+
+
+kind
+string
+ |
+Jenkins |
+
+
+
+metadata
+
+
+Kubernetes meta/v1.ObjectMeta
+
+
+ |
+
+Refer to the Kubernetes API documentation for the fields of the
+metadata field.
+ |
+
+
+
+spec
+
+
+JenkinsSpec
+
+
+ |
+
+ Spec defines the desired state of the Jenkins
+
+
+
+ |
+
+
+
+status
+
+
+JenkinsStatus
+
+
+ |
+
+ Status defines the observed state of Jenkins
+ |
+
+
+
+AppliedGroovyScript
+
+
+(Appears on:
+JenkinsStatus)
+
+
+
AppliedGroovyScript is the applied groovy script in Jenkins by the operator.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+configurationType
+
+string
+
+ |
+
+ ConfigurationType is the name of the configuration type(base-groovy, user-groovy, user-casc)
+ |
+
+
+
+source
+
+string
+
+ |
+
+ Source is the name of source where is located groovy script
+ |
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of the groovy script
+ |
+
+
+
+hash
+
+string
+
+ |
+
+ Hash is the hash of the groovy script and secrets which it uses
+ |
+
+
+
+AuthorizationStrategy
+(string alias)
+
+(Appears on:
+JenkinsAPISettings)
+
+
+
AuthorizationStrategy defines authorization strategy of the operator for the Jenkins API
+
+Backup
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
Backup defines configuration of Jenkins backup.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+containerName
+
+string
+
+ |
+
+ ContainerName is the container name responsible for backup operation
+ |
+
+
+
+action
+
+
+Handler
+
+
+ |
+
+ Action defines action which performs backup in backup container sidecar
+ |
+
+
+
+interval
+
+uint64
+
+ |
+
+ Interval tells how often make backup in seconds
+Defaults to 30.
+ |
+
+
+
+makeBackupBeforePodDeletion
+
+bool
+
+ |
+
+ MakeBackupBeforePodDeletion tells operator to make backup before Jenkins master pod deletion
+ |
+
+
+
+ConfigMapRef
+
+
+(Appears on:
+Customization)
+
+
+
ConfigMapRef is reference to Kubernetes ConfigMap.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+ConfigurationAsCode
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
ConfigurationAsCode defines configuration of Jenkins customization via Configuration as Code Jenkins plugin.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+Customization
+
+
+Customization
+
+
+ |
+
+
+(Members of Customization are embedded into this type.)
+
+ |
+
+
+
+Container
+
+
+(Appears on:
+JenkinsMaster)
+
+
+
Container defines Kubernetes container attributes.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name of the container specified as a DNS_LABEL.
+Each container in a pod must have a unique name (DNS_LABEL).
+ |
+
+
+
+image
+
+string
+
+ |
+
+ Docker image name.
+More info: https://kubernetes.io/docs/concepts/containers/images
+ |
+
+
+
+imagePullPolicy
+
+
+Kubernetes core/v1.PullPolicy
+
+
+ |
+
+ Image pull policy.
+One of Always, Never, IfNotPresent.
+Defaults to Always.
+ |
+
+
+
+resources
+
+
+Kubernetes core/v1.ResourceRequirements
+
+
+ |
+
+ Compute Resources required by this container.
+More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
+ |
+
+
+
+command
+
+[]string
+
+ |
+
+(Optional)
+ Entrypoint array. Not executed within a shell.
+The docker image’s ENTRYPOINT is used if this is not provided.
+Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable
+cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
+can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
+regardless of whether the variable exists or not.
+More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
+ |
+
+
+
+args
+
+[]string
+
+ |
+
+(Optional)
+ Arguments to the entrypoint.
+The docker image’s CMD is used if this is not provided.
+Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable
+cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
+can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
+regardless of whether the variable exists or not.
+More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
+ |
+
+
+
+workingDir
+
+string
+
+ |
+
+(Optional)
+ Container’s working directory.
+If not specified, the container runtime’s default will be used, which
+might be configured in the container image.
+ |
+
+
+
+ports
+
+
+[]Kubernetes core/v1.ContainerPort
+
+
+ |
+
+(Optional)
+ List of ports to expose from the container. Exposing a port here gives
+the system additional information about the network connections a
+container uses, but is primarily informational. Not specifying a port here
+DOES NOT prevent that port from being exposed. Any port which is
+listening on the default “0.0.0.0” address inside a container will be
+accessible from the network.
+ |
+
+
+
+envFrom
+
+
+[]Kubernetes core/v1.EnvFromSource
+
+
+ |
+
+(Optional)
+ List of sources to populate environment variables in the container.
+The keys defined within a source must be a C_IDENTIFIER. All invalid keys
+will be reported as an event when the container is starting. When a key exists in multiple
+sources, the value associated with the last source will take precedence.
+Values defined by an Env with a duplicate key will take precedence.
+ |
+
+
+
+env
+
+
+[]Kubernetes core/v1.EnvVar
+
+
+ |
+
+(Optional)
+ List of environment variables to set in the container.
+ |
+
+
+
+volumeMounts
+
+
+[]Kubernetes core/v1.VolumeMount
+
+
+ |
+
+(Optional)
+ Pod volumes to mount into the container’s filesystem.
+ |
+
+
+
+livenessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Periodic probe of container liveness.
+Container will be restarted if the probe fails.
+ |
+
+
+
+readinessProbe
+
+
+Kubernetes core/v1.Probe
+
+
+ |
+
+(Optional)
+ Periodic probe of container service readiness.
+Container will be removed from service endpoints if the probe fails.
+ |
+
+
+
+lifecycle
+
+
+Kubernetes core/v1.Lifecycle
+
+
+ |
+
+(Optional)
+ Actions that the management system should take in response to container lifecycle events.
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.SecurityContext
+
+
+ |
+
+(Optional)
+ Security options the pod should run with.
+More info: https://kubernetes.io/docs/concepts/policy/security-context/
+More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
+ |
+
+
+
+Customization
+
+
+(Appears on:
+ConfigurationAsCode,
+GroovyScripts)
+
+
+
Customization defines configuration of Jenkins customization.
+
+
+GroovyScripts
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
GroovyScripts defines configuration of Jenkins customization via groovy scripts.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+Customization
+
+
+Customization
+
+
+ |
+
+
+(Members of Customization are embedded into this type.)
+
+ |
+
+
+
+Handler
+
+
+(Appears on:
+Backup,
+Restore)
+
+
+
Handler defines a specific action that should be taken.
+
+
+JenkinsAPISettings
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
JenkinsAPISettings defines configuration used by the operator to gain admin access to the Jenkins API
+
+
+JenkinsCredentialType
+(string alias)
+
+(Appears on:
+SeedJob)
+
+
+
JenkinsCredentialType defines type of Jenkins credential used to seed job mechanism.
+
+JenkinsMaster
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
JenkinsMaster defines the Jenkins master pod attributes and plugins,
+every single change requires a Jenkins master pod restart.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+annotations
+
+map[string]string
+
+ |
+
+(Optional)
+ Annotations is an unstructured key value map stored with a resource that may be
+set by external tools to store and retrieve arbitrary metadata. They are not
+queryable and should be preserved when modifying objects.
+More info: http://kubernetes.io/docs/user-guide/annotations
+ |
+
+
+
+labels
+
+map[string]string
+
+ |
+
+(Optional)
+ Map of string keys and values that can be used to organize and categorize
+(scope and select) objects. May match selectors of replication controllers
+and services.
+More info: http://kubernetes.io/docs/user-guide/labels
+ |
+
+
+
+nodeSelector
+
+map[string]string
+
+ |
+
+(Optional)
+ NodeSelector is a selector which must be true for the pod to fit on a node.
+Selector which must match a node’s labels for the pod to be scheduled on that node.
+More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
+ |
+
+
+
+securityContext
+
+
+Kubernetes core/v1.PodSecurityContext
+
+
+ |
+
+(Optional)
+ SecurityContext that applies to all the containers of the Jenkins
+Master. As per kubernetes specification, it can be overridden
+for each container individually.
+Defaults to:
+runAsUser: 1000
+fsGroup: 1000
+ |
+
+
+
+containers
+
+
+[][]github.com/jenkinsci/kubernetes-operator/api/v1alpha2.Container
+
+
+ |
+
+(Optional)
+ List of containers belonging to the pod.
+Containers cannot currently be added or removed.
+There must be at least one container in a Pod.
+Defaults to:
+- image: jenkins/jenkins:lts
+imagePullPolicy: Always
+livenessProbe:
+failureThreshold: 12
+httpGet:
+path: /login
+port: http
+scheme: HTTP
+initialDelaySeconds: 80
+periodSeconds: 10
+successThreshold: 1
+timeoutSeconds: 5
+name: jenkins-master
+readinessProbe:
+failureThreshold: 3
+httpGet:
+path: /login
+port: http
+scheme: HTTP
+initialDelaySeconds: 30
+periodSeconds: 10
+successThreshold: 1
+timeoutSeconds: 1
+resources:
+limits:
+cpu: 1500m
+memory: 3Gi
+requests:
+cpu: “1”
+memory: 600Mi
+ |
+
+
+
+imagePullSecrets
+
+
+[]Kubernetes core/v1.LocalObjectReference
+
+
+ |
+
+(Optional)
+ ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
+If specified, these secrets will be passed to individual puller implementations for them to use. For example,
+in the case of docker, only DockerConfig type secrets are honored.
+More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod
+ |
+
+
+
+volumes
+
+
+[]Kubernetes core/v1.Volume
+
+
+ |
+
+(Optional)
+ List of volumes that can be mounted by containers belonging to the pod.
+More info: https://kubernetes.io/docs/concepts/storage/volumes
+ |
+
+
+
+tolerations
+
+
+[]Kubernetes core/v1.Toleration
+
+
+ |
+
+(Optional)
+ If specified, the pod’s tolerations.
+ |
+
+
+
+basePlugins
+
+
+[][]github.com/jenkinsci/kubernetes-operator/api/v1alpha2.Plugin
+
+
+ |
+
+(Optional)
+ BasePlugins contains plugins required by operator
+Defaults to :
+- name: kubernetes
+version: “1.30.11”
+- name: workflow-job
+version: “2.42”
+- name: workflow-aggregator
+version: “2.6”
+- name: git
+version: “4.10.0”
+- name: job-dsl
+version: “1.78.1”
+- name: configuration-as-code
+version: “1.55”
+- name: kubernetes-credentials-provider
+version: “0.20”
+ |
+
+
+
+plugins
+
+
+[][]github.com/jenkinsci/kubernetes-operator/api/v1alpha2.Plugin
+
+
+ |
+
+(Optional)
+ Plugins contains plugins required by user
+ |
+
+
+
+disableCSRFProtection
+
+bool
+
+ |
+
+ DisableCSRFProtection allows you to toggle CSRF Protection on Jenkins
+ |
+
+
+
+priorityClassName
+
+string
+
+ |
+
+(Optional)
+ PriorityClassName for Jenkins master pod
+ |
+
+
+
+hostAliases
+
+
+[]Kubernetes core/v1.HostAlias
+
+
+ |
+
+(Optional)
+ HostAliases for Jenkins master pod and SeedJob agent
+ |
+
+
+
+JenkinsSpec
+
+
+(Appears on:
+Jenkins)
+
+
+
JenkinsSpec defines the desired state of Jenkins
+
+
+JenkinsStatus
+
+
+(Appears on:
+Jenkins)
+
+
+
JenkinsStatus defines the observed state of Jenkins
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+operatorVersion
+
+string
+
+ |
+
+(Optional)
+ OperatorVersion is the operator version which manages this CR
+ |
+
+
+
+provisionStartTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ ProvisionStartTime is a time when Jenkins master pod has been created
+ |
+
+
+
+baseConfigurationCompletedTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ BaseConfigurationCompletedTime is a time when Jenkins base configuration phase has been completed
+ |
+
+
+
+userConfigurationCompletedTime
+
+
+Kubernetes meta/v1.Time
+
+
+ |
+
+(Optional)
+ UserConfigurationCompletedTime is a time when Jenkins user configuration phase has been completed
+ |
+
+
+
+restoredBackup
+
+uint64
+
+ |
+
+(Optional)
+ RestoredBackup is the restored backup number after Jenkins master pod restart
+ |
+
+
+
+lastBackup
+
+uint64
+
+ |
+
+(Optional)
+ LastBackup is the latest backup number
+ |
+
+
+
+pendingBackup
+
+uint64
+
+ |
+
+(Optional)
+ PendingBackup is the pending backup number
+ |
+
+
+
+backupDoneBeforePodDeletion
+
+bool
+
+ |
+
+(Optional)
+ BackupDoneBeforePodDeletion tells if backup before pod deletion has been made
+ |
+
+
+
+userAndPasswordHash
+
+string
+
+ |
+
+(Optional)
+ UserAndPasswordHash is a SHA256 hash made from user and password
+ |
+
+
+
+createdSeedJobs
+
+[]string
+
+ |
+
+(Optional)
+ CreatedSeedJobs contains list of seed job id already created in Jenkins
+ |
+
+
+
+appliedGroovyScripts
+
+
+[][]github.com/jenkinsci/kubernetes-operator/api/v1alpha2.AppliedGroovyScript
+
+
+ |
+
+(Optional)
+ AppliedGroovyScripts is a list with all applied groovy scripts in Jenkins by the operator
+ |
+
+
+
+Mailgun
+
+
+(Appears on:
+Notification)
+
+
+
Mailgun is handler for Mailgun email service notification channel.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+domain
+
+string
+
+ |
+
+ |
+
+
+
+apiKeySecretKeySelector
+
+
+SecretKeySelector
+
+
+ |
+
+ |
+
+
+
+recipient
+
+string
+
+ |
+
+ |
+
+
+
+from
+
+string
+
+ |
+
+ |
+
+
+
+MicrosoftTeams
+
+
+(Appears on:
+Notification)
+
+
+
MicrosoftTeams is handler for Microsoft MicrosoftTeams notification channel.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+webHookURLSecretKeySelector
+
+
+SecretKeySelector
+
+
+ |
+
+ The web hook URL to MicrosoftTeams App
+ |
+
+
+
+Notification
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
Notification is a service configuration used to send notifications about Jenkins status.
+
+
+NotificationLevel
+(string alias)
+
+(Appears on:
+Notification)
+
+
+
NotificationLevel defines the level of a Notification.
+
+Plugin
+
+
+(Appears on:
+JenkinsMaster)
+
+
+
Plugin defines Jenkins plugin.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ Name is the name of Jenkins plugin
+ |
+
+
+
+version
+
+string
+
+ |
+
+ Version is the version of Jenkins plugin
+ |
+
+
+
+downloadURL
+
+string
+
+ |
+
+ DownloadURL is the custom url from where plugin has to be downloaded.
+ |
+
+
+
+PluginData
+
+
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+Version
+
+string
+
+ |
+
+ |
+
+
+
+Kind
+
+string
+
+ |
+
+ |
+
+
+
+PluginInfo
+
+
+(Appears on:
+PluginsInfo)
+
+
+
+
+PluginsInfo
+
+
+(Appears on:
+SecurityValidator)
+
+
+
+
+Restore
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
Restore defines configuration of Jenkins backup restore operation.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+containerName
+
+string
+
+ |
+
+ ContainerName is the container name responsible for restore backup operation
+ |
+
+
+
+action
+
+
+Handler
+
+
+ |
+
+ Action defines action which performs restore backup in restore container sidecar
+ |
+
+
+
+getLatestAction
+
+
+Handler
+
+
+ |
+
+(Optional)
+ GetLatestAction defines action which returns the latest backup number. If there is no backup “-1” should be
+returned.
+ |
+
+
+
+recoveryOnce
+
+uint64
+
+ |
+
+(Optional)
+ RecoveryOnce if want to restore specific backup set this field and then Jenkins will be restarted and desired backup will be restored
+ |
+
+
+
+SMTP
+
+
+(Appears on:
+Notification)
+
+
+
SMTP is handler for sending emails via this protocol.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+usernameSecretKeySelector
+
+
+SecretKeySelector
+
+
+ |
+
+ |
+
+
+
+passwordSecretKeySelector
+
+
+SecretKeySelector
+
+
+ |
+
+ |
+
+
+
+port
+
+int
+
+ |
+
+ |
+
+
+
+server
+
+string
+
+ |
+
+ |
+
+
+
+tlsInsecureSkipVerify
+
+bool
+
+ |
+
+ |
+
+
+
+from
+
+string
+
+ |
+
+ |
+
+
+
+to
+
+string
+
+ |
+
+ |
+
+
+
+SecretKeySelector
+
+
+(Appears on:
+Mailgun,
+MicrosoftTeams,
+SMTP,
+Slack)
+
+
+
SecretKeySelector selects a key of a Secret.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+secret
+
+
+Kubernetes core/v1.LocalObjectReference
+
+
+ |
+
+ The name of the secret in the pod’s namespace to select from.
+ |
+
+
+
+key
+
+string
+
+ |
+
+ The key of the secret to select from. Must be a valid secret key.
+ |
+
+
+
+SecretRef
+
+
+(Appears on:
+Customization)
+
+
+
SecretRef is reference to Kubernetes secret.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+name
+
+string
+
+ |
+
+ |
+
+
+
+SecurityValidator
+
+
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+PluginDataCache
+
+
+PluginsInfo
+
+
+ |
+
+ |
+
+
+
+isCached
+
+bool
+
+ |
+
+ |
+
+
+
+Attempts
+
+int
+
+ |
+
+ |
+
+
+
+checkingPeriod
+
+time.Duration
+
+ |
+
+ |
+
+
+
+SeedJob
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
SeedJob defines configuration for seed job
+More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration/#configure-seed-jobs-and-pipelines.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+id
+
+string
+
+ |
+
+ ID is the unique seed job name
+ |
+
+
+
+credentialID
+
+string
+
+ |
+
+ CredentialID is the Kubernetes secret name which stores repository access credentials
+ |
+
+
+
+description
+
+string
+
+ |
+
+(Optional)
+ Description is the description of the seed job
+ |
+
+
+
+targets
+
+string
+
+ |
+
+ Targets is the repository path where are seed job definitions
+ |
+
+
+
+repositoryBranch
+
+string
+
+ |
+
+ RepositoryBranch is the repository branch where are seed job definitions
+ |
+
+
+
+repositoryUrl
+
+string
+
+ |
+
+ RepositoryURL is the repository access URL. Can be SSH or HTTPS.
+ |
+
+
+
+credentialType
+
+
+JenkinsCredentialType
+
+
+ |
+
+(Optional)
+ JenkinsCredentialType is the https://jenkinsci.github.io/kubernetes-credentials-provider-plugin/ credential type
+ |
+
+
+
+bitbucketPushTrigger
+
+bool
+
+ |
+
+(Optional)
+ BitbucketPushTrigger is used for Bitbucket web hooks
+ |
+
+
+
+githubPushTrigger
+
+bool
+
+ |
+
+(Optional)
+ GitHubPushTrigger is used for GitHub web hooks
+ |
+
+
+
+buildPeriodically
+
+string
+
+ |
+
+(Optional)
+ BuildPeriodically is setting for scheduled trigger
+ |
+
+
+
+pollSCM
+
+string
+
+ |
+
+(Optional)
+ PollSCM is setting for polling changes in SCM
+ |
+
+
+
+ignoreMissingFiles
+
+bool
+
+ |
+
+(Optional)
+ IgnoreMissingFiles is setting for Job DSL API plugin to ignore files that miss
+ |
+
+
+
+additionalClasspath
+
+string
+
+ |
+
+(Optional)
+ AdditionalClasspath is setting for Job DSL API plugin to set Additional Classpath
+ |
+
+
+
+failOnMissingPlugin
+
+bool
+
+ |
+
+(Optional)
+ FailOnMissingPlugin is setting for Job DSL API plugin that fails job if required plugin is missing
+ |
+
+
+
+unstableOnDeprecation
+
+bool
+
+ |
+
+(Optional)
+ UnstableOnDeprecation is setting for Job DSL API plugin that sets build status as unstable if build using deprecated features
+ |
+
+
+
+Service
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
Service defines Kubernetes service attributes
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+annotations
+
+map[string]string
+
+ |
+
+(Optional)
+ Annotations is an unstructured key value map stored with a resource that may be
+set by external tools to store and retrieve arbitrary metadata. They are not
+queryable and should be preserved when modifying objects.
+More info: http://kubernetes.io/docs/user-guide/annotations
+ |
+
+
+
+labels
+
+map[string]string
+
+ |
+
+(Optional)
+ Route service traffic to pods with label keys and values matching this
+selector. If empty or not present, the service is assumed to have an
+external process managing its endpoints, which Kubernetes will not
+modify. Only applies to types ClusterIP, NodePort, and LoadBalancer.
+Ignored if type is ExternalName.
+More info: https://kubernetes.io/docs/concepts/services-networking/service/
+ |
+
+
+
+type
+
+
+Kubernetes core/v1.ServiceType
+
+
+ |
+
+(Optional)
+ Type determines how the Service is exposed. Defaults to ClusterIP. Valid
+options are ExternalName, ClusterIP, NodePort, and LoadBalancer.
+“ExternalName” maps to the specified externalName.
+“ClusterIP” allocates a cluster-internal IP address for load-balancing to
+endpoints. Endpoints are determined by the selector or if that is not
+specified, by manual construction of an Endpoints object. If clusterIP is
+“None”, no virtual IP is allocated and the endpoints are published as a
+set of endpoints rather than a stable IP.
+“NodePort” builds on ClusterIP and allocates a port on every node which
+routes to the clusterIP.
+“LoadBalancer” builds on NodePort and creates an
+external load-balancer (if supported in the current cloud) which routes
+to the clusterIP.
+More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services—service-types
+ |
+
+
+
+port
+
+int32
+
+ |
+
+ The port that are exposed by this service.
+More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
+ |
+
+
+
+nodePort
+
+int32
+
+ |
+
+(Optional)
+ The port on each node on which this service is exposed when type=NodePort or LoadBalancer.
+Usually assigned by the system. If specified, it will be allocated to the service
+if unused or else creation of the service will fail.
+Default is to auto-allocate a port if the ServiceType of this Service requires one.
+More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
+ |
+
+
+
+loadBalancerSourceRanges
+
+[]string
+
+ |
+
+(Optional)
+ If specified and supported by the platform, this will restrict traffic through the cloud-provider
+load-balancer will be restricted to the specified client IPs. This field will be ignored if the
+cloud-provider does not support the feature.”
+More info: https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/#restricting-cloud-metadata-api-access
+ |
+
+
+
+loadBalancerIP
+
+string
+
+ |
+
+(Optional)
+ Only applies to Service Type: LoadBalancer
+LoadBalancer will get created with the IP specified in this field.
+This feature depends on whether the underlying cloud-provider supports specifying
+the loadBalancerIP when a load balancer is created.
+This field will be ignored if the cloud-provider does not support the feature.
+ |
+
+
+
+ServiceAccount
+
+
+(Appears on:
+JenkinsSpec)
+
+
+
ServiceAccount defines Kubernetes service account attributes
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+annotations
+
+map[string]string
+
+ |
+
+(Optional)
+ Annotations is an unstructured key value map stored with a resource that may be
+set by external tools to store and retrieve arbitrary metadata. They are not
+queryable and should be preserved when modifying objects.
+More info: http://kubernetes.io/docs/user-guide/annotations
+ |
+
+
+
+Slack
+
+
+(Appears on:
+Notification)
+
+
+
Slack is handler for Slack notification channel.
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+webHookURLSecretKeySelector
+
+
+SecretKeySelector
+
+
+ |
+
+ The web hook URL to Slack App
+ |
+
+
+
+Version
+
+
+(Appears on:
+Warning)
+
+
+
+
+
+
+| Field |
+Description |
+
+
+
+
+
+firstVersion
+
+string
+
+ |
+
+ |
+
+
+
+lastVersion
+
+string
+
+ |
+
+ |
+
+
+
+Warning
+
+
+(Appears on:
+PluginInfo)
+
+
+
+
+
+
+Generated with gen-crd-api-reference-docs
+on git commit 76078d5f.
+
diff --git a/website/content/en/docs/Getting Started/v0.7.x/separate-namespaces.md b/website/content/en/docs/Getting Started/v0.7.x/separate-namespaces.md
new file mode 100644
index 00000000..472df44d
--- /dev/null
+++ b/website/content/en/docs/Getting Started/v0.7.x/separate-namespaces.md
@@ -0,0 +1,583 @@
+---
+title: "Separate namespaces for Jenkins and Operator"
+linkTitle: "Separate namespaces for Jenkins and Operator"
+weight: 6
+date: 2021-12-08
+description: >
+ How to install Jenkins and Jenkins Operator in separate namespaces
+---
+
+## Create namespaces
+
+You need to create two namespaces, for example we'll call them **jenkins** for Jenkins and **jenkins-operator** for Jenkins Operator.
+```bash
+$ kubectl create ns jenkins-operator
+$ kubectl create ns jenkins
+```
+
+## Create necessary resources in Jenkins Operator namespace
+
+Next, you need to install resources necessary for the Operator to work in the `jenkins-operator` namespace. To do that,
+copy the manifest you see below to `jenkins-operator-rbac.yaml`file.
+
+```yaml
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: jenkins-operator
+---
+# permissions to do leader election.
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: leader-election-role
+rules:
+- apiGroups:
+ - ""
+ - coordination.k8s.io
+ resources:
+ - configmaps
+ - leases
+ verbs:
+ - get
+ - list
+ - watch
+ - create
+ - update
+ - patch
+ - delete
+- apiGroups:
+ - ""
+ resources:
+ - events
+ verbs:
+ - create
+ - patch
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: leader-election-rolebinding
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: leader-election-role
+subjects:
+- kind: ServiceAccount
+ name: jenkins-operator
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: jenkins-operator
+rules:
+- apiGroups:
+ - apps
+ resources:
+ - daemonsets
+ - deployments
+ - replicasets
+ - statefulsets
+ verbs:
+ - '*'
+- apiGroups:
+ - apps
+ - jenkins-operator
+ resources:
+ - deployments/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - build.openshift.io
+ resources:
+ - buildconfigs
+ - builds
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - configmaps
+ - secrets
+ - services
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - events
+ verbs:
+ - create
+ - get
+ - list
+ - patch
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - persistentvolumeclaims
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - pods
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - pods
+ - pods/exec
+ verbs:
+ - '*'
+- apiGroups:
+ - ""
+ resources:
+ - pods/log
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - ""
+ resources:
+ - pods/portforward
+ verbs:
+ - create
+- apiGroups:
+ - ""
+ resources:
+ - serviceaccounts
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+- apiGroups:
+ - image.openshift.io
+ resources:
+ - imagestreams
+ verbs:
+ - get
+ - list
+ - watch
+- apiGroups:
+ - jenkins.io
+ resources:
+ - '*'
+ verbs:
+ - '*'
+- apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins/status
+ verbs:
+ - get
+ - patch
+ - update
+- apiGroups:
+ - rbac.authorization.k8s.io
+ resources:
+ - rolebindings
+ - roles
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+- apiGroups:
+ - route.openshift.io
+ resources:
+ - routes
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: jenkins-operator
+subjects:
+ - kind: ServiceAccount
+ name: jenkins-operator
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: jenkins-operator
+```
+
+Now install the required resources in `jenkins-operator` namespace with:
+```bash
+kubectl apply -n jenkins-operator -f jenkins-operator-rbac.yaml
+```
+
+There's only one thing left to install in `jenkins-operator` namespace, and that is the Operator itself. The manifest
+below contains the Operator as defined in all-in-one manifest found in [Installing the Operator](/kubernetes-operator/docs/getting-started/latest/installing-the-operator/)
+page, the only difference is that the one here sets `WATCH_NAMESPACE` to the `jenkins` namespace we created.
+
+Copy its content to `jenkins-operator.yaml` file.
+
+```bash
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: jenkins-operator
+ labels:
+ control-plane: controller-manager
+spec:
+ selector:
+ matchLabels:
+ control-plane: controller-manager
+ replicas: 1
+ template:
+ metadata:
+ labels:
+ control-plane: controller-manager
+ spec:
+ serviceAccountName: jenkins-operator
+ securityContext:
+ runAsUser: 65532
+ containers:
+ - command:
+ - /manager
+ args:
+ - --leader-elect
+ image: virtuslab/jenkins-operator:v0.7.0
+ name: jenkins-operator
+ imagePullPolicy: IfNotPresent
+ securityContext:
+ allowPrivilegeEscalation: false
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ readinessProbe:
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ resources:
+ limits:
+ cpu: 100m
+ memory: 30Mi
+ requests:
+ cpu: 100m
+ memory: 20Mi
+ env:
+ - name: WATCH_NAMESPACE
+ valueFrom:
+ fieldRef:
+ fieldPath: metadata.namespace
+ terminationGracePeriodSeconds: 10
+```
+
+Install the Operator in `jenkins-operator` namespace with:
+
+```bash
+kubectl apply -n jenkins-operator -f jenkins-operator.yaml
+```
+
+You have installed the Operator in `jenkins-operator` namespace, watching for Jenkins in `jenkins` namespace. Now
+there are two things left to do: creating necessary Role and RoleBinding for the Operator in `jenkins` namespace, and
+deploying actual Jenkins instance there.
+
+## Create necessary resources in Jenkins namespace
+
+Below you can find manifest with RBAC that needs to be created in `jenkins` namespace. Copy its content to `jenkins-ns-rbac.yaml` file.
+
+```yaml
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ name: jenkins-operator
+rules:
+ - apiGroups:
+ - apps
+ resources:
+ - daemonsets
+ - deployments
+ - replicasets
+ - statefulsets
+ verbs:
+ - '*'
+ - apiGroups:
+ - apps
+ - jenkins-operator
+ resources:
+ - deployments/finalizers
+ verbs:
+ - update
+ - apiGroups:
+ - build.openshift.io
+ resources:
+ - buildconfigs
+ - builds
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - configmaps
+ - secrets
+ - services
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - events
+ verbs:
+ - create
+ - get
+ - list
+ - patch
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - persistentvolumeclaims
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - pods
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - pods
+ - pods/exec
+ verbs:
+ - '*'
+ - apiGroups:
+ - ""
+ resources:
+ - pods/log
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - ""
+ resources:
+ - pods/portforward
+ verbs:
+ - create
+ - apiGroups:
+ - ""
+ resources:
+ - serviceaccounts
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+ - apiGroups:
+ - image.openshift.io
+ resources:
+ - imagestreams
+ verbs:
+ - get
+ - list
+ - watch
+ - apiGroups:
+ - jenkins.io
+ resources:
+ - '*'
+ verbs:
+ - '*'
+ - apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+ - apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins/finalizers
+ verbs:
+ - update
+ - apiGroups:
+ - jenkins.io
+ resources:
+ - jenkins/status
+ verbs:
+ - get
+ - patch
+ - update
+ - apiGroups:
+ - rbac.authorization.k8s.io
+ resources:
+ - rolebindings
+ - roles
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+ - apiGroups:
+ - route.openshift.io
+ resources:
+ - routes
+ verbs:
+ - create
+ - get
+ - list
+ - update
+ - watch
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ name: jenkins-operator
+subjects:
+ - kind: ServiceAccount
+ name: jenkins-operator
+ namespace: jenkins-operator
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: jenkins-operator
+```
+
+Now apply it with:
+```bash
+kubectl apply -n jenkins -f jenkins-ns-rbac.yaml
+```
+
+The last thing to do is to deploy Jenkins. Below you can find an example Jenkins resource manifest.
+It's the same as one used in [Deploying Jenkins](/kubernetes-operator/docs/getting-started/latest/deploying-jenkins/).
+Copy it to `jenkins-instance.yaml`
+
+```yaml
+apiVersion: jenkins.io/v1alpha2
+kind: Jenkins
+metadata:
+ name: example
+spec:
+ configurationAsCode:
+ configurations: []
+ secret:
+ name: ""
+ groovyScripts:
+ configurations: []
+ secret:
+ name: ""
+ jenkinsAPISettings:
+ authorizationStrategy: createUser
+ master:
+ disableCSRFProtection: false
+ containers:
+ - name: jenkins-master
+ image: jenkins/jenkins:2.319.1-lts-alpine
+ imagePullPolicy: Always
+ livenessProbe:
+ failureThreshold: 12
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 100
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 5
+ readinessProbe:
+ failureThreshold: 10
+ httpGet:
+ path: /login
+ port: http
+ scheme: HTTP
+ initialDelaySeconds: 80
+ periodSeconds: 10
+ successThreshold: 1
+ timeoutSeconds: 1
+ resources:
+ limits:
+ cpu: 1500m
+ memory: 3Gi
+ requests:
+ cpu: "1"
+ memory: 500Mi
+ seedJobs:
+ - id: jenkins-operator
+ targets: "cicd/jobs/*.jenkins"
+ description: "Jenkins Operator repository"
+ repositoryBranch: master
+ repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
+```
+
+Now you can deploy it with:
+
+```bash
+kubectl apply -n jenkins -f jenkins-instance.yaml
+```
+
+With this, you have just set up Jenkins Operator and Jenkins in separate namespaces. Now the Operator will run in
+its own namespace (`jenkins-operator`), watch for CRs in `jenkins` namespace, and deploy Jenkins there.
From 1e4ffd47184b3be0405a859d850f1bf997f2857c Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:05:16 +0200
Subject: [PATCH 08/40] fix: backup trimming, only selecting zstd file (#846)
---
backup/pvc/bin/run.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backup/pvc/bin/run.sh b/backup/pvc/bin/run.sh
index 56c2d687..50123d5e 100644
--- a/backup/pvc/bin/run.sh
+++ b/backup/pvc/bin/run.sh
@@ -11,6 +11,6 @@ do
if [[ ! -z "${BACKUP_COUNT}" ]]; then
echo "Trimming to only ${BACKUP_COUNT} recent backups in preparation for new backup"
#TODO: add the list of exceeding backup before delete
- find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.*' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}'
+ find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.zstd' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}'
fi
done
From dab511fed3f37b6c8135a6592361f0572cb00486 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:05:43 +0200
Subject: [PATCH 09/40] Bump docker/login-action from 1 to 2 (#819)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/release-backup.yaml | 2 +-
.github/workflows/release-nightly.yaml | 2 +-
.github/workflows/release.yaml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 97461c93..7a314f1c 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -44,7 +44,7 @@ jobs:
- name: Login to Quay.io
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
- uses: docker/login-action@v1
+ uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
diff --git a/.github/workflows/release-nightly.yaml b/.github/workflows/release-nightly.yaml
index f4f3a709..634b5886 100644
--- a/.github/workflows/release-nightly.yaml
+++ b/.github/workflows/release-nightly.yaml
@@ -92,7 +92,7 @@ jobs:
run: make bats-tests
- name: Post - Login to Quay.io
- uses: docker/login-action@v1
+ uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 2fc9194b..f6775a18 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -45,7 +45,7 @@ jobs:
tag_name: ${{ env.VERSION }}
- name: Login to Quay.io
- uses: docker/login-action@v1
+ uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
From 936dbc471312166e955cbef72405d5fb7a776f5e Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:06:17 +0200
Subject: [PATCH 10/40] Bump actions/checkout from 2 to 3 (#815)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/auto-gen-docs.yaml | 2 +-
.github/workflows/auto-tests-e2e.yaml | 2 +-
.github/workflows/auto-tests-helm.yaml | 2 +-
.github/workflows/release-backup.yaml | 2 +-
.github/workflows/release-helm-chart.yaml | 2 +-
.github/workflows/release-nightly.yaml | 2 +-
.github/workflows/release.yaml | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/auto-gen-docs.yaml b/.github/workflows/auto-gen-docs.yaml
index 5e246276..4997599a 100644
--- a/.github/workflows/auto-gen-docs.yaml
+++ b/.github/workflows/auto-gen-docs.yaml
@@ -23,7 +23,7 @@ jobs:
steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
submodules: recursive # Fetch the Docsy theme
fetch-depth: 0
diff --git a/.github/workflows/auto-tests-e2e.yaml b/.github/workflows/auto-tests-e2e.yaml
index a51e198e..0e8138dc 100644
--- a/.github/workflows/auto-tests-e2e.yaml
+++ b/.github/workflows/auto-tests-e2e.yaml
@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Set up env vars
run: |
diff --git a/.github/workflows/auto-tests-helm.yaml b/.github/workflows/auto-tests-helm.yaml
index 2a827d18..86c6c867 100644
--- a/.github/workflows/auto-tests-helm.yaml
+++ b/.github/workflows/auto-tests-helm.yaml
@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Set up env vars
run: |
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 7a314f1c..8a9ac30e 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Check envs
run: make -C backup/pvc check-env
diff --git a/.github/workflows/release-helm-chart.yaml b/.github/workflows/release-helm-chart.yaml
index dbb4d75c..725acb6b 100644
--- a/.github/workflows/release-helm-chart.yaml
+++ b/.github/workflows/release-helm-chart.yaml
@@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Deploy Helm chart
run: |
diff --git a/.github/workflows/release-nightly.yaml b/.github/workflows/release-nightly.yaml
index 634b5886..5a2fb1ac 100644
--- a/.github/workflows/release-nightly.yaml
+++ b/.github/workflows/release-nightly.yaml
@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Prep - check out code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
- name: Prep - Set up env vars
run: |
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index f6775a18..44dfd086 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -9,7 +9,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v2
+ uses: actions/checkout@v3
with:
fetch-depth: 0
From e6bd8c3f14bc3c26a57ffc91f69b40d937fcb31d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:06:57 +0200
Subject: [PATCH 11/40] Bump peter-evans/create-pull-request from 3 to 5 (#817)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/auto-gen-docs.yaml | 2 +-
.github/workflows/release-helm-chart.yaml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/auto-gen-docs.yaml b/.github/workflows/auto-gen-docs.yaml
index 4997599a..8db4d9ba 100644
--- a/.github/workflows/auto-gen-docs.yaml
+++ b/.github/workflows/auto-gen-docs.yaml
@@ -77,7 +77,7 @@ jobs:
# Creates pull request with generated docs
- name: Create Pull Request
if: env.IS_CHANGED == 'true'
- uses: peter-evans/create-pull-request@v3
+ uses: peter-evans/create-pull-request@v5
with:
commit-message: Auto-updated docs
branch: docs-generator
diff --git a/.github/workflows/release-helm-chart.yaml b/.github/workflows/release-helm-chart.yaml
index 725acb6b..36bf84e1 100644
--- a/.github/workflows/release-helm-chart.yaml
+++ b/.github/workflows/release-helm-chart.yaml
@@ -31,7 +31,7 @@ jobs:
# Creates pull request with new chart version
- name: Create Pull Request
- uses: peter-evans/create-pull-request@v3
+ uses: peter-evans/create-pull-request@v5
with:
commit-message: Release Helm chart ${{ github.event.inputs.chartVersion }}
branch: helm-chart-release-${{ github.event.inputs.chartVersion }}
From 93d3e9eb9f6b39920537f1dfc79c8a6b21b74ed4 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:20:03 +0200
Subject: [PATCH 12/40] fix hugo and backup version, fix backup ci (#847)
---
.github/workflows/release-backup.yaml | 1 +
Makefile | 2 +-
backup/pvc/VERSION.txt | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 8a9ac30e..983efc70 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -54,5 +54,6 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
+ rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
diff --git a/Makefile b/Makefile
index a3e8f279..744d10c0 100644
--- a/Makefile
+++ b/Makefile
@@ -478,7 +478,7 @@ helm-release-latest: helm
# Download and build hugo extended locally if necessary
HUGO_PATH = $(shell pwd)/bin/hugo
-HUGO_VERSION = v0.62.2
+HUGO_VERSION = v0.113.0
HAS_HUGO := $(shell $(HUGO_PATH)/hugo version 2>&- | grep $(HUGO_VERSION))
hugo:
ifeq ($(HAS_HUGO), )
diff --git a/backup/pvc/VERSION.txt b/backup/pvc/VERSION.txt
index f0cfd3bb..f82e0685 100644
--- a/backup/pvc/VERSION.txt
+++ b/backup/pvc/VERSION.txt
@@ -1 +1 @@
-v0.2.2
+v0.2.4
From 813cbc812eafad55cbba2fccd4a8eaecee508ebe Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Mon, 5 Jun 2023 23:54:37 +0200
Subject: [PATCH 13/40] fix: hugo and backup ci again (#848)
---
.github/workflows/auto-gen-docs.yaml | 2 +-
.github/workflows/release-backup.yaml | 1 -
backup/pvc/Makefile | 1 +
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/auto-gen-docs.yaml b/.github/workflows/auto-gen-docs.yaml
index 8db4d9ba..f446e72f 100644
--- a/.github/workflows/auto-gen-docs.yaml
+++ b/.github/workflows/auto-gen-docs.yaml
@@ -39,7 +39,7 @@ jobs:
if: env.IS_CHANGED == 'true'
uses: peaceiris/actions-hugo@v2
with:
- hugo-version: '0.62.2'
+ hugo-version: '0.113.0'
extended: true
# Sets up node - required by Hugo
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 983efc70..8a9ac30e 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -54,6 +54,5 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
- rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
diff --git a/backup/pvc/Makefile b/backup/pvc/Makefile
index d8ec544f..3587d57d 100644
--- a/backup/pvc/Makefile
+++ b/backup/pvc/Makefile
@@ -151,6 +151,7 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat
echo $(NEW_VERSION) > VERSION.txt
git add VERSION.txt
git commit -avm "Bump backup PVC version to $(NEW_VERSION)"
+ rm $(PROJECT_DIR)/bin/sembump
.PHONY: tag
tag: ## Create a new git tag to prepare to build a release
From 3fe842fff4bb910278a905af8f9171e77a9cd313 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Tue, 6 Jun 2023 00:10:36 +0200
Subject: [PATCH 14/40] chore: prearing version bumpt to v0.8.0-beta2 (#849)
---
.github/workflows/release-backup.yaml | 1 +
VERSION.txt | 2 +-
chart/jenkins-operator/values.yaml | 12 ++++++------
config.base.env | 2 +-
pkg/plugins/base_plugins.go | 6 +++---
test/e2e/configuration_test.go | 6 +++---
test/e2e/test_utility.go | 2 +-
test/helm/helm_test.go | 2 +-
8 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 8a9ac30e..983efc70 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -54,5 +54,6 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
+ rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
diff --git a/VERSION.txt b/VERSION.txt
index bd0a7375..ff2a3fbf 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-v0.8.0-beta
+v0.8.0-beta2
diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml
index 7df657a0..d6415d75 100644
--- a/chart/jenkins-operator/values.yaml
+++ b/chart/jenkins-operator/values.yaml
@@ -36,7 +36,7 @@ jenkins:
# image is the name (and tag) of the Jenkins instance
# Default: jenkins/jenkins:lts
# It's recommended to use LTS (tag: "lts") version
- image: jenkins/jenkins:2.387.3-lts
+ image: jenkins/jenkins:2.401.1-lts
# env contains jenkins container environment variables
env: []
@@ -92,15 +92,15 @@ jenkins:
# - name: kubernetes
# version: 3937.vd7b_82db_e347b_
# - name: workflow-job
- # version: 1301.v054d9cea_9593
+ # version: 1308.v58d48a_763b_31
# - name: workflow-aggregator
# version: 596.v8c21c963d92d
# - name: git
# version: 5.0.2
# - name: job-dsl
- # version: "1.83"
+ # version: "1.84"
# - name: configuration-as-code
- # version: 1625.v27444588cc3d
+ # version: 1647.ve39ca_b_829b_42
# - name: kubernetes-credentials-provider
# version: 1.211.vc236a_f5a_2f3c
@@ -210,7 +210,7 @@ jenkins:
# image used by backup feature
# By default using prebuilt backup PVC image
- image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.1
+ image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.5
# containerName is backup container name
containerName: backup
@@ -294,7 +294,7 @@ operator:
replicaCount: 1
# image is the name (and tag) of the Jenkins Operator image
- image: quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta
+ image: quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta2
# imagePullPolicy defines policy for pulling images
imagePullPolicy: IfNotPresent
diff --git a/config.base.env b/config.base.env
index 2a74da58..9c4ef8a3 100644
--- a/config.base.env
+++ b/config.base.env
@@ -13,5 +13,5 @@ GEN_CRD_API=gen-crd-api-reference-docs
IMAGE_PULL_MODE=local
HELM_VERSION=3.1.2
CLUSTER_DOMAIN=cluster.local
-LATEST_LTS_VERSION=2.387.3
+LATEST_LTS_VERSION=2.401.1
KIND_CLUSTER_NAME=jenkins
diff --git a/pkg/plugins/base_plugins.go b/pkg/plugins/base_plugins.go
index 39ca3264..c5247163 100644
--- a/pkg/plugins/base_plugins.go
+++ b/pkg/plugins/base_plugins.go
@@ -1,13 +1,13 @@
package plugins
const (
- configurationAsCodePlugin = "configuration-as-code:1625.v27444588cc3d"
+ configurationAsCodePlugin = "configuration-as-code:1647.ve39ca_b_829b_42"
gitPlugin = "git:5.0.2"
- jobDslPlugin = "job-dsl:1.83"
+ jobDslPlugin = "job-dsl:1.84"
kubernetesPlugin = "kubernetes:3937.vd7b_82db_e347b_"
kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c"
workflowAggregatorPlugin = "workflow-aggregator:596.v8c21c963d92d"
- workflowJobPlugin = "workflow-job:1301.v054d9cea_9593"
+ workflowJobPlugin = "workflow-job:1308.v58d48a_763b_31"
)
// basePluginsList contains plugins to install by operator.
diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go
index ff8c8662..51f1904a 100644
--- a/test/e2e/configuration_test.go
+++ b/test/e2e/configuration_test.go
@@ -24,13 +24,13 @@ import (
const e2e = "e2e"
var expectedBasePluginsList = []plugins.Plugin{
- plugins.Must(plugins.New("configuration-as-code:1625.v27444588cc3d")),
+ plugins.Must(plugins.New("configuration-as-code:1647.ve39ca_b_829b_42")),
plugins.Must(plugins.New("git:5.0.2")),
plugins.Must(plugins.New("kubernetes:3937.vd7b_82db_e347b_")),
plugins.Must(plugins.New("kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c")),
- plugins.Must(plugins.New("job-dsl:1.83")),
+ plugins.Must(plugins.New("job-dsl:1.84")),
plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")),
- plugins.Must(plugins.New("workflow-job:1301.v054d9cea_9593")),
+ plugins.Must(plugins.New("workflow-job:1308.v58d48a_763b_31")),
}
func createUserConfigurationSecret(namespace string, stringData map[string]string) {
diff --git a/test/e2e/test_utility.go b/test/e2e/test_utility.go
index 81c80b9c..45776235 100644
--- a/test/e2e/test_utility.go
+++ b/test/e2e/test_utility.go
@@ -21,7 +21,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/envtest"
)
-const JenkinsTestImage = "jenkins/jenkins:2.387.3-lts"
+const JenkinsTestImage = "jenkins/jenkins:2.401.1-lts"
var (
Cfg *rest.Config
diff --git a/test/helm/helm_test.go b/test/helm/helm_test.go
index 6430b8ba..58d2dfc9 100644
--- a/test/helm/helm_test.go
+++ b/test/helm/helm_test.go
@@ -47,7 +47,7 @@ var _ = Describe("Jenkins Controller", func() {
cmd := exec.Command("../../bin/helm", "upgrade", "jenkins", "../../chart/jenkins-operator", "--namespace", namespace.Name, "--debug",
"--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name),
- "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.387.3-lts"),
+ "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.401.1-lts"),
"--set-string", fmt.Sprintf("operator.image=%s", *imageName), "--install")
output, err := cmd.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), string(output))
From 6cceedba773fea2e3c213a8244a5a66a987cc33a Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Sun, 25 Jun 2023 15:48:36 +0200
Subject: [PATCH 15/40] fix(backup): get-latest.sh, search for both .gz and
.zstd (#858)
---
.github/workflows/auto-codespell.yml | 2 +-
backup/pvc/bin/get-latest.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/auto-codespell.yml b/.github/workflows/auto-codespell.yml
index 843cd2d3..e6fea4e9 100644
--- a/.github/workflows/auto-codespell.yml
+++ b/.github/workflows/auto-codespell.yml
@@ -18,4 +18,4 @@ jobs:
with:
check_filenames: true
ignore_words_list: aks,ags,startin
- skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*"
+ skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*,cert-manager.crds.yaml"
diff --git a/backup/pvc/bin/get-latest.sh b/backup/pvc/bin/get-latest.sh
index 5deba063..519a4c6e 100644
--- a/backup/pvc/bin/get-latest.sh
+++ b/backup/pvc/bin/get-latest.sh
@@ -3,8 +3,8 @@
set -eo pipefail
[[ -z "${BACKUP_DIR}" ]] && echo "Required 'BACKUP_DIR' env not set" && exit 1
-
-latest=$(find ${BACKUP_DIR} -name '*.tar.zstd' -exec basename {} \; | sort -g | tail -n 1)
+# Search for all the tar.* inside the backup dir to support the migration between gzip vs zstd
+latest=$(find ${BACKUP_DIR} -name '*.tar.*' -exec basename {} \; | sort -g | tail -n 1)
if [[ "${latest}" == "" ]]; then
echo "-1"
From c2c249aa48f7ea7bb4467409c0e20f94b4080880 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Sun, 25 Jun 2023 15:59:05 +0200
Subject: [PATCH 16/40] fix(ci): remove sembump (#859)
---
.github/workflows/release-backup.yaml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 983efc70..2e5dc9d6 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -40,7 +40,10 @@ jobs:
- name: Bump the version
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
shell: bash
- run: make -C backup/pvc sembump && make -C backup/pvc bump-version
+ run: |
+ make -C backup/pvc sembump
+ make -C backup/pvc bump-version
+ rm backup/pvc/bin/sembump
- name: Login to Quay.io
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
@@ -54,6 +57,5 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
- rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
From 97892a4cbd5ea9425ddab40b10a7672105f320fc Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Sun, 25 Jun 2023 21:34:27 +0200
Subject: [PATCH 17/40] wip feat(ci): Auto update k8s manifests, chart: add
operator live/readiness probe (#860)
---
.github/stale.yml | 47 ----------------
.../workflows/auto-generate-manifests.yaml | 55 +++++++++++++++++++
.../jenkins-operator/templates/operator.yaml | 16 +++++-
3 files changed, 69 insertions(+), 49 deletions(-)
delete mode 100644 .github/stale.yml
create mode 100644 .github/workflows/auto-generate-manifests.yaml
diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644
index 30867b8b..00000000
--- a/.github/stale.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-# Configuration for probot-stale - https://github.com/probot/stale
-
-# Number of days of inactivity before an issue becomes stale
-daysUntilStale: 30
-
-# Number of days of inactivity before a stale Issue or Pull Request is closed.
-# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
-daysUntilClose: 30
-
-# Issues with these labels will never be considered stale
-exemptLabels:
- - frozen
-
-# Set to true to ignore issues in a milestone (defaults to false)
-exemptMilestones: true
-
-# Label to use when marking an issue as stale
-staleLabel: stale
-
-issues:
- # Comment to post when marking an issue as stale. Set to `false` to disable
- markComment: >
- This issue has been automatically marked as stale because it has not had recent activity.
- It will be closed if no further activity occurs.
- If this issue is still affecting you, just comment with any updates and we'll keep it open.
- Thank you for your contributions.
-
- # Comment to post when closing a stale issue. Set to `false` to disable
- closeComment: >
- Closing this issue after a prolonged period of inactivity.
- If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!
-
-pulls:
- # Comment to post when marking a pull request as stale.
- markComment: >
- This pull request has been automatically marked as stale because it has not had recent activity.
- It will be closed if no further activity occurs.
- If this pull request is still relevant, just comment with any updates and we'll keep it open.
- Thank you for your contributions.
-
- # Comment to post when closing a stale pull request. Set to `false` to disable
- closeComment: >
- Closing this pull request after a prolonged period of inactivity.
- If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!
-
-# Limit the number of actions per hour, from 1-30. Default is 30
-limitPerRun: 30
diff --git a/.github/workflows/auto-generate-manifests.yaml b/.github/workflows/auto-generate-manifests.yaml
new file mode 100644
index 00000000..10b6d398
--- /dev/null
+++ b/.github/workflows/auto-generate-manifests.yaml
@@ -0,0 +1,55 @@
+name: Update k8s manifests
+on:
+ push:
+ branches:
+ - master
+ - main
+ paths-ignore:
+ - 'docs/**'
+ - 'website/**'
+ - 'assets/**'
+ - 'backup/**'
+ - '*.md'
+ workflow_dispatch:
+ release:
+ types: [published]
+
+jobs:
+ update-manifest:
+ name: Update k8s manifests
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v3
+
+ - name: Set up env vars
+ run: |
+ echo "HELM_VERSION=v$(sed -n 's/HELM_VERSION=//p' config.base.env)" >> $GITHUB_ENV
+
+ - name: Helm lint
+ run: make helm-lint
+
+ #TODO: add also the webhook part and understand if is necessary
+ - name: Helm update plain manifests
+ run: |
+ helm template --set fullnameOverride=jenkins-operator \
+ --set jenkins.enabled=false \
+ --set jenkins.backup.enabled=false \
+ --set jenkins.backup.pvc.enabled=false \
+ --set operator.resources.limits.cpu=100m \
+ --set operator.resources.limits.memory=120Mi \
+ --set operator.resources.requests.cpu=100m \
+ --set operator.resources.requests.memory=120Mi \
+ chart/jenkins-operator/ > deploy/all-in-one-v1alpha2.yaml
+ sed -i '/namespace: default/d' deploy/all-in-one-v1alpha2.yaml
+
+ cp chart/jenkins-operator/crds/jenkins-crd.yaml deploy/crds/jenkins.io_jenkins_crd.yaml
+
+ - name: Create Pull Request
+ uses: peter-evans/create-pull-request@v5
+ with:
+ commit-message: Auto-updated Kubernetes Manifests
+ branch: manifest-deploy-update
+ title: Auto-updated Kubernetes Manifests
+ body: |
+ Auto-updated Kubernetes Manifests from master commit ${{ github.sha }}
diff --git a/chart/jenkins-operator/templates/operator.yaml b/chart/jenkins-operator/templates/operator.yaml
index 82e8e6c7..b98e4249 100644
--- a/chart/jenkins-operator/templates/operator.yaml
+++ b/chart/jenkins-operator/templates/operator.yaml
@@ -31,7 +31,7 @@ spec:
protocol: TCP
command:
- /manager
- args:
+ args:
{{- if .Values.webhook.enabled }}
- --validate-security-warnings
{{- end }}
@@ -41,6 +41,18 @@ spec:
name: webhook-certs
readOnly: true
{{- end }}
+ livenessProbe:
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ readinessProbe:
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
env:
- name: WATCH_NAMESPACE
value: {{ .Values.jenkins.namespace }}
@@ -71,4 +83,4 @@ spec:
defaultMode: 420
secretName: jenkins-{{ .Values.webhook.certificate.name }}
terminationGracePeriodSeconds: 10
- {{- end }}
\ No newline at end of file
+ {{- end }}
From 0abc758dc314abb509fa86ff1b74021cfa025b02 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Mon, 26 Jun 2023 12:43:24 +0200
Subject: [PATCH 18/40] chore: several minor updates, bump helm, base-plugins
and backup base img (#865)
---
.github/workflows/release-backup.yaml | 2 +-
backup/pvc/Dockerfile | 8 ++++----
backup/pvc/Makefile | 1 -
backup/pvc/VERSION.txt | 2 +-
config.base.env | 2 +-
pkg/plugins/base_plugins.go | 6 +++---
test/e2e/configuration_test.go | 6 +++---
7 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 2e5dc9d6..9e2a7ba4 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -43,7 +43,6 @@ jobs:
run: |
make -C backup/pvc sembump
make -C backup/pvc bump-version
- rm backup/pvc/bin/sembump
- name: Login to Quay.io
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
@@ -57,5 +56,6 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
+ rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
diff --git a/backup/pvc/Dockerfile b/backup/pvc/Dockerfile
index 3b283e16..ecc42591 100644
--- a/backup/pvc/Dockerfile
+++ b/backup/pvc/Dockerfile
@@ -1,4 +1,4 @@
-FROM debian:bullseye-slim
+FROM debian:bookworm-slim
LABEL maintainer="Jenkins Kubernetes Operator Community" \
org.opencontainers.image.authors="Jenkins Kubernetes Operator Community" \
@@ -6,7 +6,7 @@ LABEL maintainer="Jenkins Kubernetes Operator Community" \
org.opencontainers.image.description="Jenkins Operator Backup img via pvc volume" \
org.opencontainers.image.url="quay.io/jenkins-kubernetes-operator/backup-pvc" \
org.opencontainers.image.source="https://github.com/jenkinsci/kubernetes-operator/tree/master/backup/pvc" \
- org.opencontainers.image.base.name="debian:bullseye-slim"
+ org.opencontainers.image.base.name="debian:bookworm-slim"
ARG UID
ARG GID
@@ -24,9 +24,9 @@ RUN apt update \
--uid "$UID" \
"$USER"
+COPY bin/*.sh /home/user/bin/
+RUN chmod +x /home/user/bin/*.sh
WORKDIR /home/user/bin
-COPY bin .
-RUN chmod +x *.sh
USER user
CMD ./run.sh
diff --git a/backup/pvc/Makefile b/backup/pvc/Makefile
index 3587d57d..d8ec544f 100644
--- a/backup/pvc/Makefile
+++ b/backup/pvc/Makefile
@@ -151,7 +151,6 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat
echo $(NEW_VERSION) > VERSION.txt
git add VERSION.txt
git commit -avm "Bump backup PVC version to $(NEW_VERSION)"
- rm $(PROJECT_DIR)/bin/sembump
.PHONY: tag
tag: ## Create a new git tag to prepare to build a release
diff --git a/backup/pvc/VERSION.txt b/backup/pvc/VERSION.txt
index f82e0685..b88fb90f 100644
--- a/backup/pvc/VERSION.txt
+++ b/backup/pvc/VERSION.txt
@@ -1 +1 @@
-v0.2.4
+v0.2.5
diff --git a/config.base.env b/config.base.env
index 9c4ef8a3..600d7fb9 100644
--- a/config.base.env
+++ b/config.base.env
@@ -11,7 +11,7 @@ API_VERSION_NEXT=v1alpha3
ALL_IN_ONE_DEPLOY_FILE_PREFIX=all-in-one
GEN_CRD_API=gen-crd-api-reference-docs
IMAGE_PULL_MODE=local
-HELM_VERSION=3.1.2
+HELM_VERSION=3.12.1
CLUSTER_DOMAIN=cluster.local
LATEST_LTS_VERSION=2.401.1
KIND_CLUSTER_NAME=jenkins
diff --git a/pkg/plugins/base_plugins.go b/pkg/plugins/base_plugins.go
index c5247163..4961a937 100644
--- a/pkg/plugins/base_plugins.go
+++ b/pkg/plugins/base_plugins.go
@@ -2,10 +2,10 @@ package plugins
const (
configurationAsCodePlugin = "configuration-as-code:1647.ve39ca_b_829b_42"
- gitPlugin = "git:5.0.2"
+ gitPlugin = "git:5.1.0"
jobDslPlugin = "job-dsl:1.84"
- kubernetesPlugin = "kubernetes:3937.vd7b_82db_e347b_"
- kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c"
+ kubernetesPlugin = "kubernetes:3952.v88e3b_0cf300b_"
+ kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.225.v14f9e6b_28f53"
workflowAggregatorPlugin = "workflow-aggregator:596.v8c21c963d92d"
workflowJobPlugin = "workflow-job:1308.v58d48a_763b_31"
)
diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go
index 51f1904a..1a924c87 100644
--- a/test/e2e/configuration_test.go
+++ b/test/e2e/configuration_test.go
@@ -25,9 +25,9 @@ const e2e = "e2e"
var expectedBasePluginsList = []plugins.Plugin{
plugins.Must(plugins.New("configuration-as-code:1647.ve39ca_b_829b_42")),
- plugins.Must(plugins.New("git:5.0.2")),
- plugins.Must(plugins.New("kubernetes:3937.vd7b_82db_e347b_")),
- plugins.Must(plugins.New("kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c")),
+ plugins.Must(plugins.New("git:5.1.0")),
+ plugins.Must(plugins.New("kubernetes:3952.v88e3b_0cf300b_")),
+ plugins.Must(plugins.New("kubernetes-credentials-provider:1.225.v14f9e6b_28f53")),
plugins.Must(plugins.New("job-dsl:1.84")),
plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")),
plugins.Must(plugins.New("workflow-job:1308.v58d48a_763b_31")),
From 5ddcf1075d6933d9cda0c339ee81df91018cb546 Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Tue, 27 Jun 2023 09:37:31 +0200
Subject: [PATCH 19/40] fix: latestplugin always true, add more complex bats
tests, update devcontainers and make manifests (#857)
---
.devcontainer/devcontainer.json | 2 +-
.github/workflows/release-backup.yaml | 1 -
Makefile | 1 +
api/v1alpha2/jenkins_types.go | 3 +-
api/v1alpha2/zz_generated.deepcopy.go | 4 +-
chart/jenkins-operator/crds/jenkins-crd.yaml | 23 ++---
config/crd/bases/jenkins.io_jenkins.yaml | 23 ++---
config/rbac/role.yaml | 5 +-
.../base/resources/scripts_configmap.go | 10 +--
pkg/constants/constants.go | 2 +-
test/bats/1-deploy.bats | 15 ++++
test/bats/2-deploy-with-more-options.bats | 88 +++++++++++++++++++
test/helm/helm_test.go | 1 +
13 files changed, 142 insertions(+), 36 deletions(-)
create mode 100644 test/bats/2-deploy-with-more-options.bats
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index c726b0b5..31270ced 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -3,7 +3,7 @@
{
"name": "Kubernetes - Minikube-in-Docker",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
- "image": "mcr.microsoft.com/devcontainers/base:bullseye",
+ "image": "mcr.microsoft.com/devcontainers/base:bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml
index 9e2a7ba4..337c263d 100644
--- a/.github/workflows/release-backup.yaml
+++ b/.github/workflows/release-backup.yaml
@@ -56,6 +56,5 @@ jobs:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
run: |
git reset --hard
- rm bin/sembump
make -C backup/pvc docker-build
make -C backup/pvc docker-release
diff --git a/Makefile b/Makefile
index 744d10c0..4d6c6648 100644
--- a/Makefile
+++ b/Makefile
@@ -146,6 +146,7 @@ update-lts-version: ## Update the latest lts version
sed -i 's|jenkins/jenkins:[0-9]\+.[0-9]\+.[0-9]\+|jenkins/jenkins:$(LATEST_LTS_VERSION)|g' chart/jenkins-operator/values.yaml
sed -i 's|jenkins/jenkins:[0-9]\+.[0-9]\+.[0-9]\+|jenkins/jenkins:$(LATEST_LTS_VERSION)|g' test/e2e/test_utility.go
sed -i 's|jenkins/jenkins:[0-9]\+.[0-9]\+.[0-9]\+|jenkins/jenkins:$(LATEST_LTS_VERSION)|g' test/helm/helm_test.go
+ sed -i 's|jenkins/jenkins:[0-9]\+.[0-9]\+.[0-9]\+|jenkins/jenkins:$(LATEST_LTS_VERSION)|g' pkg/constants/constants.go
.PHONY: run
run: export WATCH_NAMESPACE = $(NAMESPACE)
diff --git a/api/v1alpha2/jenkins_types.go b/api/v1alpha2/jenkins_types.go
index 3e380c99..6064dccf 100644
--- a/api/v1alpha2/jenkins_types.go
+++ b/api/v1alpha2/jenkins_types.go
@@ -373,7 +373,8 @@ type JenkinsMaster struct {
// Allow to override jenkins-plugin-cli default behavior
// while downloading the plugin and dependencies
// see: https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options
- LatestPlugins bool `json:"latestPlugins"`
+ // +optional
+ LatestPlugins *bool `json:"latestPlugins,omitempty"`
// DisableCSRFProtection allows you to toggle CSRF Protection on Jenkins
DisableCSRFProtection bool `json:"disableCSRFProtection"`
diff --git a/api/v1alpha2/zz_generated.deepcopy.go b/api/v1alpha2/zz_generated.deepcopy.go
index cfd1b305..35547563 100644
--- a/api/v1alpha2/zz_generated.deepcopy.go
+++ b/api/v1alpha2/zz_generated.deepcopy.go
@@ -23,7 +23,7 @@ package v1alpha2
import (
corev1 "k8s.io/api/core/v1"
- rbacv1 "k8s.io/api/rbac/v1"
+ "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -400,7 +400,7 @@ func (in *JenkinsSpec) DeepCopyInto(out *JenkinsSpec) {
in.ConfigurationAsCode.DeepCopyInto(&out.ConfigurationAsCode)
if in.Roles != nil {
in, out := &in.Roles, &out.Roles
- *out = make([]rbacv1.RoleRef, len(*in))
+ *out = make([]v1.RoleRef, len(*in))
copy(*out, *in)
}
in.ServiceAccount.DeepCopyInto(&out.ServiceAccount)
diff --git a/chart/jenkins-operator/crds/jenkins-crd.yaml b/chart/jenkins-operator/crds/jenkins-crd.yaml
index b00bb4f4..87d40704 100644
--- a/chart/jenkins-operator/crds/jenkins-crd.yaml
+++ b/chart/jenkins-operator/crds/jenkins-crd.yaml
@@ -157,11 +157,11 @@ spec:
type: object
basePlugins:
description: 'BasePlugins contains plugins required by operator
- Defaults to : - name: kubernetes version: "1.31.3" - name:
- workflow-job version: "1145.v7f2433caa07f" - name: workflow-aggregator version:
- "2.6" - name: git version: "4.11.3" - name: job-dsl version:
- "1.78.1" - name: configuration-as-code version: "1346.ve8cfa_3473c94" - name:
- kubernetes-credentials-provider version: "0.20"'
+ Defaults to : - name: configuration-as-code version: "1625.v27444588cc3d"
+ - name: git version: "5.0.0" - name: job-dsl version: "1.83"
+ - name: kubernetes version: "3909.v1f2c633e8590" - name: kubernetes-credentials-provider
+ version: "1.211.vc236a_f5a_2f3c" - name: workflow-aggregator
+ version: "596.v8c21c963d92d" - name: workflow-job version: "1289.vd1c337fd5354"'
items:
description: Plugin defines Jenkins plugin.
properties:
@@ -1100,11 +1100,6 @@ spec:
- resources
type: object
type: array
- latestPlugins:
- description: 'Allow to override jenkins-plugin-cli default behavior
- while downloading the plugin and dependencies, see:
- https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options'
- type: boolean
disableCSRFProtection:
description: DisableCSRFProtection allows you to toggle CSRF Protection
on Jenkins
@@ -1150,6 +1145,10 @@ spec:
selectors of replication controllers and services. More info:
http://kubernetes.io/docs/user-guide/labels'
type: object
+ latestPlugins:
+ description: 'Allow to override jenkins-plugin-cli default behavior
+ while downloading the plugin and dependencies see: https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options'
+ type: boolean
nodeSelector:
additionalProperties:
type: string
@@ -3124,8 +3123,10 @@ spec:
type: object
type: array
seedJobAgentImage:
+ description: SeedJobAgentImage defines the image that will be used
+ by the seed job agent. If not defined jenkins/inbound-agent:4.9-1
+ will be used.
type: string
- description: 'SeedJobAgentImage defines the image that will be used by the seed job agent. If not defined jenkins/inbound-agent:4.10-3 will be used.'
seedJobs:
description: 'SeedJobs defines list of Jenkins Seed Job configurations
More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration#configure-seed-jobs-and-pipelines'
diff --git a/config/crd/bases/jenkins.io_jenkins.yaml b/config/crd/bases/jenkins.io_jenkins.yaml
index b00bb4f4..87d40704 100644
--- a/config/crd/bases/jenkins.io_jenkins.yaml
+++ b/config/crd/bases/jenkins.io_jenkins.yaml
@@ -157,11 +157,11 @@ spec:
type: object
basePlugins:
description: 'BasePlugins contains plugins required by operator
- Defaults to : - name: kubernetes version: "1.31.3" - name:
- workflow-job version: "1145.v7f2433caa07f" - name: workflow-aggregator version:
- "2.6" - name: git version: "4.11.3" - name: job-dsl version:
- "1.78.1" - name: configuration-as-code version: "1346.ve8cfa_3473c94" - name:
- kubernetes-credentials-provider version: "0.20"'
+ Defaults to : - name: configuration-as-code version: "1625.v27444588cc3d"
+ - name: git version: "5.0.0" - name: job-dsl version: "1.83"
+ - name: kubernetes version: "3909.v1f2c633e8590" - name: kubernetes-credentials-provider
+ version: "1.211.vc236a_f5a_2f3c" - name: workflow-aggregator
+ version: "596.v8c21c963d92d" - name: workflow-job version: "1289.vd1c337fd5354"'
items:
description: Plugin defines Jenkins plugin.
properties:
@@ -1100,11 +1100,6 @@ spec:
- resources
type: object
type: array
- latestPlugins:
- description: 'Allow to override jenkins-plugin-cli default behavior
- while downloading the plugin and dependencies, see:
- https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options'
- type: boolean
disableCSRFProtection:
description: DisableCSRFProtection allows you to toggle CSRF Protection
on Jenkins
@@ -1150,6 +1145,10 @@ spec:
selectors of replication controllers and services. More info:
http://kubernetes.io/docs/user-guide/labels'
type: object
+ latestPlugins:
+ description: 'Allow to override jenkins-plugin-cli default behavior
+ while downloading the plugin and dependencies see: https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options'
+ type: boolean
nodeSelector:
additionalProperties:
type: string
@@ -3124,8 +3123,10 @@ spec:
type: object
type: array
seedJobAgentImage:
+ description: SeedJobAgentImage defines the image that will be used
+ by the seed job agent. If not defined jenkins/inbound-agent:4.9-1
+ will be used.
type: string
- description: 'SeedJobAgentImage defines the image that will be used by the seed job agent. If not defined jenkins/inbound-agent:4.10-3 will be used.'
seedJobs:
description: 'SeedJobs defines list of Jenkins Seed Job configurations
More info: https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration#configure-seed-jobs-and-pipelines'
diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml
index dd2efda5..789349e9 100644
--- a/config/rbac/role.yaml
+++ b/config/rbac/role.yaml
@@ -1,9 +1,10 @@
---
apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
+kind: ClusterRole
metadata:
- name: jenkins-operator
+ creationTimestamp: null
+ name: manager-role
rules:
- apiGroups:
- apps
diff --git a/pkg/configuration/base/resources/scripts_configmap.go b/pkg/configuration/base/resources/scripts_configmap.go
index 732d656e..b60aa50b 100644
--- a/pkg/configuration/base/resources/scripts_configmap.go
+++ b/pkg/configuration/base/resources/scripts_configmap.go
@@ -68,13 +68,11 @@ func buildConfigMapTypeMeta() metav1.TypeMeta {
}
func buildInitBashScript(jenkins *v1alpha2.Jenkins) (*string, error) {
- defaultlatestPlugin := true
-
latestP := jenkins.Spec.Master.LatestPlugins
- if !latestP {
- latestP = defaultlatestPlugin
+ if latestP == nil {
+ latestP = new(bool)
+ *latestP = true
}
-
data := struct {
JenkinsHomePath string
InitConfigurationPath string
@@ -90,7 +88,7 @@ func buildInitBashScript(jenkins *v1alpha2.Jenkins) (*string, error) {
UserPlugins: jenkins.Spec.Master.Plugins,
InstallPluginsCommand: installPluginsCommand,
JenkinsScriptsVolumePath: JenkinsScriptsVolumePath,
- LatestPlugins: latestP,
+ LatestPlugins: *latestP,
}
output, err := render.Render(initBashTemplate, data)
diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go
index b2d795d8..49c23ac4 100644
--- a/pkg/constants/constants.go
+++ b/pkg/constants/constants.go
@@ -8,7 +8,7 @@ const (
// SeedJobSuffix is a suffix added for all seed jobs
SeedJobSuffix = "job-dsl-seed"
// DefaultJenkinsMasterImage is the default Jenkins master docker image
- DefaultJenkinsMasterImage = "jenkins/jenkins:2.319.3-lts"
+ DefaultJenkinsMasterImage = "jenkins/jenkins:2.401.1-lts"
// DefaultHTTPPortInt32 is the default Jenkins HTTP port
DefaultHTTPPortInt32 = int32(8080)
// DefaultSlavePortInt32 is the default Jenkins port for slaves
diff --git a/test/bats/1-deploy.bats b/test/bats/1-deploy.bats
index 911d323e..2392293f 100644
--- a/test/bats/1-deploy.bats
+++ b/test/bats/1-deploy.bats
@@ -23,6 +23,8 @@ diag() {
--set jenkins.namespace=${DETIK_CLIENT_NAMESPACE} \
--set namespace=${DETIK_CLIENT_NAMESPACE} \
--set operator.image=${OPERATOR_IMAGE} \
+ --set jenkins.latestPlugins=true \
+ --set jenkins.backup.makeBackupBeforePodDeletion=false \
chart/jenkins-operator
assert_success
assert ${HELM} status default
@@ -98,6 +100,19 @@ diag() {
assert_success
}
+#bats test_tags=phase:helm
+@test "1.9 Helm: check Jenkins crd" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+ run verify "there is 1 crd named 'jenkins.jenkins.io'"
+ assert_success
+}
+
@test "1.9 Helm: Clean" {
+ run ${HELM} uninstall default
+ assert_success
+ # Wait for the complete removal
+ sleep 30
+ run verify "there is 0 pvc named 'jenkins backup'"
+ assert_success
rm "chart/jenkins-operator/deploy.tmp"
}
diff --git a/test/bats/2-deploy-with-more-options.bats b/test/bats/2-deploy-with-more-options.bats
new file mode 100644
index 00000000..a39c9ea0
--- /dev/null
+++ b/test/bats/2-deploy-with-more-options.bats
@@ -0,0 +1,88 @@
+setup() {
+ load 'test_helper'
+ _common_setup
+}
+
+#bats test_tags=phase:helm
+@test "2.1 Install helm chart with options" {
+ run ${HELM} dependency update chart/jenkins-operator
+ assert_success
+ run ${KUBECTL} label node jenkins-control-plane batstest=yep
+ ${HELM} status options && skip "Helm release 'options' already exists"
+ run ${HELM} install options \
+ --set jenkins.namespace=${DETIK_CLIENT_NAMESPACE} \
+ --set namespace=${DETIK_CLIENT_NAMESPACE} \
+ --set operator.image=${OPERATOR_IMAGE} \
+ --set jenkins.latestPlugins=true \
+ --set jenkins.nodeSelector.batstest=yep \
+ --set jenkins.backup.makeBackupBeforePodDeletion=false \
+ chart/jenkins-operator
+ assert_success
+ assert ${HELM} status options
+ touch "chart/jenkins-operator/deploy.tmp"
+}
+
+#bats test_tags=phase:helm
+@test "2.2 Helm: check Jenkins operator pods status" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+
+ run verify "there is 1 deployment named 'options-jenkins-operator'"
+ assert_success
+
+ run verify "there is 1 pod named 'options-jenkins-operator-'"
+ assert_success
+
+ run try "at most 20 times every 10s to get pods named 'options-jenkins-operator-' and verify that '.status.containerStatuses[?(@.name==\"jenkins-operator\")].ready' is 'true'"
+ assert_success
+}
+
+#bats test_tags=phase:helm
+@test "2.3 Helm: check Jenkins Pod status" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+
+ run try "at most 20 times every 10s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
+ assert_success
+
+ run try "at most 20 times every 5s to get pods named 'jenkins-jenkins' and verify that '.status.containerStatuses[?(@.name==\"jenkins-master\")].ready' is 'true'"
+ assert_success
+}
+
+@test "2.4 check node selector" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+
+ NODENAME=$(${KUBECTL} get pod jenkins-jenkins -o jsonpath={.spec.nodeName})
+
+ run ${KUBECTL} get node -l batstest=yep -o name
+ assert_success
+ assert_output "node/$NODENAME"
+}
+
+@test "2.5 check jenkins-plugin-cli command" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+
+ run ${KUBECTL} logs -c jenkins-master jenkins-jenkins
+ assert_success
+ assert_output --partial 'jenkins-plugin-cli --verbose --latest true -f /var/lib/jenkins/base-plugins.txt'
+ assert_output --partial 'jenkins-plugin-cli --verbose --latest true -f /var/lib/jenkins/user-plugins.txt'
+}
+
+
+@test "2.7 check backup" {
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+ sleep 120
+ run ${KUBECTL} logs -l app.kubernetes.io/name=jenkins-operator --tail 10000
+ assert_success
+ assert_output --partial "Performing backup '1'"
+ assert_output --partial "Backup completed '1', updating status"
+}
+
+
+@test "2. Helm: Clean" {
+ skip
+ [[ ! -f "chart/jenkins-operator/deploy.tmp" ]] && skip "Jenkins helm chart have not been deployed correctly"
+
+ run ${HELM} uninstall options
+ assert_success
+
+ rm "chart/jenkins-operator/deploy.tmp"
+}
diff --git a/test/helm/helm_test.go b/test/helm/helm_test.go
index 58d2dfc9..98c76b94 100644
--- a/test/helm/helm_test.go
+++ b/test/helm/helm_test.go
@@ -127,6 +127,7 @@ var _ = Describe("Jenkins Controller with security validator", func() {
"--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name),
"--set-string", fmt.Sprintf("operator.image=%s", *imageName),
"--set", fmt.Sprintf("webhook.enabled=%t", true),
+ "--set", fmt.Sprintf("jenkins.latestPlugins=%t", true),
"--set", fmt.Sprintf("jenkins.enabled=%t", false), "--install")
output, err := cmd.CombinedOutput()
Expect(err).NotTo(HaveOccurred(), string(output))
From e79b06024ad95ab578159554b01ffee6ad3a646c Mon Sep 17 00:00:00 2001
From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com>
Date: Thu, 29 Jun 2023 09:05:29 +0200
Subject: [PATCH 20/40] chore: preparing v0.8.0-beta2 version bump (#866)
---
README.md | 2 +-
chart/jenkins-operator/README.md | 6 +++---
chart/jenkins-operator/values.yaml | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 382f4f40..e5419221 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Jenkins Operator
-[](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.7.1)
+[](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.8.0-beta2)
[](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests-e2e.yaml)
[](https://goreportcard.com/report/github.com/jenkinsci/kubernetes-operator)
[](https://gitter.im/jenkinsci/kubernetes-operator)
diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md
index 857b8b52..e550086c 100644
--- a/chart/jenkins-operator/README.md
+++ b/chart/jenkins-operator/README.md
@@ -28,7 +28,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.backup.env[2].name | string | `"BACKUP_COUNT"` | |
| jenkins.backup.env[2].value | string | `"3"` | |
| jenkins.backup.getLatestAction[0] | string | `"/home/user/bin/get-latest.sh"` | |
-| jenkins.backup.image | string | `"quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.1"` | |
+| jenkins.backup.image | string | `"quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.6"` | |
| jenkins.backup.interval | int | `30` | |
| jenkins.backup.makeBackupBeforePodDeletion | bool | `true` | |
| jenkins.backup.pvc.className | string | `""` | |
@@ -52,7 +52,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.enabled | bool | `true` | |
| jenkins.env | list | `[]` | |
| jenkins.hostAliases | object | `{}` | |
-| jenkins.image | string | `"jenkins/jenkins:2.387.3-lts"` | |
+| jenkins.image | string | `"jenkins/jenkins:2.401.1-lts"` | |
| jenkins.imagePullPolicy | string | `"Always"` | |
| jenkins.imagePullSecrets | list | `[]` | |
| jenkins.labels | object | `{}` | |
@@ -95,7 +95,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes
| jenkins.volumes[0].persistentVolumeClaim.claimName | string | `"jenkins-backup"` | |
| operator.affinity | object | `{}` | |
| operator.fullnameOverride | string | `""` | |
-| operator.image | string | `"quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta"` | |
+| operator.image | string | `"quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta2"` | |
| operator.imagePullPolicy | string | `"IfNotPresent"` | |
| operator.imagePullSecrets | list | `[]` | |
| operator.nameOverride | string | `""` | |
diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml
index d6415d75..58ceb661 100644
--- a/chart/jenkins-operator/values.yaml
+++ b/chart/jenkins-operator/values.yaml
@@ -210,7 +210,7 @@ jenkins:
# image used by backup feature
# By default using prebuilt backup PVC image
- image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.5
+ image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.6
# containerName is backup container name
containerName: backup
From 7233d82237504960b6915e8fd0a00f990ec78af4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Fri, 30 Jun 2023 23:24:08 +0200
Subject: [PATCH 21/40] Release 0.8.0-beta.2 Helm Chart (#868)
Co-authored-by: brokenpip3
---
chart/index.yaml | 17 ++++++++++++++++-
chart/jenkins-operator/Chart.yaml | 4 ++--
.../jenkins-operator-0.8.0-beta.2.tgz | Bin 0 -> 332237 bytes
3 files changed, 18 insertions(+), 3 deletions(-)
create mode 100644 chart/jenkins-operator/jenkins-operator-0.8.0-beta.2.tgz
diff --git a/chart/index.yaml b/chart/index.yaml
index 8d08b0ef..74165d23 100644
--- a/chart/index.yaml
+++ b/chart/index.yaml
@@ -1,6 +1,21 @@
apiVersion: v1
entries:
jenkins-operator:
+ - apiVersion: v2
+ appVersion: 0.8.0-beta.2
+ created: "2023-06-30T21:22:53.308590035Z"
+ dependencies:
+ - condition: webhook.enabled
+ name: cert-manager
+ repository: https://charts.jetstack.io
+ version: 1.5.1
+ description: Kubernetes native operator which fully manages Jenkins on Kubernetes
+ digest: b2502f91dffa1136190a8a98d73ac997c70387e100d79200b7403039ca98411e
+ icon: https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/assets/jenkins-operator-icon.png
+ name: jenkins-operator
+ urls:
+ - https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart/jenkins-operator/jenkins-operator-0.8.0-beta.2.tgz
+ version: 0.8.0-beta.2
- apiVersion: v2
appVersion: v0.8.0-beta
created: "2023-04-17T22:11:04.706959723Z"
@@ -348,4 +363,4 @@ entries:
urls:
- https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart/jenkins-operator/jenkins-operator-0.0.1.tgz
version: 0.0.1
-generated: "2023-04-17T22:11:04.68789848Z"
+generated: "2023-06-30T21:22:53.286551756Z"
diff --git a/chart/jenkins-operator/Chart.yaml b/chart/jenkins-operator/Chart.yaml
index da113865..c0f605b1 100644
--- a/chart/jenkins-operator/Chart.yaml
+++ b/chart/jenkins-operator/Chart.yaml
@@ -1,8 +1,8 @@
apiVersion: v2
-appVersion: "v0.8.0-beta"
+appVersion: "0.8.0-beta.2"
description: Kubernetes native operator which fully manages Jenkins on Kubernetes
name: jenkins-operator
-version: v0.8.0-beta
+version: 0.8.0-beta.2
icon: https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/assets/jenkins-operator-icon.png
dependencies:
- name: cert-manager
diff --git a/chart/jenkins-operator/jenkins-operator-0.8.0-beta.2.tgz b/chart/jenkins-operator/jenkins-operator-0.8.0-beta.2.tgz
new file mode 100644
index 0000000000000000000000000000000000000000..fd4aca5f43bbceec972d8ab07245a10704ea89fe
GIT binary patch
literal 332237
zcmZU)1#BI`(j}ajV`gSwGh@t->6)*ZIc8?2nAtHiGcz;9%*@OjGyDE|Z@*u=s~u^i
zuIf_HXhy28b50jYBpl|K|6E|&FZ70zN-Rc_a$K?=Je)t-)mV&`IW4r5dAQ`&)VSo-
ztt}00jXhKp?F1xEtZlwre4M%xw$xKc%q;|ipG*@rFRCy~xvzfk
zTRME)ZGs+i;>1v3PWTQ)sM}W)qM)PVuYo%>xX$GL15w50)poaNqv+&t65p_$L9vE9
z&O$}In9+CKdZeoK5@3~$XpOytix~xMleO60Hv^GD4wA!6V=@^iDKXS~P5J5Q*vBjD
zqo4T`EI5F3!>RC{t~36#G3fw~G-piK@@>95Ae+$3bISxcHP}tN!f5ebh`V$WJfJ@8
z`zbW2oVBc--tHveb{b^w5b%tN@;gQzIb`7T`Q+qbm*$LQZ+Z9p#Gd2Nhx+jBE{@@f
z5I-?8%=6!81CCb+ln`SMe8bx_b8d3|D7^=X0%0=|^wDAfuQ1=hr~S-j&lR%X_B|~1
zhdOnrK9s~qL100kdf+m+!Oz)oX4~WS<-Sdz=|yPR0raef_3QA?&wYc0SoIiOQP7+#5
z5AX7e@+Ln}HUShn;yCAj2A>40h+H-I6QPdv-NTg<3yzmc=SN5etuWrVRck7769B<4
za<(B422@!b&8e7Tu^*atg1rvBg9AjH0zZq2RcRZ?$dtd+;-DdT*og$?juz7MsKl0j
zzlIIm5w!zSM?7yzfhgt{n~>TA(zXYP@f#2)HGr{lF{B=_Wa`IO=1uwWI&c7Cwtmg*
z)42FVNzFpRt$A)B#ZT1?zZ5$#WEYLkff(ro+Vrr|>u%8^l1p|zUG`pV>J5$FhP+fU
z_i$t2dj4W=V1HZW)F83MH;f{Gbi~8VmAd*tk(h=k17QV`tE^YRqVxJpBZ^O4ZQK&X`C%?xbInFmqS>NqR356VjWIVygEYKIePH
z-(<>3Oo4D{X6_3Aites9ATv~UW^R_o->ej1gmbK=OxGVn`xO$Xz-k7~@$t4q2Z(Vs
zJg!-0Nh+cFC`$HtNuC5n+EMP2Mh{_$(sQ=o`!d+`_GEbBR6zwQAGCNZll!Su7)gm4
zk60d{84K^Y+kzNCn>DRNz78vyH+!6Z!!eg)Uid6YacPD9fufQ+gb
zkYLvq=Nmky5ynev|6?SW;hPlQjznGcy%M&IoJ_j~a0HQ|R}XfPz&*g#Rb~A_$;s8{
z;m~9V>YMNtC$oerZ;T^;B$Hh1M2J$xbhRAj5^meC)I}*a>nTdP?IJ*1_FP@