Use IB image for Mattermost init container
PR - https://github.com/mattermost/mattermost-operator/pull/242 - introduced ability to specify custom init containers.
We will want to follow the note in that PR to disable the existing readiness checks (which use a non-IB image) and instead create an init container that runs IB postgres to check the DB status.
Upstream example, note the disableReadinessCheck
value and the podExtensions
used to make a new init container.
apiVersion: installation.mattermost.com/v1beta1
kind: Mattermost
metadata:
name: mm-test
spec:
database:
disableReadinessCheck: true
...
podExtensions:
initContainers:
- command:
- /bin/sh
- -c
- echo Hello world
image: busybox
name: hello
...
The "default" db init container looked like:
return &corev1.Container{
Name: "init-check-database",
Image: "postgres:13",
ImagePullPolicy: corev1.PullIfNotPresent,
Env: envVars,
Command: []string{
"sh", "-c",
"until pg_isready --dbname=\"$DB_CONNECTION_CHECK_URL\"; do echo waiting for database; sleep 5; done;",
},
}
Should be able to copy/modify this to fit into podExtensions.initContainers
, ensuring that an IB image is used by default.
AC:
-
Default DB readiness check disabled -
New init container added (by default) in the Mattermost
spec to provide the same DB readiness functionality with an IB postgres image -
Tag bumped + Gatekeeper exception removed in BB MR - https://repo1.dso.mil/platform-one/big-bang/bigbang/-/blob/master/chart/templates/gatekeeper/values.yaml#L31-35
NOTE: This is a security issue because we are not using the secure IB container