Jenkins OpenShift image requirements

This commit is contained in:
Akram Ben Aissi 2019-06-26 03:15:52 -04:00
parent 037c1fa025
commit 9285e294dd
3 changed files with 20 additions and 4 deletions

16
openshit-jenkins.yaml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: jenkins.io/v1alpha2
kind: Jenkins
metadata:
name: jenkins
spec:
master:
containers:
- name: jenkins-master
image: quay.io/openshift/origin-jenkins:latest
resources:
limits:
cpu: 1500m
memory: 3Gi
requests:
cpu: "1"
memory: 500Mi

View File

@ -546,10 +546,10 @@ func (r *ReconcileJenkinsBaseConfiguration) compareContainers(expected corev1.Co
r.logger.Info(fmt.Sprintf("Resources have changed to '%+v' in container '%s', recreating pod", expected.Resources, expected.Name)) r.logger.Info(fmt.Sprintf("Resources have changed to '%+v' in container '%s', recreating pod", expected.Resources, expected.Name))
return true return true
} }
if !reflect.DeepEqual(expected.SecurityContext, actual.SecurityContext) { /* if !reflect.DeepEqual(expected.SecurityContext, actual.SecurityContext) {
r.logger.Info(fmt.Sprintf("Security context has changed to '%+v' in container '%s', recreating pod", expected.SecurityContext, expected.Name)) r.logger.Info(fmt.Sprintf("Security context has changed to '%+v' in container '%s', recreating pod", expected.SecurityContext, expected.Name))
return true return true
} }*/
if !reflect.DeepEqual(expected.WorkingDir, actual.WorkingDir) { if !reflect.DeepEqual(expected.WorkingDir, actual.WorkingDir) {
r.logger.Info(fmt.Sprintf("Working directory has changed to '%+v' in container '%s', recreating pod", expected.WorkingDir, expected.Name)) r.logger.Info(fmt.Sprintf("Working directory has changed to '%+v' in container '%s', recreating pod", expected.WorkingDir, expected.Name))
return true return true

View File

@ -202,10 +202,10 @@ func NewJenkinsMasterContainer(jenkins *v1alpha2.Jenkins) corev1.Container {
Name: JenkinsMasterContainerName, Name: JenkinsMasterContainerName,
Image: jenkinsContainer.Image, Image: jenkinsContainer.Image,
ImagePullPolicy: jenkinsContainer.ImagePullPolicy, ImagePullPolicy: jenkinsContainer.ImagePullPolicy,
Command: []string{ /*Command: []string{
"bash", "bash",
fmt.Sprintf("%s/%s", jenkinsScriptsVolumePath, initScriptName), fmt.Sprintf("%s/%s", jenkinsScriptsVolumePath, initScriptName),
}, },*/
LivenessProbe: jenkinsContainer.LivenessProbe, LivenessProbe: jenkinsContainer.LivenessProbe,
ReadinessProbe: jenkinsContainer.ReadinessProbe, ReadinessProbe: jenkinsContainer.ReadinessProbe,
Ports: []corev1.ContainerPort{ Ports: []corev1.ContainerPort{