Merge pull request #6 from logicnow/NS-3390-2
fix (NS-3390): pass lifecycle configuration to container
This commit is contained in:
commit
4980fff50e
|
|
@ -311,6 +311,7 @@ type JenkinsMaster struct {
|
||||||
// periodSeconds: 10
|
// periodSeconds: 10
|
||||||
// successThreshold: 1
|
// successThreshold: 1
|
||||||
// timeoutSeconds: 5
|
// timeoutSeconds: 5
|
||||||
|
// lifecycle: {}
|
||||||
// name: jenkins-master
|
// name: jenkins-master
|
||||||
// readinessProbe:
|
// readinessProbe:
|
||||||
// failureThreshold: 3
|
// failureThreshold: 3
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,9 @@ spec:
|
||||||
{{- with .Values.jenkins.env }}
|
{{- with .Values.jenkins.env }}
|
||||||
env: {{- toYaml . | nindent 8 }}
|
env: {{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.jenkins.lifecycle}}
|
||||||
|
lifecycle: {{ toYaml . | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.jenkins.volumeMounts }}
|
{{- with .Values.jenkins.volumeMounts }}
|
||||||
volumeMounts: {{- toYaml . | nindent 8 }}
|
volumeMounts: {{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ jenkins:
|
||||||
# imagePullPolicy defines policy for pulling images
|
# imagePullPolicy defines policy for pulling images
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
|
|
||||||
|
# lifecycle is used if you want to specify lifecycle hooks for the master container
|
||||||
|
lifecycle: {}
|
||||||
|
|
||||||
# priorityClassName indicates the importance of a Pod relative to other Pods
|
# priorityClassName indicates the importance of a Pod relative to other Pods
|
||||||
# See: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
# See: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
|
||||||
|
|
@ -378,6 +378,11 @@ func (r *JenkinsReconciler) setDefaults(jenkins *v1alpha2.Jenkins) (requeue bool
|
||||||
changed = true
|
changed = true
|
||||||
jenkinsContainer.LivenessProbe = resources.NewProbe(containerProbeURI, containerProbePortName, corev1.URISchemeHTTP, 80, 5, 12)
|
jenkinsContainer.LivenessProbe = resources.NewProbe(containerProbeURI, containerProbePortName, corev1.URISchemeHTTP, 80, 5, 12)
|
||||||
}
|
}
|
||||||
|
if jenkinsContainer.Lifecycle == nil {
|
||||||
|
logger.Info("Setting default Jenkins lifecycle")
|
||||||
|
changed = true
|
||||||
|
jenkinsContainer.Lifecycle = &corev1.Lifecycle{}
|
||||||
|
}
|
||||||
if len(jenkinsContainer.Command) == 0 {
|
if len(jenkinsContainer.Command) == 0 {
|
||||||
logger.Info("Setting default Jenkins container command")
|
logger.Info("Setting default Jenkins container command")
|
||||||
changed = true
|
changed = true
|
||||||
|
|
|
||||||
|
|
@ -243,6 +243,7 @@ func NewJenkinsMasterContainer(jenkins *v1alpha2.Jenkins) corev1.Container {
|
||||||
Image: jenkinsContainer.Image,
|
Image: jenkinsContainer.Image,
|
||||||
ImagePullPolicy: jenkinsContainer.ImagePullPolicy,
|
ImagePullPolicy: jenkinsContainer.ImagePullPolicy,
|
||||||
Command: jenkinsContainer.Command,
|
Command: jenkinsContainer.Command,
|
||||||
|
Lifecycle: jenkinsContainer.Lifecycle,
|
||||||
LivenessProbe: jenkinsContainer.LivenessProbe,
|
LivenessProbe: jenkinsContainer.LivenessProbe,
|
||||||
ReadinessProbe: jenkinsContainer.ReadinessProbe,
|
ReadinessProbe: jenkinsContainer.ReadinessProbe,
|
||||||
Ports: []corev1.ContainerPort{
|
Ports: []corev1.ContainerPort{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue