Bump version to v0.6.0

This commit is contained in:
Mateusz Korus 2021-06-09 10:05:18 +02:00
parent e762957cc1
commit fbea1ed790
26 changed files with 483 additions and 684 deletions

View File

@ -358,16 +358,18 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat
@echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)" @echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
echo $(NEW_VERSION) > VERSION.txt echo $(NEW_VERSION) > VERSION.txt
@echo "Updating version from $(VERSION) to $(NEW_VERSION) in README.md" @echo "Updating version from $(VERSION) to $(NEW_VERSION) in README.md"
sed -i s/$(VERSION)/$(NEW_VERSION)/g README.md sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' README.md
sed -i s/$(VERSION)/$(NEW_VERSION)/g deploy/operator.yaml sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' deploy/operator.yaml
sed -i s/$(VERSION)/$(NEW_VERSION)/g deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml sed -i.bak 's/$(VERSION)/$(NEW_VERSION)/g' deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
rm */**.bak
rm *.bak
cp config/service_account.yaml deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml cp config/service_account.yaml deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml cat config/rbac/leader_election_role.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/leader_election_role_binding.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)=$(API_VERSION).yaml cat config/rbac/leader_election_role_binding.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/role.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)=$(API_VERSION).yaml cat config/rbac/role.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/rbac/role_binding.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml cat config/rbac/role_binding.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
cat config/manager/manager.yaml >> config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml cat config/manager/manager.yaml >> deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
git add VERSION.txt README.md config/manager/manager.yaml config/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml git add VERSION.txt README.md config/manager/manager.yaml deploy/$(ALL_IN_ONE_DEPLOY_FILE_PREFIX)-$(API_VERSION).yaml
git commit -vaem "Bump version to $(NEW_VERSION)" git commit -vaem "Bump version to $(NEW_VERSION)"
@echo "Run make tag to create and push the tag for new version $(NEW_VERSION)" @echo "Run make tag to create and push the tag for new version $(NEW_VERSION)"
@ -439,18 +441,6 @@ generate-docs: hugo ## Re-generate docs directory from the website directory
cd website && npm install cd website && npm install
$(HUGO_PATH)/hugo -s website -d ../docs $(HUGO_PATH)/hugo -s website -d ../docs
.PHONY: all-in-one-build
FILENAME := config/all_in_one_$(API_VERSION).yaml
all-in-one-build: ## Re-generate all-in-one yaml
@echo "+ $@"
> $(FILENAME)
cat config/service_account.yaml >> $(FILENAME)
cat config/rbac/leader_election_role.yaml >> $(FILENAME)
cat config/rbac/leader_election_role_binding.yaml >> $(FILENAME)
cat config/rbac/role.yaml >> $(FILENAME)
cat config/rbac/role_binding.yaml >> $(FILENAME)
cat config/manager/manager.yaml >> $(FILENAME)
##################### FROM OPERATOR SDK ######################## ##################### FROM OPERATOR SDK ########################
# Install CRDs into a cluster # Install CRDs into a cluster
install-crds: manifests kustomize install-crds: manifests kustomize
@ -470,7 +460,7 @@ undeploy:
$(KUSTOMIZE) build config/default | kubectl delete -f - $(KUSTOMIZE) build config/default | kubectl delete -f -
# Generate manifests e.g. CRD, RBAC etc. # Generate manifests e.g. CRD, RBAC etc.
manifests: controller-gen all-in-one-build manifests: controller-gen
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases $(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
# Generate code # Generate code

View File

@ -1,6 +1,6 @@
# Jenkins Operator # Jenkins Operator
[![Version](https://img.shields.io/badge/version-v0.5.0-brightgreen.svg)](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.5.0) [![Version](https://img.shields.io/badge/version-v0.6.0-brightgreen.svg)](https://github.com/jenkinsci/kubernetes-operator/releases/tag/v0.6.0)
[![Build status](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml/badge.svg)](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml) [![Build status](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml/badge.svg)](https://github.com/jenkinsci/kubernetes-operator/actions/workflows/auto-tests.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/jenkinsci/kubernetes-operator "Go Report Card")](https://goreportcard.com/report/github.com/jenkinsci/kubernetes-operator) [![Go Report Card](https://goreportcard.com/badge/github.com/jenkinsci/kubernetes-operator "Go Report Card")](https://goreportcard.com/report/github.com/jenkinsci/kubernetes-operator)
[![Docker Pulls](https://img.shields.io/docker/pulls/virtuslab/jenkins-operator.svg)](https://hub.docker.com/r/virtuslab/jenkins-operator/tags) [![Docker Pulls](https://img.shields.io/docker/pulls/virtuslab/jenkins-operator.svg)](https://hub.docker.com/r/virtuslab/jenkins-operator/tags)

View File

@ -1 +1 @@
v0.5.0 v0.6.0

View File

@ -343,13 +343,13 @@ type JenkinsMaster struct {
// +optional // +optional
// Defaults to : // Defaults to :
// - name: kubernetes // - name: kubernetes
// version: "1.29.4" // version: "1.29.6"
// - name: workflow-job // - name: workflow-job
// version: "2.40" // version: "2.41"
// - name: workflow-aggregator // - name: workflow-aggregator
// version: "2.6" // version: "2.6"
// - name: git // - name: git
// version: "4.6.0" // version: "4.7.2"
// - name: job-dsl // - name: job-dsl
// version: "1.77" // version: "1.77"
// - name: configuration-as-code // - name: configuration-as-code

View File

@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.4.1 controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: jenkins.jenkins.io name: jenkins.jenkins.io
spec: spec:
group: jenkins.io group: jenkins.io
@ -157,9 +156,9 @@ spec:
type: object type: object
basePlugins: basePlugins:
description: 'BasePlugins contains plugins required by operator description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: "1.29.4" - name: workflow-job Defaults to : - name: kubernetes version: "1.29.6" - name: workflow-job
version: "2.40" - name: workflow-aggregator version: "2.6" - version: "2.41" - name: workflow-aggregator version: "2.6" -
name: git version: "4.6.0" - name: job-dsl version: "1.77" - name: git version: "4.7.2" - name: job-dsl version: "1.77" -
name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider
version: "0.18-1"' version: "0.18-1"'
items: items:

View File

@ -63,34 +63,20 @@ jenkins:
# #
# basePlugins: # basePlugins:
# - name: kubernetes # - name: kubernetes
# version: 1.29.4 # version: 1.29.6
# - name: workflow-job # - name: workflow-job
# version: "2.40" # version: "2.41"
# - name: workflow-aggregator # - name: workflow-aggregator
# version: "2.6" # version: "2.6"
# - name: git # - name: git
# version: 4.6.0 # version: 4.7.2
# - name: job-dsl # - name: job-dsl
# version: "1.77" # version: "1.77"
# - name: configuration-as-code # - name: configuration-as-code
# version: "1.51" # version: "1.51"
# - name: kubernetes-credentials-provider # - name: kubernetes-credentials-provider
# version: 0.18-1 # version: 0.18-1
basePlugins: basePlugins: []
- name: kubernetes
version: "1.29.4"
- name: workflow-job
version: "2.40"
- name: workflow-aggregator
version: "2.6"
- name: git
version: "4.6.0"
- name: job-dsl
version: "1.77"
- name: configuration-as-code
version: "1.51"
- name: kubernetes-credentials-provider
version: "0.18-1"
# plugins are plugins required by the user # plugins are plugins required by the user
# You can define plugins here # You can define plugins here

View File

@ -1,284 +0,0 @@
---
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:
creationTimestamp: null
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:
- jenkins/finalizers
verbs:
- update
- apiGroups:
- jenkins.io
resources:
- jenkins/status
verbs:
- get
- patch
- update
- apiGroups:
- jenkins.io
resources:
- '*'
verbs:
- '*'
- 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
- apiGroups:
- "image.openshift.io"
resources:
- imagestreams
verbs:
- get
- list
- watch
- apiGroups:
- "build.openshift.io"
resources:
- builds
- buildconfigs
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: jenkins-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jenkins-operator
subjects:
- kind: ServiceAccount
name: jenkins-operator
---
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.5.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

View File

@ -5,7 +5,6 @@ kind: CustomResourceDefinition
metadata: metadata:
annotations: annotations:
controller-gen.kubebuilder.io/version: v0.4.1 controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: jenkins.jenkins.io name: jenkins.jenkins.io
spec: spec:
group: jenkins.io group: jenkins.io
@ -157,9 +156,9 @@ spec:
type: object type: object
basePlugins: basePlugins:
description: 'BasePlugins contains plugins required by operator description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: "1.29.4" - name: workflow-job Defaults to : - name: kubernetes version: "1.29.6" - name: workflow-job
version: "2.40" - name: workflow-aggregator version: "2.6" - version: "2.41" - name: workflow-aggregator version: "2.6" -
name: git version: "4.6.0" - name: job-dsl version: "1.77" - name: git version: "4.7.2" - name: job-dsl version: "1.77" -
name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider name: configuration-as-code version: "1.51" - name: kubernetes-credentials-provider
version: "0.18-1"' version: "0.18-1"'
items: items:

View File

@ -9,5 +9,4 @@ roleRef:
name: leader-election-role name: leader-election-role
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: default name: jenkins-operator
namespace: default

View File

@ -3,170 +3,164 @@
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
creationTimestamp: null
name: jenkins-operator name: jenkins-operator
rules: rules:
- apiGroups: - apiGroups:
- apps - apps
resources: resources:
- daemonsets - daemonsets
- deployments - deployments
- replicasets - replicasets
- statefulsets - statefulsets
verbs: verbs:
- '*' - '*'
- apiGroups: - apiGroups:
- apps - apps
- jenkins-operator - jenkins-operator
resources: resources:
- deployments/finalizers - deployments/finalizers
verbs: verbs:
- update - update
- apiGroups: - apiGroups:
- build.openshift.io - build.openshift.io
resources: resources:
- buildconfigs - buildconfigs
- builds - builds
verbs: verbs:
- get - get
- list - list
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- configmaps - configmaps
- secrets - secrets
- services - services
verbs: verbs:
- create - create
- get - get
- list - list
- update - update
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- events - events
verbs: verbs:
- create - create
- get - get
- list - list
- patch - patch
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- persistentvolumeclaims - persistentvolumeclaims
verbs: verbs:
- get - get
- list - list
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods - pods
verbs: verbs:
- create - create
- delete - delete
- get - get
- list - list
- patch - patch
- update - update
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods - pods
- pods/exec - pods/exec
verbs: verbs:
- '*' - '*'
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods/log - pods/log
verbs: verbs:
- get - get
- list - list
- watch - watch
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- pods/portforward - pods/portforward
verbs: verbs:
- create - create
- apiGroups: - apiGroups:
- "" - ""
resources: resources:
- serviceaccounts - serviceaccounts
verbs: verbs:
- create - create
- get - get
- list - list
- update - update
- watch - watch
- apiGroups: - apiGroups:
- image.openshift.io - image.openshift.io
resources: resources:
- imagestreams - imagestreams
verbs: verbs:
- get - get
- list - list
- watch - watch
- apiGroups: - apiGroups:
- jenkins.io - jenkins.io
resources: resources:
- jenkins/finalizers - '*'
verbs: verbs:
- update - '*'
- apiGroups: - apiGroups:
- jenkins.io - jenkins.io
resources: resources:
- jenkins/status - jenkins
verbs: verbs:
- get - create
- patch - delete
- update - get
- apiGroups: - list
- jenkins.io - patch
resources: - update
- '*' - watch
verbs: - apiGroups:
- '*' - jenkins.io
- apiGroups: resources:
- rbac.authorization.k8s.io - jenkins/finalizers
resources: verbs:
- rolebindings - update
- roles - apiGroups:
verbs: - jenkins.io
- create resources:
- get - jenkins/status
- list verbs:
- update - get
- watch - patch
- apiGroups: - update
- "route.openshift.io" - apiGroups:
resources: - rbac.authorization.k8s.io
- routes resources:
verbs: - rolebindings
- create - roles
- get verbs:
- list - create
- update - get
- watch - list
- apiGroups: - update
- "image.openshift.io" - watch
resources: - apiGroups:
- imagestreams - route.openshift.io
verbs: resources:
- get - routes
- list verbs:
- watch - create
- apiGroups: - get
- "build.openshift.io" - list
resources: - update
- builds - watch
- buildconfigs
verbs:
- get
- list
- watch

View File

@ -3,4 +3,3 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: jenkins-operator name: jenkins-operator
namespace: default

View File

@ -4,165 +4,275 @@ kind: ServiceAccount
metadata: metadata:
name: jenkins-operator name: jenkins-operator
--- ---
kind: Role # permissions to do leader election.
apiVersion: rbac.authorization.k8s.io/v1 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: metadata:
name: jenkins-operator name: jenkins-operator
rules: rules:
- apiGroups: - apiGroups:
- "" - apps
resources: resources:
- services - daemonsets
- configmaps - deployments
- secrets - replicasets
- serviceaccounts - statefulsets
verbs: verbs:
- get - '*'
- create - apiGroups:
- update - apps
- list - jenkins-operator
- watch resources:
- apiGroups: - deployments/finalizers
- apps verbs:
resources: - update
- deployments - apiGroups:
- daemonsets - build.openshift.io
- replicasets resources:
- statefulsets - buildconfigs
verbs: - builds
- '*' verbs:
- apiGroups: - get
- rbac.authorization.k8s.io - list
resources: - watch
- roles - apiGroups:
- rolebindings - ""
verbs: resources:
- create - configmaps
- update - secrets
- list - services
- watch verbs:
- apiGroups: - create
- "" - get
resources: - list
- pods/portforward - update
verbs: - watch
- create - apiGroups:
- apiGroups: - ""
- "" resources:
resources: - events
- pods/log verbs:
verbs: - create
- get - get
- list - list
- watch - patch
- apiGroups: - watch
- "" - apiGroups:
resources: - ""
- pods resources:
- pods/exec - persistentvolumeclaims
verbs: verbs:
- "*" - get
- apiGroups: - list
- "" - watch
resources: - apiGroups:
- events - ""
verbs: resources:
- watch - pods
- list verbs:
- create - create
- patch - delete
- apiGroups: - get
- apps - list
resourceNames: - patch
- jenkins-operator - update
resources: - watch
- deployments/finalizers - apiGroups:
verbs: - ""
- update resources:
- apiGroups: - pods
- jenkins.io - pods/exec
resources: verbs:
- '*' - '*'
verbs: - apiGroups:
- '*' - ""
- apiGroups: resources:
- "" - pods/log
resources: verbs:
- persistentvolumeclaims - get
verbs: - list
- get - watch
- list - apiGroups:
- watch - ""
- apiGroups: resources:
- "route.openshift.io" - pods/portforward
resources: verbs:
- routes - create
verbs: - apiGroups:
- get - ""
- list resources:
- watch - serviceaccounts
- create verbs:
- update - create
- apiGroups: - get
- "image.openshift.io" - list
resources: - update
- imagestreams - watch
verbs: - apiGroups:
- get - image.openshift.io
- list resources:
- watch - imagestreams
- apiGroups: verbs:
- "build.openshift.io" - get
resources: - list
- builds - watch
- buildconfigs - apiGroups:
verbs: - jenkins.io
- get resources:
- list - '*'
- watch 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
--- ---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: metadata:
name: manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jenkins-operator name: jenkins-operator
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: jenkins-operator name: jenkins-operator
roleRef:
kind: Role
name: jenkins-operator
apiGroup: rbac.authorization.k8s.io
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: jenkins-operator name: jenkins-operator
labels:
control-plane: controller-manager
spec: spec:
replicas: 1
selector: selector:
matchLabels: matchLabels:
name: jenkins-operator control-plane: controller-manager
replicas: 1
template: template:
metadata: metadata:
labels: labels:
name: jenkins-operator control-plane: controller-manager
spec: spec:
serviceAccountName: jenkins-operator serviceAccountName: jenkins-operator
securityContext:
runAsUser: 65532
containers: containers:
- name: jenkins-operator - command:
image: virtuslab/jenkins-operator:v0.5.0 - /manager
command: args:
- jenkins-operator - --leader-elect
args: [] image: virtuslab/jenkins-operator:v0.6.0
imagePullPolicy: IfNotPresent name: jenkins-operator
env: imagePullPolicy: IfNotPresent
- name: WATCH_NAMESPACE securityContext:
valueFrom: allowPrivilegeEscalation: false
fieldRef: livenessProbe:
fieldPath: metadata.namespace httpGet:
- name: POD_NAME path: /healthz
valueFrom: port: 8081
fieldRef: initialDelaySeconds: 15
fieldPath: metadata.name periodSeconds: 20
- name: OPERATOR_NAME readinessProbe:
value: "jenkins-operator" 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

View File

@ -151,9 +151,9 @@ spec:
type: object type: object
basePlugins: basePlugins:
description: 'BasePlugins contains plugins required by operator description: 'BasePlugins contains plugins required by operator
Defaults to : - name: kubernetes version: 1.29.4 - name: workflow-job Defaults to : - name: kubernetes version: 1.29.6 - name: workflow-job
version: "2.39" - name: workflow-aggregator version: "2.6" - name: version: "2.39" - name: workflow-aggregator version: "2.6" - name:
git version: 4.6.0 - name: job-dsl version: "1.74" - name: configuration-as-code git version: 4.7.2 - name: job-dsl version: "1.74" - name: configuration-as-code
version: "1.51" - name: kubernetes-credentials-provider version: 0.18-1' version: "1.51" - name: kubernetes-credentials-provider version: 0.18-1'
items: items:
description: Plugin defines Jenkins plugin description: Plugin defines Jenkins plugin

View File

@ -1,24 +0,0 @@
apiVersion: jenkins.io/v1alpha2
kind: JenkinsImage
metadata:
name: simple-jenkinsimage
spec:
image:
name: jenkins/jenkins
tag: 2.277.4-lts-alpine
plugins:
- name: kubernetes
version: "1.29.4"
- name: workflow-job
version: "2.40"
- name: workflow-aggregator
version: "2.6"
- name: git
version: "4.6.0"
- name: job-dsl
version: "1.77"
- name: configuration-as-code
version: "1.51"
- name: kubernetes-credentials-provider
version: "0.18-1"

View File

@ -16,7 +16,7 @@ spec:
serviceAccountName: jenkins-operator serviceAccountName: jenkins-operator
containers: containers:
- name: jenkins-operator - name: jenkins-operator
image: virtuslab/jenkins-operator:v0.5.0 image: virtuslab/jenkins-operator:v0.6.0
command: command:
- jenkins-operator - jenkins-operator
args: [] args: []

View File

@ -2,12 +2,12 @@ package plugins
const ( const (
configurationAsCodePlugin = "configuration-as-code:1.51" configurationAsCodePlugin = "configuration-as-code:1.51"
gitPlugin = "git:4.6.0" gitPlugin = "git:4.7.2"
jobDslPlugin = "job-dsl:1.77" jobDslPlugin = "job-dsl:1.77"
kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:0.18-1" kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:0.18-1"
kubernetesPlugin = "kubernetes:1.29.4" kubernetesPlugin = "kubernetes:1.29.6"
workflowAggregatorPlugin = "workflow-aggregator:2.6" workflowAggregatorPlugin = "workflow-aggregator:2.6"
workflowJobPlugin = "workflow-job:2.40" workflowJobPlugin = "workflow-job:2.41"
) )
// basePluginsList contains plugins to install by operator. // basePluginsList contains plugins to install by operator.

View File

@ -129,6 +129,7 @@ var _ = Describe("Jenkins controller priority class", func() {
}) })
AfterEach(func() { AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace) DestroyNamespace(namespace)
}) })

View File

@ -39,6 +39,7 @@ var _ = Describe("Jenkins controller", func() {
}) })
AfterEach(func() { AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace) DestroyNamespace(namespace)
}) })

View File

@ -28,6 +28,7 @@ var _ = Describe("Jenkins controller backup and restore", func() {
}) })
AfterEach(func() { AfterEach(func() {
ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
DestroyNamespace(namespace) DestroyNamespace(namespace)
}) })

View File

@ -96,9 +96,9 @@ func createJenkinsCR(name, namespace string, seedJob *[]v1alpha2.SeedJob, groovy
}, },
InitialDelaySeconds: int32(80), InitialDelaySeconds: int32(80),
TimeoutSeconds: int32(4), TimeoutSeconds: int32(4),
FailureThreshold: int32(10), FailureThreshold: int32(30),
SuccessThreshold: int32(1), SuccessThreshold: int32(1),
PeriodSeconds: int32(1), PeriodSeconds: int32(5),
}, },
VolumeMounts: []corev1.VolumeMount{ VolumeMounts: []corev1.VolumeMount{
{ {

View File

@ -1,4 +1,4 @@
package helm package e2e
import ( import (
"bytes" "bytes"
@ -7,7 +7,6 @@ import (
"io" "io"
"sort" "sort"
"github.com/jenkinsci/kubernetes-operator/test/e2e"
"github.com/onsi/ginkgo" "github.com/onsi/ginkgo"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
@ -32,7 +31,7 @@ func getOperatorPod(namespace string) (*corev1.Pod, error) {
Namespace: namespace, Namespace: namespace,
} }
pods := &corev1.PodList{} pods := &corev1.PodList{}
err := e2e.K8sClient.List(context.TODO(), pods, lo) err := K8sClient.List(context.TODO(), pods, lo)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -47,7 +46,7 @@ func getOperatorLogs(namespace string) (string, error) {
logOptions := corev1.PodLogOptions{TailLines: &podLogTailLimit} logOptions := corev1.PodLogOptions{TailLines: &podLogTailLimit}
// creates the clientset // creates the clientset
clientset, err := kubernetes.NewForConfig(e2e.Cfg) clientset, err := kubernetes.NewForConfig(Cfg)
if err != nil { if err != nil {
return "", err return "", err
} }
@ -90,7 +89,7 @@ func getKubernetesEvents(namespace string) ([]v1beta1.Event, error) {
} }
events := &v1beta1.EventList{} events := &v1beta1.EventList{}
err := e2e.K8sClient.List(context.TODO(), events, listOptions) err := K8sClient.List(context.TODO(), events, listOptions)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -124,7 +123,7 @@ func printKubernetesPods(namespace string) {
} }
} }
func showLogsIfTestHasFailed(failed bool, namespace string) { func ShowLogsIfTestHasFailed(failed bool, namespace string) {
if failed { if failed {
_, _ = fmt.Fprintf(ginkgo.GinkgoWriter, "Test failed. Bellow here you can check logs:") _, _ = fmt.Fprintf(ginkgo.GinkgoWriter, "Test failed. Bellow here you can check logs:")

View File

@ -15,6 +15,7 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
) )
const pvcName = "pvc-jenkins" const pvcName = "pvc-jenkins"
@ -114,6 +115,34 @@ func createJenkinsWithBackupAndRestoreConfigured(name, namespace string) *v1alph
MountPath: "/usr/share/jenkins/ref/plugins", MountPath: "/usr/share/jenkins/ref/plugins",
}, },
}, },
ReadinessProbe: &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/login",
Port: intstr.FromString("http"),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: int32(100),
TimeoutSeconds: int32(4),
FailureThreshold: int32(30),
SuccessThreshold: int32(1),
PeriodSeconds: int32(5),
},
LivenessProbe: &corev1.Probe{
Handler: corev1.Handler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/login",
Port: intstr.FromString("http"),
Scheme: corev1.URISchemeHTTP,
},
},
InitialDelaySeconds: int32(80),
TimeoutSeconds: int32(4),
FailureThreshold: int32(30),
SuccessThreshold: int32(1),
PeriodSeconds: int32(5),
},
}, },
{ {
Name: containerName, Name: containerName,

View File

@ -23,7 +23,7 @@ var _ = Describe("Jenkins controller", func() {
namespace = e2e.CreateNamespace() namespace = e2e.CreateNamespace()
}) })
AfterEach(func() { AfterEach(func() {
showLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name) e2e.ShowLogsIfTestHasFailed(CurrentGinkgoTestDescription().Failed, namespace.Name)
e2e.DestroyNamespace(namespace) e2e.DestroyNamespace(namespace)
}) })
Context("when deploying Helm Chart to cluster", func() { Context("when deploying Helm Chart to cluster", func() {

View File

@ -48,7 +48,7 @@ spec:
fsGroup: 1000 fsGroup: 1000
containers: containers:
- name: jenkins-master - name: jenkins-master
image: jenkins/jenkins:2.263.2-lts-alpine image: jenkins/jenkins:2.277.4-lts-alpine
- name: backup # container responsible for the backup and restore - name: backup # container responsible for the backup and restore
env: env:
- name: BACKUP_DIR - name: BACKUP_DIR

View File

@ -19,7 +19,7 @@ spec:
master: master:
containers: containers:
- name: jenkins-master - name: jenkins-master
image: jenkins/jenkins:2.263.2-lts-alpine image: jenkins/jenkins:2.277.4-lts-alpine
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
failureThreshold: 12 failureThreshold: 12

View File

@ -19,7 +19,7 @@ spec:
master: master:
containers: containers:
- name: jenkins-master - name: jenkins-master
image: jenkins/jenkins:2.263.3-lts-alpine image: jenkins/jenkins:2.277.4-lts-alpine
imagePullPolicy: Always imagePullPolicy: Always
livenessProbe: livenessProbe:
failureThreshold: 12 failureThreshold: 12