Skip to content

Commit

Permalink
Merge pull request #510 from fmount/dumb-init
Browse files Browse the repository at this point in the history
Move both -httpd and -api containers to dumb-init
  • Loading branch information
openshift-merge-bot[bot] authored Apr 16, 2024
2 parents c524f49 + f10c8a8 commit b1293e4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
17 changes: 14 additions & 3 deletions pkg/glanceapi/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func StatefulSet(
InitialDelaySeconds: 5,
}

args := []string{"-c", GlanceAPIServiceCommand}
//
// https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
//
Expand Down Expand Up @@ -238,9 +237,15 @@ func StatefulSet(
{
Name: glance.ServiceName + "-httpd",
Command: []string{
"/usr/bin/dumb-init",
},
Args: []string{
"--single-child",
"--",
"/bin/bash",
"-c",
string(GlanceAPIHttpdCommand),
},
Args: []string{"-c", GlanceAPIHttpdCommand},
Image: instance.Spec.ContainerImage,
SecurityContext: &corev1.SecurityContext{
RunAsUser: &runAsUser,
Expand All @@ -255,9 +260,15 @@ func StatefulSet(
{
Name: glance.ServiceName + "-api",
Command: []string{
"/usr/bin/dumb-init",
},
Args: []string{
"--single-child",
"--",
"/bin/bash",
"-c",
string(GlanceAPIServiceCommand),
},
Args: args,
Image: instance.Spec.ContainerImage,
SecurityContext: &corev1.SecurityContext{
RunAsUser: &runAsUser,
Expand Down
10 changes: 8 additions & 2 deletions test/kuttl/tests/glance_single/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ spec:
- /usr/bin/dumb-init
name: glance-log
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/sbin/httpd -DFOREGROUND
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-httpd
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/local/bin/kolla_set_configs && /usr/local/bin/kolla_start
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-api
serviceAccount: glance-glance
serviceAccountName: glance-glance
Expand Down
6 changes: 6 additions & 0 deletions test/kuttl/tests/glance_single_tls/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ spec:
name: logs
name: glance-log
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/sbin/httpd -DFOREGROUND
volumeMounts:
Expand Down Expand Up @@ -100,6 +103,9 @@ spec:
subPath: tls.key
name: glance-httpd
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/local/bin/kolla_set_configs && /usr/local/bin/kolla_start
volumeMounts:
Expand Down
20 changes: 16 additions & 4 deletions test/kuttl/tests/glance_split/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,22 @@ spec:
- /usr/bin/dumb-init
name: glance-log
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/sbin/httpd -DFOREGROUND
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-httpd
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/local/bin/kolla_set_configs && /usr/local/bin/kolla_start
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-api
serviceAccount: glance-glance
serviceAccountName: glance-glance
Expand Down Expand Up @@ -120,16 +126,22 @@ spec:
- /usr/bin/dumb-init
name: glance-log
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/sbin/httpd -DFOREGROUND
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-httpd
- args:
- --single-child
- --
- /bin/bash
- -c
- /usr/local/bin/kolla_set_configs && /usr/local/bin/kolla_start
command:
- /bin/bash
- /usr/bin/dumb-init
name: glance-api
serviceAccount: glance-glance
serviceAccountName: glance-glance
Expand Down

0 comments on commit b1293e4

Please sign in to comment.