Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public/architectures/**/certs/*
public/architectures/**/secrets/*

docker/mongodb-kubernetes-appdb/content/readinessprobe
mongodb-kubernetes
docker/mongodb-kubernetes-operator/content/mongodb-kubernetes-operator.tar
docker/mongodb-kubernetes-tests/helm_chart/
docker/mongodb-kubernetes-tests/public/
Expand Down
28 changes: 13 additions & 15 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
serviceAccountName: mongodb-kubernetes-operator
containers:
- name: mongodb-kubernetes-operator
image: "quay.io/mongodb/mongodb-kubernetes:1.2.0"
image: "quay.io/mongodb/mongodb-kubernetes:1.3.0"
imagePullPolicy: Always
args:
- -watch-resource=mongodb
Expand Down Expand Up @@ -69,21 +69,21 @@ spec:
- name: INIT_DATABASE_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-database
- name: INIT_DATABASE_VERSION
value: 1.2.0
value: 1.3.0
- name: DATABASE_VERSION
value: 1.2.0
value: 1.3.0
# Ops Manager
- name: OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi
- name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-ops-manager
- name: INIT_OPS_MANAGER_VERSION
value: 1.2.0
value: 1.3.0
# AppDB
- name: INIT_APPDB_IMAGE_REPOSITORY
value: quay.io/mongodb/mongodb-kubernetes-init-appdb
- name: INIT_APPDB_VERSION
value: 1.2.0
value: 1.3.0
- name: OPS_MANAGER_IMAGE_PULL_POLICY
value: Always
- name: AGENT_IMAGE
Expand Down Expand Up @@ -122,14 +122,14 @@ spec:
- name: MDB_COMMUNITY_IMAGE_TYPE
value: "ubi8"
# Community Env Vars End
- name: RELATED_IMAGE_MONGODB_ENTERPRISE_DATABASE_IMAGE_1_2_0
value: "quay.io/mongodb/mongodb-kubernetes-database:1.2.0"
- name: RELATED_IMAGE_INIT_DATABASE_IMAGE_REPOSITORY_1_2_0
value: "quay.io/mongodb/mongodb-kubernetes-init-database:1.2.0"
- name: RELATED_IMAGE_INIT_OPS_MANAGER_IMAGE_REPOSITORY_1_2_0
value: "quay.io/mongodb/mongodb-kubernetes-init-ops-manager:1.2.0"
- name: RELATED_IMAGE_INIT_APPDB_IMAGE_REPOSITORY_1_2_0
value: "quay.io/mongodb/mongodb-kubernetes-init-appdb:1.2.0"
- name: RELATED_IMAGE_MONGODB_ENTERPRISE_DATABASE_IMAGE_1_3_0
value: "quay.io/mongodb/mongodb-kubernetes-database:1.3.0"
- name: RELATED_IMAGE_INIT_DATABASE_IMAGE_REPOSITORY_1_3_0
value: "quay.io/mongodb/mongodb-kubernetes-init-database:1.3.0"
- name: RELATED_IMAGE_INIT_OPS_MANAGER_IMAGE_REPOSITORY_1_3_0
value: "quay.io/mongodb/mongodb-kubernetes-init-ops-manager:1.3.0"
- name: RELATED_IMAGE_INIT_APPDB_IMAGE_REPOSITORY_1_3_0
value: "quay.io/mongodb/mongodb-kubernetes-init-appdb:1.3.0"
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_12_8669_1
value: "quay.io/mongodb/mongodb-agent:107.0.12.8669-1"
- name: RELATED_IMAGE_AGENT_IMAGE_107_0_13_8702_1
Expand Down Expand Up @@ -295,8 +295,6 @@ spec:
value: "quay.io/mongodb/mongodb-enterprise-server:8.0.0-ubi8"
- name: RELATED_IMAGE_MONGODB_IMAGE_8_0_0_ubi9
value: "quay.io/mongodb/mongodb-enterprise-server:8.0.0-ubi9"
- name: RELATED_IMAGE_MDB_SEARCH_IMAGE_1_47_0
value: "quay.io/mongodb/mongodb-search-community:1.47.0"
- name: MDB_SEARCH_COMMUNITY_REPO_URL
value: "quay.io/mongodb"
- name: MDB_SEARCH_COMMUNITY_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
capabilities: Deep Insights
categories: Database
certified: "true"
containerImage: quay.io/mongodb/mongodb-kubernetes:1.2.0
containerImage: quay.io/mongodb/mongodb-kubernetes:1.3.0
createdAt: ""
description: The MongoDB Controllers for Kubernetes enable easy deploys of
MongoDB into Kubernetes clusters, using our management, monitoring and
Expand Down Expand Up @@ -456,5 +456,5 @@ spec:
maturity: stable
provider:
name: MongoDB, Inc
replaces: mongodb-kubernetes.v1.1.0
replaces: mongodb-kubernetes.v1.2.0
version: 0.0.0
2 changes: 1 addition & 1 deletion helm_chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: mongodb-kubernetes
description: MongoDB Controllers for Kubernetes translate the human knowledge of
creating a MongoDB instance into a scalable, repeatable, and standardized
method.
version: 1.2.0
version: 1.3.0
kubeVersion: '>=1.16-0'
type: application
keywords:
Expand Down
4 changes: 0 additions & 4 deletions helm_chart/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ spec:
- name: RELATED_IMAGE_{{ $mongodbImageEnv }}_{{ $version | replace "." "_" | replace "-" "_" }}
value: "{{ $.Values.mongodb.repo }}/{{ $.Values.mongodb.name }}:{{ $version }}"
{{- end }}
{{- if .Values.search }}
- name: RELATED_IMAGE_MDB_SEARCH_IMAGE_{{ .Values.search.community.version | replace "." "_" | replace "-" "_" }}
value: "{{ .Values.search.community.repo }}/{{ .Values.search.community.name }}:{{ $.Values.search.community.version }}"
{{- end }}
{{- end }}
{{- if .Values.search }}
- name: MDB_SEARCH_COMMUNITY_REPO_URL
Expand Down
2 changes: 1 addition & 1 deletion helm_chart/values-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ operator:
# Environment variables prefixed with RELATED_IMAGE_ are used by operator-sdk to generate relatedImages section
# with sha256 digests pinning for the certified operator bundle with disconnected environment feature enabled.
# https://docs.openshift.com/container-platform/4.14/operators/operator_sdk/osdk-generating-csvs.html#olm-enabling-operator-for-restricted-network_osdk-generating-csvs
version: 1.2.0
version: 1.3.0
relatedImages:
opsManager:
- 6.0.26
Expand Down
10 changes: 5 additions & 5 deletions helm_chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ operator:
deployment_name: mongodb-kubernetes-operator

# Version of mongodb-kubernetes-operator
version: 1.2.0
version: 1.3.0

# The Custom Resources that will be watched by the Operator. Needs to be changed if only some of the CRDs are installed
watchedResources:
Expand Down Expand Up @@ -123,24 +123,24 @@ operator:
## Database
database:
name: mongodb-kubernetes-database
version: 1.2.0
version: 1.3.0

initDatabase:
name: mongodb-kubernetes-init-database
version: 1.2.0
version: 1.3.0

## Ops Manager
opsManager:
name: mongodb-enterprise-ops-manager-ubi

initOpsManager:
name: mongodb-kubernetes-init-ops-manager
version: 1.2.0
version: 1.3.0

## Application Database
initAppDb:
name: mongodb-kubernetes-init-appdb
version: 1.2.0
version: 1.3.0

agent:
name: mongodb-agent
Expand Down
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are missing mongodb-kubernetes Dockerfile

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @MaciejKaras. This what the problem #410 because of which this the file was not added. I will add the file and then merge the PR.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
FROM scratch AS base

COPY ./docker/mongodb-kubernetes-database/LICENSE /data/licenses/mongodb-kubernetes-database

FROM registry.access.redhat.com/ubi8/ubi-minimal

ENV MMS_HOME=/mongodb-automation
ENV MMS_LOG_DIR=/var/log/mongodb-mms-automation

RUN microdnf update -y && rm -rf /var/cache/yum

# these are the packages needed for the agent
RUN microdnf install -y --disableplugin=subscription-manager --setopt=install_weak_deps=0 nss_wrapper
RUN microdnf install -y --disableplugin=subscription-manager \
hostname \
procps

# these are the packages needed for MongoDB
# (https://docs.mongodb.com/manual/tutorial/install-mongodb-enterprise-on-red-hat-tarball/ "RHEL/CentOS 8" tab)
RUN microdnf install -y --disableplugin=subscription-manager \
cyrus-sasl \
cyrus-sasl-gssapi \
cyrus-sasl-plain \
krb5-libs \
libcurl \
lm_sensors-libs \
net-snmp \
net-snmp-agent-libs \
openldap \
openssl \
jq \
tar \
xz-libs \
findutils

RUN ln -s /usr/lib64/libsasl2.so.3 /usr/lib64/libsasl2.so.2

# Set the required perms
RUN mkdir -p "${MMS_LOG_DIR}" \
&& chmod 0775 "${MMS_LOG_DIR}" \
&& mkdir -p /var/lib/mongodb-mms-automation \
&& chmod 0775 /var/lib/mongodb-mms-automation \
&& mkdir -p /data \
&& chmod 0775 /data \
&& mkdir -p /journal \
&& chmod 0775 /journal \
&& mkdir -p "${MMS_HOME}" \
&& chmod -R 0775 "${MMS_HOME}"

ARG VERSION

LABEL name="MongoDB Kubernetes Database" \
version="${VERSION}" \
summary="MongoDB Kubernetes Database Image" \
description="MongoDB Kubernetes Database Image" \
vendor="MongoDB" \
release="1" \
maintainer="[email protected]"

# USER needs to be set for this image to pass RedHat verification. Some customers have these requirements as well
# It does not matter what number it is, as long as it is set to something.
# However, OpenShift will run the container as a random user,
# and the number in this configuration is not relevant.
USER 2000

# The docker image doesn't have any scripts so by default does nothing
# The script will be copied in runtime from init containers and the operator is expected
# to override the COMMAND
ENTRYPOINT ["sleep infinity"]

COPY --from=base /data/licenses/mongodb-kubernetes-database /licenses/mongodb-kubernetes-database
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM --platform=${BUILDPLATFORM} registry.access.redhat.com/ubi8/ubi-minimal AS tools_downloader

ARG mongodb_tools_url
ARG mongodb_tools_version_s390x
ARG mongodb_tools_version_ppc64le
ARG mongodb_tools_version_amd64
ARG mongodb_tools_version_arm64

RUN microdnf -y update --nodocs \
&& microdnf -y install --nodocs tar gzip curl \
&& microdnf clean all

RUN case ${TARGETPLATFORM} in \
"linux/amd64") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_amd64} ;; \
"linux/arm64") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_arm64} ;; \
"linux/s390x") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_s390x} ;; \
"linux/ppc64le") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_ppc64le} ;; \
esac \
&& mkdir -p /tools \
&& if [ -n "$MONGODB_TOOLS_VERSION" ]; then \
curl -o /tools/mongodb_tools.tgz "${mongodb_tools_url}/${MONGODB_TOOLS_VERSION}"; \
fi

RUN if [ -f "/tools/mongodb_tools.tgz" ]; then \
tar xfz /tools/mongodb_tools.tgz --directory /tools \
&& rm /tools/mongodb_tools.tgz; \
fi

FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.24 AS readiness_builder

WORKDIR /go/src/github.com/mongodb/mongodb-kubernetes/

COPY go.mod go.sum ./

RUN go mod download

COPY mongodb-community-operator ./mongodb-community-operator

ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOFLAGS=-buildvcs=false GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /readinessprobe ./mongodb-community-operator/cmd/readiness/main.go
RUN CGO_ENABLED=0 GOFLAGS=-buildvcs=false GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /version-upgrade-hook ./mongodb-community-operator/cmd/versionhook/main.go

FROM scratch AS base

COPY --from=readiness_builder /readinessprobe /data/readinessprobe
COPY --from=readiness_builder /version-upgrade-hook /data/version-upgrade-hook

COPY ./docker/mongodb-kubernetes-init-database/content/probe.sh /data/probe.sh

COPY ./docker/mongodb-kubernetes-init-database/content/agent-launcher-lib.sh /data/scripts/
COPY ./docker/mongodb-kubernetes-init-database/content/agent-launcher.sh /data/scripts/

COPY ./docker/mongodb-kubernetes-init-database/content/LICENSE /data/licenses/

FROM registry.access.redhat.com/ubi8/ubi-minimal

# Copy the extracted tools from the downloader stage (tools are already extracted there)
COPY --from=tools_downloader /tools/ /tools/

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 -y update --nodocs \
&& microdnf -y install --nodocs tar gzip \
&& microdnf clean all

ARG version
LABEL name="MongoDB Kubernetes Init AppDB" \
version="mongodb-kubernetes-init-appdb-${version}" \
summary="MongoDB Kubernetes AppDB Init Image" \
description="Startup Scripts for MongoDB Enterprise Application Database for Ops Manager" \
release="1" \
vendor="MongoDB" \
maintainer="[email protected]"

USER 2000

ENTRYPOINT [ "/bin/cp", "-f", "-r", "/scripts/agent-launcher.sh", "/scripts/agent-launcher-lib.sh", "/probes/readinessprobe", "/probes/probe.sh", "/tools", "/opt/scripts/" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM --platform=${BUILDPLATFORM} registry.access.redhat.com/ubi8/ubi-minimal AS tools_downloader

ARG mongodb_tools_url
ARG mongodb_tools_version_s390x
ARG mongodb_tools_version_ppc64le
ARG mongodb_tools_version_amd64
ARG mongodb_tools_version_arm64

RUN microdnf -y update --nodocs \
&& microdnf -y install --nodocs tar gzip curl \
&& microdnf clean all

RUN case ${TARGETPLATFORM} in \
"linux/amd64") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_amd64} ;; \
"linux/arm64") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_arm64} ;; \
"linux/s390x") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_s390x} ;; \
"linux/ppc64le") export MONGODB_TOOLS_VERSION=${mongodb_tools_version_ppc64le} ;; \
esac \
&& mkdir -p /tools \
&& if [ -n "$MONGODB_TOOLS_VERSION" ]; then \
curl -o /tools/mongodb_tools.tgz "${mongodb_tools_url}/${MONGODB_TOOLS_VERSION}"; \
fi

RUN if [ -f "/tools/mongodb_tools.tgz" ]; then \
tar xfz /tools/mongodb_tools.tgz --directory /tools \
&& rm /tools/mongodb_tools.tgz; \
fi

FROM --platform=$BUILDPLATFORM public.ecr.aws/docker/library/golang:1.24 AS readiness_builder

WORKDIR /go/src/github.com/mongodb/mongodb-kubernetes/

COPY go.mod go.sum ./

RUN go mod download

COPY mongodb-community-operator ./mongodb-community-operator

ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOFLAGS=-buildvcs=false GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /readinessprobe ./mongodb-community-operator/cmd/readiness/main.go
RUN CGO_ENABLED=0 GOFLAGS=-buildvcs=false GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o /version-upgrade-hook ./mongodb-community-operator/cmd/versionhook/main.go

FROM scratch AS base

COPY --from=readiness_builder /readinessprobe /data/readinessprobe
COPY --from=readiness_builder /version-upgrade-hook /data/version-upgrade-hook

COPY ./docker/mongodb-kubernetes-init-database/content/probe.sh /data/probe.sh

COPY ./docker/mongodb-kubernetes-init-database/content/agent-launcher-lib.sh /data/scripts/
COPY ./docker/mongodb-kubernetes-init-database/content/agent-launcher.sh /data/scripts/

COPY ./docker/mongodb-kubernetes-init-database/content/LICENSE /data/licenses/

FROM registry.access.redhat.com/ubi8/ubi-minimal

# Copy the extracted tools from the downloader stage (tools are already extracted there)
COPY --from=tools_downloader /tools/ /tools/

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 -y update --nodocs \
&& microdnf -y install --nodocs tar gzip \
&& microdnf clean all

ARG version
LABEL name="MongoDB Kubernetes Init Database" \
version="mongodb-kubernetes-init-database-${version}" \
summary="MongoDB Kubernetes Database Init Image" \
description="Startup Scripts for MongoDB Enterprise Database" \
release="1" \
vendor="MongoDB" \
maintainer="[email protected]"

USER 2000

ENTRYPOINT [ "/bin/cp", "-f", "-r", "/scripts/agent-launcher.sh", "/scripts/agent-launcher-lib.sh", "/probes/readinessprobe", "/probes/probe.sh", "/tools", "/opt/scripts/" ]
Loading