Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variable to enable to specify the name of port in the service #801

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0d24d95
Add port name in the service
sonali-rajput Apr 4, 2023
67ecd35
Add default port name for service
sonali-rajput Apr 23, 2023
4dabb60
Update service for default port name
sonali-rajput May 4, 2023
9f82b5e
chore: update to 2.387.2-lts and base plugins (#811)
brokenpip3 Apr 13, 2023
5323e2b
chore: bump version to v0.8.0-beta (#814)
brokenpip3 Apr 17, 2023
196b165
Release v0.8.0-beta Helm Chart (#825)
github-actions[bot] Apr 17, 2023
5c95fa4
chore(doc): Update links in README (#829)
aj-robson Apr 27, 2023
4737e9c
chore: Update git ls-files cmd with missing arg (#832)
aj-robson May 5, 2023
2e50336
chore: update to latest lts, update plugins, remove devbots, add devc…
brokenpip3 May 8, 2023
55b7f0d
feat(repo): add stale bot (#836)
brokenpip3 May 8, 2023
1412754
feat: use zstd instead of gz by default, fix the backup script (#841)
brokenpip3 May 26, 2023
34566e3
Fix: add tollerations again (#842)
brokenpip3 May 30, 2023
e92f91e
feat: attempt to move restore before seed job creation (#844)
brokenpip3 Jun 4, 2023
89bebb0
chore: add v0.8.0 doc (#845)
brokenpip3 Jun 5, 2023
79ec248
fix: backup trimming, only selecting zstd file (#846)
brokenpip3 Jun 5, 2023
7c949b9
Bump docker/login-action from 1 to 2 (#819)
dependabot[bot] Jun 5, 2023
9f04ae2
Bump actions/checkout from 2 to 3 (#815)
dependabot[bot] Jun 5, 2023
9936d50
Bump peter-evans/create-pull-request from 3 to 5 (#817)
dependabot[bot] Jun 5, 2023
363b277
fix hugo and backup version, fix backup ci (#847)
brokenpip3 Jun 5, 2023
9aa8642
fix: hugo and backup ci again (#848)
brokenpip3 Jun 5, 2023
8db6fd5
chore: prearing version bumpt to v0.8.0-beta2 (#849)
brokenpip3 Jun 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .devbots/needs-triage.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
21 changes: 21 additions & 0 deletions .github/workflows/auto-codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: codespell
on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v1
with:
check_filenames: true
ignore_words_list: aks,ags,startin
skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*"
6 changes: 3 additions & 3 deletions .github/workflows/auto-gen-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/auto-stale-issue.yaml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion .github/workflows/auto-tests-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-tests-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/release-helm-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Deploy Helm chart
run: |
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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), )
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Jenkins uses [plugins](https://plugins.jenkins.io/) like CasC to extend it's sol
- Integration with Kubernetes ([Jenkins kubernetes-plugin](https://github.com/jenkinsci/kubernetes-plugin))
- Pipelines as Code ([Jenkins pipelines](https://jenkins.io/doc/book/pipeline/))
- Extensibility via Groovy Scripts (similar to [Jenkins script console](https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console)) or ([configuration as code plugin](https://github.com/jenkinsci/configuration-as-code-plugin))
- Secure Defaults and Hardening (see [the security section](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/) of the documentation)
- Secure Defaults and Hardening (see [the security section](https://jenkinsci.github.io/kubernetes-operator/docs/security/) of the documentation)

## Problem statement and goals

Expand All @@ -38,7 +38,7 @@ We want to make Jenkins more robust, suitable for dynamic and multi-tenant envir
Some of the problems we want to solve:
- [installing plugins with incompatible versions or security vulnerabilities](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/customizing-jenkins/#install-plugins/)
- [better configuration as code](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/customizing-jenkins/)
- [security and hardening out of the box](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/)
- [security and hardening out of the box](https://jenkinsci.github.io/kubernetes-operator/docs/security/)
- [make errors more visible for end users](https://jenkinsci.github.io/kubernetes-operator/docs/troubleshooting/)
- orphaned jobs with no JNLP connection
- handle graceful shutdown properly
Expand All @@ -51,7 +51,7 @@ Go to [**our documentation website**](https://jenkinsci.github.io/kubernetes-ope
Selected content:
1. [How it works](https://jenkinsci.github.io/kubernetes-operator/docs/how-it-works/)
2. [Getting Started](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/)
3. [Security](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/)
3. [Security](https://jenkinsci.github.io/kubernetes-operator/docs/security/)
4. [Troubleshooting](https://jenkinsci.github.io/kubernetes-operator/docs/troubleshooting/)
5. [Developer Guide](https://jenkinsci.github.io/kubernetes-operator/docs/developer-guide/)
6. [FAQ](https://jenkinsci.github.io/kubernetes-operator/docs/faq/)
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.7.1
v0.8.0-beta2
18 changes: 11 additions & 7 deletions api/v1alpha2/jenkins_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,19 +351,19 @@ type JenkinsMaster struct {
// +optional
// Defaults to :
// - name: configuration-as-code
// version: "1346.ve8cfa_3473c94"
// version: "1625.v27444588cc3d"
// - name: git
// version: "4.11.3"
// version: "5.0.0"
// - name: job-dsl
// version: "1.78.1"
// version: "1.83"
// - name: kubernetes
// version: "1.31.3"
// version: "3909.v1f2c633e8590"
// - name: kubernetes-credentials-provider
// version: "0.20"
// version: "1.211.vc236a_f5a_2f3c"
// - name: workflow-aggregator
// version: "2.6"
// version: "596.v8c21c963d92d"
// - name: workflow-job
// version: "1145.v7f2433caa07f"
// version: "1289.vd1c337fd5354"
BasePlugins []Plugin `json:"basePlugins,omitempty"`

// Plugins contains plugins required by user
Expand Down Expand Up @@ -448,6 +448,10 @@ type Service struct {
// This field will be ignored if the cloud-provider does not support the feature.
// +optional
LoadBalancerIP string `json:"loadBalancerIP,omitempty"`

// The port name which is provided to the service.
// More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
Portname string `json:"Portname,omitempty"`
}

// JenkinsStatus defines the observed state of Jenkins
Expand Down
5 changes: 4 additions & 1 deletion backup/pvc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "" \
Expand Down
1 change: 1 addition & 0 deletions backup/pvc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backup/pvc/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.2.2
v0.2.4
24 changes: 17 additions & 7 deletions backup/pvc/bin/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,31 @@ 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"

# config.xml in a job directory is a config file that shouldnt be backed up
# config.xml in child directores is state that should. For example-
# config.xml in a job directory is a config file that shouldn't be backed up
# 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=$?

rm -rf "${BACKUP_TMP_DIR}"
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

[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.gz ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.gz' is empty" && exit 1;
rm -rf "${BACKUP_TMP_DIR}"
[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.zstd ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.zstd' is empty" && exit 1;

echo Done
exit 0
2 changes: 1 addition & 1 deletion backup/pvc/bin/get-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading