Skip to content

Fixed certs for OM MC GKE install guide #293

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gcloud config set project "${MDB_GKE_PROJECT}"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

gcloud container clusters get-credentials "${K8S_CLUSTER_0}" --zone="${K8S_CLUSTER_0_ZONE}"
gcloud container clusters get-credentials "${K8S_CLUSTER_1}" --zone="${K8S_CLUSTER_1_ZONE}"
gcloud container clusters get-credentials "${K8S_CLUSTER_2}" --zone="${K8S_CLUSTER_2_ZONE}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
helm repo add mongodb https://mongodb.github.io/helm-charts
helm repo update mongodb
helm search repo "${OFFICIAL_OPERATOR_HELM_CHART}"

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
x509_extensions = v3_ca

[ dn ]
C=US
Expand All @@ -14,6 +15,12 @@ L=New York
O=Example Company
OU=IT Department
CN=exampleCA

[ v3_ca ]
basicConstraints = CA:TRUE
keyUsage = critical, keyCertSign, cRLSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
EOF

cat <<EOF >certs/om.cnf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
kustomize build "github.com/minio/operator/resources/?timeout=120&ref=v5.0.12" | \
kubectl kustomize "github.com/minio/operator/resources/?timeout=120&ref=v5.0.12" | \
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" apply -f -

kustomize build "github.com/minio/operator/examples/kustomization/tenant-tiny?timeout=120&ref=v5.0.12" | \
kubectl kustomize "github.com/minio/operator/examples/kustomization/tenant-tiny?timeout=120&ref=v5.0.12" | \
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" apply -f -

# add two buckets to the tenant config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" delete ns "${NAMESPACE}" &
kubectl --context "${K8S_CLUSTER_1_CONTEXT_NAME}" delete ns "${NAMESPACE}" &
kubectl --context "${K8S_CLUSTER_2_CONTEXT_NAME}" delete ns "${NAMESPACE}" &
kubectl --context "${K8S_CLUSTER_0_CONTEXT_NAME}" delete ns "${OPERATOR_NAMESPACE}" &
kubectl --context "${K8S_CLUSTER_1_CONTEXT_NAME}" delete ns "${OPERATOR_NAMESPACE}" &
kubectl --context "${K8S_CLUSTER_2_CONTEXT_NAME}" delete ns "${OPERATOR_NAMESPACE}" &
wait
5 changes: 3 additions & 2 deletions samples/ops-manager-multi-cluster/env_variables.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export MDB_GKE_PROJECT="### Set your GKE project name here ###"
export MDB_GKE_PROJECT="scratch-kubernetes-team"

export NAMESPACE="mongodb"
export OPERATOR_NAMESPACE="mongodb-operator"
Expand Down Expand Up @@ -38,7 +38,8 @@ export S3_ENDPOINT="minio.tenant-tiny.svc.cluster.local"
export S3_ACCESS_KEY="console"
export S3_SECRET_KEY="console123"

export OPERATOR_HELM_CHART="mongodb/enterprise-operator"
export OFFICIAL_OPERATOR_HELM_CHART="mongodb/enterprise-operator"
export OPERATOR_HELM_CHART="${OFFICIAL_OPERATOR_HELM_CHART}"

# (Optional) Change the following setting when using the external URL.
# This env variable is used in OpenSSL configuration to generate
Expand Down
2 changes: 2 additions & 0 deletions samples/ops-manager-multi-cluster/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ run 0010_create_gke_cluster_0.sh &
run 0010_create_gke_cluster_1.sh &
run 0010_create_gke_cluster_2.sh &
wait
run 0011_gcloud_set_current_project.sh
run 0020_get_gke_credentials.sh
run_for_output 0030_verify_access_to_clusters.sh

Expand Down Expand Up @@ -38,6 +39,7 @@ run_for_output 0090_check_cluster_connectivity_verify_pod_2_0_from_cluster_0.sh
run 0100_check_cluster_connectivity_cleanup.sh

run_for_output 0200_kubectl_mongodb_configure_multi_cluster.sh
run_for_output 0205_helm_configure_repo.sh
run_for_output 0210_helm_install_operator.sh
run_for_output 0211_check_operator_deployment.sh

Expand Down
4 changes: 4 additions & 0 deletions samples/ops-manager-multi-cluster/test_cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
#!/usr/bin/env bash

# This script only cleans up local directory to prepare to a fresh run. It's not cleaning up any deployed resources/clusters.

set -eou pipefail

source env_variables.sh
source ../../scripts/sample_test_runner.sh

run_cleanup "test.sh"
rm -rf istio*
rm -rf certs
1 change: 0 additions & 1 deletion scripts/sample_test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function run_cleanup() {
script_file=$1
rm -rf "${snippets_run_dir}" 2>/dev/null || true
rm -rf "log" 2>/dev/null || true
rm -rf "output" 2>/dev/null || true
rm -rf "${script_file}.run.log" 2>/dev/null || true
}

Expand Down