From 042bf91a6cc51044b92c0469973fe1d870543b59 Mon Sep 17 00:00:00 2001 From: mms-build-account Date: Thu, 21 Sep 2023 05:42:46 -0400 Subject: [PATCH] Kubernetes Enterprise Operator Release 1.22.0 (#263) Co-authored-by: nam --- .gitignore | 1 + crds.yaml | 98 +++++++++++++++++-- .../1.0.18/ubi/Dockerfile | 35 +++++++ .../1.0.18/ubi/Dockerfile | 34 +++++++ .../1.0.12/ubi/Dockerfile | 26 +++++ .../1.22.0/ubi/Dockerfile | 39 ++++++++ .../6.0.18/ubi/Dockerfile | 75 ++++++++++++++ mongodb-enterprise-multi-cluster.yaml | 2 +- mongodb-enterprise-openshift.yaml | 10 +- mongodb-enterprise.yaml | 4 +- 10 files changed, 310 insertions(+), 14 deletions(-) create mode 100644 dockerfiles/mongodb-enterprise-init-appdb/1.0.18/ubi/Dockerfile create mode 100644 dockerfiles/mongodb-enterprise-init-database/1.0.18/ubi/Dockerfile create mode 100644 dockerfiles/mongodb-enterprise-init-ops-manager/1.0.12/ubi/Dockerfile create mode 100644 dockerfiles/mongodb-enterprise-operator/1.22.0/ubi/Dockerfile create mode 100644 dockerfiles/mongodb-enterprise-ops-manager/6.0.18/ubi/Dockerfile diff --git a/.gitignore b/.gitignore index c38fa4e..6d484c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea *.iml +.DS_Store diff --git a/crds.yaml b/crds.yaml index 22b33f2..8ff1a42 100644 --- a/crds.yaml +++ b/crds.yaml @@ -2011,29 +2011,75 @@ spec: applicationDatabase: properties: additionalMongodConfig: - description: 'AdditionalMongodConfig is additional configuration + description: 'AdditionalMongodConfig are additional configurations that can be passed to each data-bearing mongod at runtime. Uses the same structure as the mongod configuration file: https://docs.mongodb.com/manual/reference/configuration-options/' type: object x-kubernetes-preserve-unknown-fields: true agent: - description: specify startup flags for the AutomationAgent and - MonitoringAgent + description: specify configuration like startup flags and automation + config settings for the AutomationAgent and MonitoringAgent properties: logLevel: type: string + logRotate: + description: LogRotate if enabled, will enable LogRotate for + all processes. + properties: + includeAuditLogsWithMongoDBLogs: + description: set to 'true' to have the Automation Agent + rotate the audit files along with mongodb log files + type: boolean + numTotal: + description: maximum number of log files to have total + type: integer + numUncompressed: + description: maximum number of log files to leave uncompressed + type: integer + percentOfDiskspace: + description: Maximum percentage of the total disk space + these log files should take up. The string needs to + be able to be converted to float64 + type: string + sizeThresholdMB: + description: Maximum size for an individual log file before + rotation. The string needs to be able to be converted + to float64. Fractional values of MB are supported. + type: string + timeThresholdHrs: + description: maximum hours for an individual log file + before rotation + type: integer + required: + - sizeThresholdMB + - timeThresholdHrs + type: object maxLogFileDurationHours: type: integer startupOptions: additionalProperties: type: string type: object + systemLog: + description: SystemLog configures system log of mongod + properties: + destination: + type: string + logAppend: + type: boolean + path: + type: string + required: + - destination + - logAppend + - path + type: object type: object automationConfig: description: AutomationConfigOverride holds any fields that will be merged on top of the Automation Config that the operator - creates for the AppDB. Currently only the process.disabled field - is recognized. + creates for the AppDB. Currently only the process.disabled and + logRotate field is recognized. properties: processes: items: @@ -2042,6 +2088,43 @@ spec: properties: disabled: type: boolean + logRotate: + description: CrdLogRotate is the crd definition of LogRotate + including fields in strings while the agent supports + them as float64 + properties: + includeAuditLogsWithMongoDBLogs: + description: set to 'true' to have the Automation + Agent rotate the audit files along with mongodb + log files + type: boolean + numTotal: + description: maximum number of log files to have + total + type: integer + numUncompressed: + description: maximum number of log files to leave + uncompressed + type: integer + percentOfDiskspace: + description: Maximum percentage of the total disk + space these log files should take up. The string + needs to be able to be converted to float64 + type: string + sizeThresholdMB: + description: Maximum size for an individual log + file before rotation. The string needs to be able + to be converted to float64. Fractional values + of MB are supported. + type: string + timeThresholdHrs: + description: maximum hours for an individual log + file before rotation + type: integer + required: + - sizeThresholdMB + - timeThresholdHrs + type: object name: type: string required: @@ -2206,8 +2289,9 @@ spec: minimum: 3 type: integer monitoringAgent: - description: specify startup flags for just the MonitoringAgent. - These take precedence over the flags set in AutomationAgent + description: Specify configuration like startup flags just for + the MonitoringAgent. These take precedence over the flags set + in AutomationAgent properties: logLevel: type: string diff --git a/dockerfiles/mongodb-enterprise-init-appdb/1.0.18/ubi/Dockerfile b/dockerfiles/mongodb-enterprise-init-appdb/1.0.18/ubi/Dockerfile new file mode 100644 index 0000000..68ae7cc --- /dev/null +++ b/dockerfiles/mongodb-enterprise-init-appdb/1.0.18/ubi/Dockerfile @@ -0,0 +1,35 @@ +ARG imagebase +FROM ${imagebase} as base + +FROM registry.access.redhat.com/ubi8/ubi-minimal + +ARG version +LABEL name="MongoDB Enterprise Init AppDB" \ + version="mongodb-enterprise-init-appdb-${version}" \ + summary="MongoDB Enterprise AppDB Init Image" \ + description="Startup Scripts for MongoDB Enterprise Application Database for Ops Manager" \ + release="1" \ + vendor="MongoDB" \ + maintainer="support@mongodb.com" + +COPY --from=base /data/readinessprobe /probes/readinessprobe +COPY --from=base /data/probe.sh /probes/probe.sh +COPY --from=base /data/scripts/ /scripts/ +COPY --from=base /data/licenses /licenses/ +COPY --from=base /data/version-upgrade-hook /probes/version-upgrade-hook + + +RUN microdnf update --nodocs \ + && microdnf -y install --nodocs tar gzip \ + && microdnf clean all + +COPY --from=base /data/mongodb_tools_ubi.tgz /tools/mongodb_tools.tgz + + +RUN tar xfz /tools/mongodb_tools.tgz --directory /tools \ + && rm /tools/mongodb_tools.tgz + +USER 2000 +ENTRYPOINT [ "/bin/cp", "-f", "-r", "/scripts/agent-launcher.sh", "/scripts/agent-launcher-lib.sh", "/probes/readinessprobe", "/probes/probe.sh", "/tools", "/opt/scripts/" ] + + diff --git a/dockerfiles/mongodb-enterprise-init-database/1.0.18/ubi/Dockerfile b/dockerfiles/mongodb-enterprise-init-database/1.0.18/ubi/Dockerfile new file mode 100644 index 0000000..eb48104 --- /dev/null +++ b/dockerfiles/mongodb-enterprise-init-database/1.0.18/ubi/Dockerfile @@ -0,0 +1,34 @@ +ARG imagebase +FROM ${imagebase} as base + +FROM registry.access.redhat.com/ubi8/ubi-minimal + +ARG version +LABEL name="MongoDB Enterprise Init Database" \ + version="mongodb-enterprise-init-database-${version}" \ + summary="MongoDB Enterprise Database Init Image" \ + description="Startup Scripts for MongoDB Enterprise Database" \ + release="1" \ + vendor="MongoDB" \ + maintainer="support@mongodb.com" + +COPY --from=base /data/readinessprobe /probes/readinessprobe +COPY --from=base /data/probe.sh /probes/probe.sh +COPY --from=base /data/scripts/ /scripts/ +COPY --from=base /data/licenses /licenses/ + + +RUN microdnf update --nodocs \ + && microdnf -y install --nodocs tar gzip \ + && microdnf clean all + +COPY --from=base /data/mongodb_tools_ubi.tgz /tools/mongodb_tools.tgz + + +RUN tar xfz /tools/mongodb_tools.tgz --directory /tools \ + && rm /tools/mongodb_tools.tgz + +USER 2000 +ENTRYPOINT [ "/bin/cp", "-f", "-r", "/scripts/agent-launcher.sh", "/scripts/agent-launcher-lib.sh", "/probes/readinessprobe", "/probes/probe.sh", "/tools", "/opt/scripts/" ] + + diff --git a/dockerfiles/mongodb-enterprise-init-ops-manager/1.0.12/ubi/Dockerfile b/dockerfiles/mongodb-enterprise-init-ops-manager/1.0.12/ubi/Dockerfile new file mode 100644 index 0000000..92ce623 --- /dev/null +++ b/dockerfiles/mongodb-enterprise-init-ops-manager/1.0.12/ubi/Dockerfile @@ -0,0 +1,26 @@ +ARG imagebase +FROM ${imagebase} as base + +FROM registry.access.redhat.com/ubi8/ubi-minimal + +LABEL name="MongoDB Enterprise Ops Manager Init" \ + maintainer="support@mongodb.com" \ + vendor="MongoDB" \ + version="mongodb-enterprise-init-ops-manager-1.0.12" \ + release="1" \ + summary="MongoDB Enterprise Ops Manager Init Image" \ + description="Startup Scripts for MongoDB Enterprise Ops Manager" + + +COPY --from=base /data/scripts /scripts +COPY --from=base /data/licenses /licenses + + +RUN microdnf update --nodocs \ + && microdnf clean all + + +USER 2000 +ENTRYPOINT [ "/bin/cp", "-f", "/scripts/docker-entry-point.sh", "/scripts/backup-daemon-liveness-probe.sh", "/scripts/mmsconfiguration", "/scripts/backup-daemon-readiness-probe", "/opt/scripts/" ] + + diff --git a/dockerfiles/mongodb-enterprise-operator/1.22.0/ubi/Dockerfile b/dockerfiles/mongodb-enterprise-operator/1.22.0/ubi/Dockerfile new file mode 100644 index 0000000..2615fa5 --- /dev/null +++ b/dockerfiles/mongodb-enterprise-operator/1.22.0/ubi/Dockerfile @@ -0,0 +1,39 @@ +# +# Base Template Dockerfile for Operator Image. +# + +ARG imagebase +FROM ${imagebase} as base + +FROM registry.access.redhat.com/ubi8/ubi-minimal + + +LABEL name="MongoDB Enterprise Operator" \ + maintainer="support@mongodb.com" \ + vendor="MongoDB" \ + version="1.22.0" \ + release="1" \ + summary="MongoDB Enterprise Operator Image" \ + description="MongoDB Enterprise Operator Image" + + +# Building an UBI-based image: https://red.ht/3n6b9y0 +RUN microdnf update \ + --disableplugin=subscription-manager \ + --disablerepo=* --enablerepo=ubi-8-appstream-rpms --enablerepo=ubi-8-baseos-rpms -y \ + && rm -rf /var/cache/yum + + + + +COPY --from=base /data/mongodb-enterprise-operator /usr/local/bin/mongodb-enterprise-operator +COPY --from=base /data/om_version_mapping.json /usr/local/om_version_mapping.json +COPY --from=base /data/licenses /licenses/ + +USER 2000 + + + +ENTRYPOINT exec /usr/local/bin/mongodb-enterprise-operator + + diff --git a/dockerfiles/mongodb-enterprise-ops-manager/6.0.18/ubi/Dockerfile b/dockerfiles/mongodb-enterprise-ops-manager/6.0.18/ubi/Dockerfile new file mode 100644 index 0000000..31c1a28 --- /dev/null +++ b/dockerfiles/mongodb-enterprise-ops-manager/6.0.18/ubi/Dockerfile @@ -0,0 +1,75 @@ +ARG imagebase +FROM ${imagebase} as base + +FROM registry.access.redhat.com/ubi8/ubi-minimal + + +LABEL name="MongoDB Enterprise Ops Manager" \ + maintainer="support@mongodb.com" \ + vendor="MongoDB" \ + version="6.0.18" \ + release="1" \ + summary="MongoDB Enterprise Ops Manager Image" \ + description="MongoDB Enterprise Ops Manager" + + +ENV MMS_HOME /mongodb-ops-manager +ENV MMS_PROP_FILE ${MMS_HOME}/conf/conf-mms.properties +ENV MMS_CONF_FILE ${MMS_HOME}/conf/mms.conf +ENV MMS_LOG_DIR ${MMS_HOME}/logs +ENV MMS_TMP_DIR ${MMS_HOME}/tmp + +EXPOSE 8080 + +# OpsManager docker image needs to have the MongoDB dependencies because the +# backup daemon is running its database locally + +RUN microdnf install --disableplugin=subscription-manager -y \ + cyrus-sasl \ + cyrus-sasl-gssapi \ + cyrus-sasl-plain \ + krb5-libs \ + libcurl \ + libpcap \ + lm_sensors-libs \ + net-snmp \ + net-snmp-agent-libs \ + openldap \ + openssl \ + tar \ + rpm-libs \ + net-tools \ + procps-ng \ + ncurses + + +COPY --from=base /data/licenses /licenses/ + + + +RUN curl --fail -L -o ops_manager.tar.gz https://downloads.mongodb.com/on-prem-mms/tar/mongodb-mms-6.0.18.100.20230905T1424Z.tar.gz \ + && tar -xzf ops_manager.tar.gz \ + && rm ops_manager.tar.gz \ + && mv mongodb-mms* "${MMS_HOME}" + + +# permissions +RUN chmod -R 0777 "${MMS_LOG_DIR}" \ + && chmod -R 0777 "${MMS_TMP_DIR}" \ + && chmod -R 0775 "${MMS_HOME}/conf" \ + && chmod -R 0775 "${MMS_HOME}/jdk" \ + && mkdir "${MMS_HOME}/mongodb-releases/" \ + && chmod -R 0775 "${MMS_HOME}/mongodb-releases" \ + && chmod -R 0777 "${MMS_CONF_FILE}" \ + && chmod -R 0777 "${MMS_PROP_FILE}" + +# The "${MMS_HOME}/conf" will be populated by the docker-entry-point.sh. +# For now we need to move into the templates directory. +RUN cp -r "${MMS_HOME}/conf" "${MMS_HOME}/conf-template" + +USER 2000 + +# operator to change the entrypoint to: /mongodb-ops-manager/bin/mongodb-mms start_mms (or a wrapper around this) +ENTRYPOINT [ "sleep infinity" ] + + diff --git a/mongodb-enterprise-multi-cluster.yaml b/mongodb-enterprise-multi-cluster.yaml index 3af68c0..82828f3 100644 --- a/mongodb-enterprise-multi-cluster.yaml +++ b/mongodb-enterprise-multi-cluster.yaml @@ -137,7 +137,7 @@ spec: runAsUser: 2000 containers: - name: mongodb-enterprise-operator-multi-cluster - image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.21.0" + image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.22.0" imagePullPolicy: Always args: - -watch-resource=mongodb diff --git a/mongodb-enterprise-openshift.yaml b/mongodb-enterprise-openshift.yaml index 60a14ed..bc3de82 100644 --- a/mongodb-enterprise-openshift.yaml +++ b/mongodb-enterprise-openshift.yaml @@ -216,7 +216,7 @@ spec: serviceAccountName: mongodb-enterprise-operator containers: - name: mongodb-enterprise-operator - image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.21.0" + image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.22.0" imagePullPolicy: Always args: - -watch-resource=mongodb @@ -254,7 +254,7 @@ spec: - name: INIT_DATABASE_IMAGE_REPOSITORY value: quay.io/mongodb/mongodb-enterprise-init-database-ubi - name: INIT_DATABASE_VERSION - value: 1.0.18 + value: 1.0.19 - name: DATABASE_VERSION value: 2.0.2 # Ops Manager @@ -283,8 +283,8 @@ spec: value: 'true' - name: RELATED_IMAGE_MONGODB_ENTERPRISE_DATABASE_IMAGE_2_0_2 value: "quay.io/mongodb/mongodb-enterprise-database-ubi:2.0.2" - - name: RELATED_IMAGE_INIT_DATABASE_IMAGE_REPOSITORY_1_0_18 - value: "quay.io/mongodb/mongodb-enterprise-init-database-ubi:1.0.18" + - name: RELATED_IMAGE_INIT_DATABASE_IMAGE_REPOSITORY_1_0_19 + value: "quay.io/mongodb/mongodb-enterprise-init-database-ubi:1.0.19" - name: RELATED_IMAGE_INIT_OPS_MANAGER_IMAGE_REPOSITORY_1_0_12 value: "quay.io/mongodb/mongodb-enterprise-init-ops-manager-ubi:1.0.12" - name: RELATED_IMAGE_INIT_APPDB_IMAGE_REPOSITORY_1_0_18 @@ -389,6 +389,8 @@ spec: value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:6.0.16" - name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_17 value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:6.0.17" + - name: RELATED_IMAGE_OPS_MANAGER_IMAGE_REPOSITORY_6_0_18 + value: "quay.io/mongodb/mongodb-enterprise-ops-manager-ubi:6.0.18" # since the official server images end with a different suffix we can re-use the same $mongodbImageEnv - name: RELATED_IMAGE_MONGODB_IMAGE_4_4_0_ubi8 value: "quay.io/mongodb/mongodb-enterprise-server:4.4.0-ubi8" diff --git a/mongodb-enterprise.yaml b/mongodb-enterprise.yaml index 09e0c04..6b269c3 100644 --- a/mongodb-enterprise.yaml +++ b/mongodb-enterprise.yaml @@ -219,7 +219,7 @@ spec: runAsUser: 2000 containers: - name: mongodb-enterprise-operator - image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.21.0" + image: "quay.io/mongodb/mongodb-enterprise-operator-ubi:1.22.0" imagePullPolicy: Always args: - -watch-resource=mongodb @@ -255,7 +255,7 @@ spec: - name: INIT_DATABASE_IMAGE_REPOSITORY value: quay.io/mongodb/mongodb-enterprise-init-database-ubi - name: INIT_DATABASE_VERSION - value: 1.0.18 + value: 1.0.19 - name: DATABASE_VERSION value: 2.0.2 # Ops Manager