Skip to content

Release MongoDB Kubernetes Operator v0.7.2 #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 18, 2021
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
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
value: mongo
- name: MONGODB_REPO_URL
value: docker.io
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.1
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.2
imagePullPolicy: Always
name: mongodb-kubernetes-operator
resources:
Expand Down
2 changes: 1 addition & 1 deletion deploy/openshift/operator_openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ spec:
value: mongo
- name: MONGODB_REPO_URL
value: docker.io
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.1
image: quay.io/mongodb/mongodb-kubernetes-operator:0.7.2
imagePullPolicy: Always
name: mongodb-kubernetes-operator
resources:
Expand Down
17 changes: 6 additions & 11 deletions docs/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
# MongoDB Kubernetes Operator 0.7.1
# MongoDB Kubernetes Operator 0.7.2

## Kubernetes Operator

- Changes
- MongoDB database of the statefulSet is managed using distinct Role, ServiceAccount and RoleBinding.
- TLS Secret can also contain a single "tls.pem" entry, containing the concatenation of the certificate and key
- If a TLS secret contains all of "tls.key", "tls.crt" and "tls.pem" entries, the operator will raise an error if the "tls.pem" one is not equal to the concatenation of "tls.crt" with "tls.key"
- Readinessprobe reports MongoDB running as Arbitrer as _Running_ & _Healthy_.
- The `CLUSTER_DOMAIN` environment variable can be set on the Operator Pod, to configure the Kubernetes cluster's Domain,
in case this one differs from the default `cluster.local`.
- Bug fixes
- Adds missing roles for Database Pods.
- Fixes OpenShift install.

## MongoDBCommunity Resource
* Changes
* Specifying `spec.additionalMongodConfig.storage.dbPath` will now be respected correctly.
* No changes


## Updated Image Tags

- mongodb-kubernetes-operator:0.7.1
- mongodb-kubernetes-operator:0.7.2

_All the images can be found in:_

Expand Down
2 changes: 2 additions & 0 deletions docs/how-to-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Update any changing versions in [release.json](../release.json).
* Ensure that [the release notes](./RELEASE_NOTES.md) are up to date for this release.
* Run `python scripts/ci/update_release.py` to update the relevant yaml manifests.
* Copy `CRD`s to Helm Chart
- `cp config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml helm-charts/charts/community-operator-crds/templates/mongodbcommunity.mongodb.com_mongodbcommunity.yaml`
* Commit all changes.
* Create a PR with the title `Release MongoDB Kubernetes Operator v<operator-version>` (the title must match this pattern)

Expand Down
2 changes: 1 addition & 1 deletion helm-charts
Submodule helm-charts updated 53 files
+3 −0 .github/kubeval.sh
+14 −7 .github/workflows/ci.yaml
+2 −1 README.md
+0 −19 charts/community-database/Chart.yaml
+0 −29 charts/community-database/templates/database.yaml
+0 −11 charts/community-database/templates/mongodb-user-password.yaml
+0 −3 charts/community-database/values.yaml
+2 −2 charts/community-operator-crds/Chart.yaml
+14 −15 charts/community-operator/Chart.yaml
+9 −3 charts/community-operator/templates/database_roles.yaml
+9 −9 charts/community-operator/templates/mongodbcommunity_cr_with_tls.yaml
+3 −1 charts/community-operator/templates/operator.yaml
+8 −4 charts/community-operator/templates/operator_roles.yaml
+4 −2 charts/community-operator/values.yaml
+0 −6 charts/ent-operator-database/Chart.lock
+0 −19 charts/ent-operator-database/Chart.yaml
+0 −573 charts/ent-operator-database/crds/mongodb.mongodb.com.yaml
+0 −80 charts/ent-operator-database/crds/mongodbusers.mongodb.com.yaml
+0 −26 charts/ent-operator-database/templates/database-cm.yaml
+0 −21 charts/ent-operator-database/templates/database-roles.yaml
+0 −19 charts/ent-operator-database/templates/database-secret.yaml
+0 −89 charts/ent-operator-database/templates/database-shard.yaml
+0 −91 charts/ent-operator-database/templates/database.yaml
+0 −14 charts/ent-operator-database/templates/mongodb-user-password.yaml
+0 −24 charts/ent-operator-database/templates/mongodb-user.yaml
+0 −151 charts/ent-operator-database/values-shard.yaml
+0 −113 charts/ent-operator-database/values.yaml
+0 −6 charts/ent-operator-opsmanager/Chart.lock
+0 −20 charts/ent-operator-opsmanager/Chart.yaml
+0 −579 charts/ent-operator-opsmanager/crds/mongodb.mongodb.com.yaml
+0 −80 charts/ent-operator-opsmanager/crds/mongodbusers.mongodb.com.yaml
+0 −345 charts/ent-operator-opsmanager/crds/opsmanagers.mongodb.com.yaml
+0 −19 charts/ent-operator-opsmanager/templates/NOTES.txt
+0 −14 charts/ent-operator-opsmanager/templates/ops-manager-global-admin.yaml
+0 −119 charts/ent-operator-opsmanager/templates/ops-manager.yaml
+0 −64 charts/ent-operator-opsmanager/templates/opsmanager-roles.yaml
+0 −105 charts/ent-operator-opsmanager/values.yaml
+0 −14 charts/ent-operator/Chart.yaml
+0 −174 charts/ent-operator/templates/operator-roles.yaml
+0 −120 charts/ent-operator/templates/operator.yaml
+0 −83 charts/ent-operator/values.yaml
+16 −0 charts/enterprise-operator/Chart.yaml
+72 −0 charts/enterprise-operator/README.md
+788 −0 charts/enterprise-operator/crds/mongodb.com_mongodb.yaml
+517 −0 charts/enterprise-operator/crds/mongodb.com_mongodbmulti.yaml
+166 −0 charts/enterprise-operator/crds/mongodb.com_mongodbusers.yaml
+940 −0 charts/enterprise-operator/crds/mongodb.com_opsmanagers.yaml
+27 −0 charts/enterprise-operator/crds/webhook-cluster-role.yaml
+83 −0 charts/enterprise-operator/templates/database-roles.yaml
+151 −0 charts/enterprise-operator/templates/operator-roles.yaml
+141 −0 charts/enterprise-operator/templates/operator.yaml
+76 −0 charts/enterprise-operator/values-openshift.yaml
+86 −0 charts/enterprise-operator/values.yaml
2 changes: 1 addition & 1 deletion release.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mongodb-kubernetes-operator": "0.7.1",
"mongodb-kubernetes-operator": "0.7.2",
"version-upgrade-hook": "1.0.3",
"readiness-probe": "1.0.6",
"mongodb-agent": {
Expand Down
47 changes: 39 additions & 8 deletions scripts/ci/update_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,34 @@

import json
import sys
import yaml
from typing import Dict
from typing import Dict, Callable

import ruamel.yaml

yaml = ruamel.yaml.YAML()


RELATIVE_PATH_TO_MANAGER_YAML = "config/manager/manager.yaml"
RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML = "deploy/openshift/operator_openshift.yaml"

RELATIVE_PATH_TO_CHART_VALUES = "helm-charts/charts/community-operator/values.yaml"
RELATIVE_PATH_TO_CHART = "helm-charts/charts/community-operator/Chart.yaml"


def _load_yaml_file(path: str) -> Dict:
with open(path, "r") as f:
return yaml.safe_load(f.read())
return yaml.load(f.read())


def _dump_yaml(operator: Dict, path: str) -> None:
with open(path, "w+") as f:
yaml.dump(operator, f)


def update_and_write_file(path: str) -> None:
def update_and_write_file(path: str, update_function: Callable) -> None:
release = _load_release()
yaml_file = _load_yaml_file(path)
_update_operator_deployment(yaml_file, release)
update_function(yaml_file, release)
_dump_yaml(yaml_file, path)


Expand All @@ -36,7 +43,7 @@ def _replace_tag(image: str, new_tag: str) -> str:
return split_image[0] + ":" + new_tag


def _update_operator_deployment(operator_deployment: Dict, release: Dict) -> None:
def update_operator_deployment(operator_deployment: Dict, release: Dict) -> None:
operator_container = operator_deployment["spec"]["template"]["spec"]["containers"][
0
]
Expand All @@ -55,9 +62,33 @@ def _update_operator_deployment(operator_deployment: Dict, release: Dict) -> Non
)


def update_chart_values(values: Dict, release: Dict) -> None:
values["agent"]["version"] = release["mongodb-agent"]["version"]
values["versionUpgradeHook"]["version"] = release["version-upgrade-hook"]
values["readinessProbe"]["version"] = release["readiness-probe"]
values["operator"]["version"] = release["mongodb-kubernetes-operator"]


def update_chart(chart: Dict, release: Dict) -> None:
chart["version"] = release["mongodb-kubernetes-operator"]
chart["appVersion"] = release["mongodb-kubernetes-operator"]

for dependency in chart["dependencies"]:
if dependency["name"] == "community-operator-crds":
dependency["version"] = release["mongodb-kubernetes-operator"]


def main() -> int:
update_and_write_file(RELATIVE_PATH_TO_MANAGER_YAML)
update_and_write_file(RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML)
# Updating local files
update_and_write_file(RELATIVE_PATH_TO_MANAGER_YAML, update_operator_deployment)
update_and_write_file(
RELATIVE_PATH_TO_OPENSHIFT_MANAGER_YAML, update_operator_deployment
)

# Updating Helm Chart files
update_and_write_file(RELATIVE_PATH_TO_CHART_VALUES, update_chart_values)
update_and_write_file(RELATIVE_PATH_TO_CHART, update_chart)

return 0


Expand Down