Docs Menu
Docs Home
/
MongoDB Enterprise Kubernetes ์—ฐ์‚ฐ์ž
/ /

MongoDBMongoDB Enterprise Kubernetes Operator ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ Kubernetes Operator kubectl ๋ฐ oc ์„ค์น˜ ์„ค์ •

์ด ํŽ˜์ด์ง€์˜ ๋‚ด์šฉ

  • AGENT_IMAGE
  • APPDB_AGENT_VERSION
  • APPDB_IMAGE_REPOSITORY
  • CLUSTER_CLIENT_TIMEOUT
  • DATABASE_VERSION
  • IMAGE_PULL_POLICY
  • INIT_APPDB_IMAGE_REPOSITORY
  • INIT_APPDB_VERSION
  • INIT_DATABASE_IMAGE_REPOSITORY
  • INIT_DATABASE_VERSION
  • INIT_OPS_MANAGER_IMAGE_REPOSITORY
  • INIT_OPS_MANAGER_VERSION
  • LOG_FILE_PATH
  • MANAGED_SECURITY_CONTEXT
  • MDB_AGENT_IMAGE_REPOSITORY
  • MDB_APPDB_ASSUME_OLD_FORMAT
  • MDB_AUTOMATIC_RECOVERY_ENABLE
  • MDB_AUTOMATIC_RECOVERY_BACKOFF_TIME_S
  • MDB_DEFAULT_ARCHITECTURE
  • MDB_IMAGE_TYPE
  • MDB_WITH_AGENT_FILE_LOGGING
  • MDB_MAX_CONCURRENT_RECONCILES
  • MONGODB_Enterprise_DATABASE_IMAGE
  • OPERATOR_ENV
  • OPS_MANAGER_IMAGE_PULL_POLICY
  • OPS_MANAGER_IMAGE_REPOSITORY
  • READINESS_PROBE_LOGGER_BACKUPS
  • READINESS_PROBE_LOGGER_COMPRESS
  • READINESS_PROBE_LOGGER_MAX_SIZE
  • READINESS_PROBE_LOGGER_MAX_AGE
  • WATCH_NAMESPACE

์„ ํƒ์  ์„ค์ •์„ ์ œ๊ณตํ•˜๋ ค๋ฉด Kubernetes ์—ฐ์‚ฐ์ž ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•œ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ๋ฐฐํฌ ์œ ํ˜•์— ํ•ด๋‹นํ•˜๋Š” YAML ํŒŒ์ผ์„ ํŽธ์ง‘ํ•ฉ๋‹ˆ๋‹ค.

  • kubectl ์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐ”๋‹๋ผ Kubernetes : mongodb-enterprise.yaml

  • oc ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” OpenShift : mongodb-enterprise-openshift.yaml

์ถ”๊ฐ€ํ•˜๋ ค๋Š” ์„ค์ •์ด YAML ํŒŒ์ผ์— ์—†๋Š” ๊ฒฝ์šฐ ์ด๋ฅผ spec.emplate.spec.containers.name.env์— ํ‚ค-๊ฐ’ ์Œ ๋งคํ•‘์˜ ์ƒˆ ๋ฐฐ์—ด๋กœ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. collection:

  • spec. Template.spec.containers.name.env.name ํ‚ค ๊ฐ’์„ ์„ค์ • ์ด๋ฆ„์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

  • spec.sample.spec.containers.name.env.value ํ‚ค์˜ ๊ฐ’์„ ์„ค์ •์˜ ๊ฐ’์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€์˜ ๊ฐ’์„ ์ž…๋ ฅํ•˜๋ ค๋ฉด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_APPDB_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-init-appdb-ubi

Kubernetes Operator๊ฐ€ ๋น„์ •์  ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด MongoDB Agent ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ์˜ URL ์ž…๋‹ˆ๋‹ค. MongoDB Agent ๋ฒ„์ „์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. ํ•™์Šต ๋ณด๋ ค๋ฉด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: AGENT_IMAGE
11 value: quay.io/mongodb/mongodb-agent-ubi:<version>

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” MongoDB Agent๊ฐ€ ํฌํ•จ๋œ ์ด๋ฏธ์ง€์˜ ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 10.2.15.5958-1_4.2.11-ent์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: APPDB_AGENT_VERSION
11 value: 10.2.15.5958-1_4.2.11-ent

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: APPDB_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-appdb-ubi

Kubernetes Operator๊ฐ€ ํด๋Ÿฌ์Šคํ„ฐ์˜ Kubernetes API ์„œ๋ฒ„ ์— ์—ฐ๊ฒฐ์„ ์‹œ๋„ํ•˜๋Š” ์‹œ๊ฐ„(์ดˆ) ์—”๋“œํฌ์ธํŠธ. ์ด ์‹œ๊ฐ„ ์ œํ•œ์€ ๋‹ค์ค‘ Kubernetes ํด๋Ÿฌ์Šคํ„ฐ MongoDB ๋ฐฐํฌ์˜ ๋ชจ๋“  Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•ด ์„ค์ •๋ฉ๋‹ˆ๋‹ค. Kubernetes Operator๊ฐ€ ์ง€์ •๋œ ์‹œ๊ฐ„ ๋‚ด์— Kubernetes API ์„œ๋ฒ„๋กœ๋ถ€ํ„ฐ ์‘๋‹ต์„ ๋ฐ›์ง€ ๋ชปํ•˜๋ฉด ํด๋Ÿฌ์Šคํ„ฐ ์ƒํƒœ๋ฅผ '๋น„์ •์ƒ'์œผ๋กœ ๊ธฐ๋กํ•ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ Kubernetes ํด๋Ÿฌ์Šคํ„ฐ ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๊ธฐ๋ณธ๊ฐ’์€ 10 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: CLUSTER_CLIENT_TIMEOUT
11 value: 10

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ๋ฐฐํฌํ•˜๋Š” MongoDB Enterprise ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์˜ ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: DATABASE_VERSION
11 value: 1.29

pull ์ •์ฑ… Kubernetes Operator๊ฐ€ ๋ฐฐํฌํ•˜๋Š” MongoDB Enterprise ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์˜ ๊ฒฝ์šฐ.

Kubernetes ์—ฐ์‚ฐ์ž๋Š” ํ•ญ์ƒ, IfNotPresent, ์ ˆ๋Œ€ ๊ฐ’์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ ํ•ญ์ƒ ์ž…๋‹ˆ๋‹ค.

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_APPDB_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-init-appdb-ubi

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€์˜ ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 1.29 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_APPDB_VERSION
11 value: 1.29

MongoDB Agent ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_DATABASE_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-init-database-ubi

MongoDB Agent ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€์˜ ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 1.29 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_DATABASE_VERSION
11 value: 1.29

Ops Manager ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_OPS_MANAGER_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-init-ops-manager-ubi

Ops Manager ์‹œ์ž‘ ์Šคํฌ๋ฆฝํŠธ ๋ฐ ์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ๊ฐ€ ํฌํ•จ๋œ initContainer ์ด๋ฏธ์ง€์˜ ๋ฒ„์ „์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 1.29 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: INIT_OPS_MANAGER_VERSION
11 value: 1.29

Readiness Probe์—์„œ ์œ ์ง€ ๊ด€๋ฆฌํ•˜๋Š” ์ˆœํ™˜๋œ readiness.log ๋ฐฑ์—… ํŒŒ์ผ์˜ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ /var/log/mongodb-mms-automation/readiness.log์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: LOG_FILE_PATH
11 value: /var/log/mongodb-mms-automation/readiness.log

Kubernetes Operator๊ฐ€ Kubernetes cluster๊ฐ€ managedํ•˜๋Š” securityContext ์„ค์ •์„ ์ƒ์†ํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ํ”Œ๋ž˜๊ทธ์ž…๋‹ˆ๋‹ค.

OpenShift ๋˜๋Š” ์ œํ•œ์ ์ธ ํ™˜๊ฒฝ์—์„œ Kubernetes Operator๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด ์ด ๊ฐ’์ด true ์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ false ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MANAGED_SECURITY_CONTEXT
11 value: false

๊ธฐ๋ณธ๊ฐ’์€ true ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MANAGED_SECURITY_CONTEXT
11 value: true

Kubernetes Operator๊ฐ€ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด MongoDB Agent ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ URL ์ž…๋‹ˆ๋‹ค. ์ž์„ธํžˆ ์•Œ์•„๋ณด๋ ค๋ฉด ์ปจํ…Œ์ด๋„ˆ ์ด๋ฏธ์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_AGENT_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-agent-ubi

Kubernetes Operator 1.20 ์—์„œ ์ปจํ…Œ์ด๋„ˆ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ ๊ฐ€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋ฉฐ ์ด๋ฏธ์ง€๋Š” ์ƒˆ ํƒœ๊ทธ๋ฅผ ์ง€์ •ํ•˜๋‹ค ์ ‘๋ฏธ์‚ฌ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋ฅผ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•˜๋ฉด Kubernetes Operator Kubernetes ์ƒˆ ์ปจํ…Œ์ด๋„ˆ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ๋ฅผ -ubi8 ๋˜๋Š” MDB_IMAGE_TYPE ๋˜๋Š” mongodb.imageType์— ์„ค์ •ํ•˜๋‹ค ์ ‘๋ฏธ์‚ฌ๋กœ ์ฐธ์กฐํ•˜๋Š” ๋ชจ๋“  ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ์ด์ „ ์ ‘๋ฏธ์‚ฌ -ent ๋ฅผ ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, Kubernetes ์—ฐ์‚ฐ์ž๋Š” quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent ์„ quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8 ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ์ ‘๋ฏธ์‚ฌ๋ฅผ ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜์ง€ ์•Š๋„๋ก ํ•˜๋ ค๋ฉด MDB_APPDB_ASSUME_OLD_FORMAT ๋˜๋Š” mongodb.appdbAssumeOldFormat ์„ true ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ž์ฒด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ์ด ์ด๋ฏธ์ง€๋ฅผ ๋ฏธ๋Ÿฌ๋งํ•˜๋Š” ๊ฒฝ์šฐ ์ž๋™ ์ ‘๋ฏธ์‚ฌ ๋ณ€๊ฒฝ์„ ์ค‘์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ false ์ด๋ฉฐ, ์ด๋ฏธ์ง€ ์ ‘๋ฏธ์‚ฌ๋ฅผ ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_APPDB_ASSUME_OLD_FORMAT
11 value: false

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ํŒŒ๋“œ๋‹น MongoDB ๋ฆฌ์†Œ์Šค์— ๋Œ€ํ•œ ์ž๋™ ๋ณต๊ตฌ๋ฅผ ํ™œ์„ฑํ™”ํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •ํ•˜๋Š” ํ”Œ๋ž˜๊ทธ์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ true ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_AUTOMATIC_RECOVERY_ENABLE
11 value: false

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ MongoDB ๋ฆฌ์†Œ์Šค๋ฅผ ์ž๋™์œผ๋กœ ๋ณต๊ตฌํ•˜๊ธฐ ์ „์— ์‚ฌ์šฉ์ž ์ง€์ • ๋ฆฌ์†Œ์Šค๊ฐ€ Pending ๋˜๋Š” Failed ์ƒํƒœ๋กœ ์œ ์ง€๋  ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„(์ดˆ)์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 1200 ์ดˆ(20๋ถ„)์ž…๋‹ˆ๋‹ค.

์ž๋™ ๋ณต๊ตฌ๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด MDB_AUTOMATIC_RECOVERY_ENABLE ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ false ๋กœ ์„ค์ •ํ•˜๋‹ค ํ•ฉ๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_AUTOMATIC_RECOVERY_BACKOFF_TIME_S
11 value: 3600

๋ชจ๋“  ๋ฐฐํฌ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์ปจํ…Œ์ด๋„ˆ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค.

๋‹จ์ผ ๋ฐฐํฌ์„œ๋ฒ„ ์— ๋Œ€ํ•ด ์ •์  ์ปจํ…Œ์ด๋„ˆ๋ฅผ ํ™œ์„ฑํ™” ํ•˜๋ ค๋ฉด metadata.annotations.mongodb.com/v1.architecture MongoDB ๋ฆฌ์†Œ์Šค ์—์„œ ๋ฅผ ๋Œ€์‹  ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ non-static์ž…๋‹ˆ๋‹ค.

์ •์  ์ปจํ…Œ์ด๋„ˆ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด static ์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_DEFAULT_ARCHITECTURE
11 value: static

์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์˜ ์ ‘๋ฏธ์‚ฌ์ž…๋‹ˆ๋‹ค.

Kubernetes Operator 1.20 ์—์„œ ์ปจํ…Œ์ด๋„ˆ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ ๊ฐ€ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ๋ณ€๊ฒฝ๋˜์—ˆ์œผ๋ฉฐ ์ด๋ฏธ์ง€๋Š” ์ƒˆ ํƒœ๊ทธ๋ฅผ ์ง€์ •ํ•˜๋‹ค ์ ‘๋ฏธ์‚ฌ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋ฅผ ์—…๊ทธ๋ ˆ์ด๋“œ ํ•˜๋ฉด Kubernetes Operator Kubernetes ์ƒˆ ์ปจํ…Œ์ด๋„ˆ ๋ ˆ์ง€์ŠคํŠธ๋ฆฌ๋ฅผ -ubi8 ๋˜๋Š” MDB_IMAGE_TYPE ๋˜๋Š” mongodb.imageType์— ์„ค์ •ํ•˜๋‹ค ์ ‘๋ฏธ์‚ฌ๋กœ ์ฐธ์กฐํ•˜๋Š” ๋ชจ๋“  ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ์ด์ „ ์ ‘๋ฏธ์‚ฌ -ent ๋ฅผ ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, Kubernetes ์—ฐ์‚ฐ์ž๋Š” quay.io/mongodb/mongodb-enterprise-server:4.4.5-ent ์„ quay.io/mongodb/mongodb-enterprise-server:4.4.5-ubi8 ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ์ ‘๋ฏธ์‚ฌ๋ฅผ ์ž๋™์œผ๋กœ ์—…๋ฐ์ดํŠธํ•˜์ง€ ์•Š๋„๋ก ํ•˜๋ ค๋ฉด MDB_APPDB_ASSUME_OLD_FORMAT ๋˜๋Š” mongodb.appdbAssumeOldFormat ์„ true ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ž์ฒด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ์ด ์ด๋ฏธ์ง€๋ฅผ ๋ฏธ๋Ÿฌ๋งํ•˜๋Š” ๊ฒฝ์šฐ ์ž๋™ ์ ‘๋ฏธ์‚ฌ ๋ณ€๊ฒฝ์„ ์ค‘์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ -ubi8์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_IMAGE_TYPE
11 value: ubi8

kubectl describe ์‹คํ–‰ ๋•Œ์™€ ๊ฐ™์ด ๋กœ๊ทธ ํŒŒ์ผ์„ ํ‘œ์ค€ ์ถœ๋ ฅ์œผ๋กœ ์ถœ๋ ฅํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ true์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MDB_WITH_AGENT_FILE_LOGGING
11 value: true

Kubernetes Operator๊ฐ€ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๋™์‹œ ์กฐ์ • ํ”„๋กœ์„ธ์Šค์˜ ์ˆ˜์ž…๋‹ˆ๋‹ค.

์˜ˆ์‹œ

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - env:
7 - name: MDB_MAX_CONCURRENT_RECONCILES
8 value: "10"

Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ๋ฐฐํฌํ•˜๋Š” MongoDB Enterprise ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ด๋ฏธ์ง€์˜ URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: MONGODB_ENTERPRISE_DATABASE_IMAGE
11 value: quay.io/mongodb/mongodb-enterprise-database-ubi

Kubernetes ์—ฐ์‚ฐ์ž ๋ฐฐํฌ ํ™˜๊ฒฝ์˜ ๋ ˆ์ด๋ธ”์ž…๋‹ˆ๋‹ค. ์ด ๊ฐ’์€ ๊ธฐ๋ณธ ์‹œ๊ฐ„ ์ดˆ๊ณผ์™€ ๋กœ๊น… ์ˆ˜์ค€ ๋ฐ ํ˜•์‹์— ์˜ํ–ฅ์„ ์ค๋‹ˆ๋‹ค.

๊ฐ’์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.
๋กœ๊ทธ ์ˆ˜์ค€์ด ๋‹ค์Œ์œผ๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ
๋กœ๊ทธ ํ˜•์‹์ด ๋‹ค์Œ์œผ๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ
dev
debug
text
prod
์ •๋ณด
JSON

๊ธฐ๋ณธ๊ฐ’์€ prod ์ž…๋‹ˆ๋‹ค.

pull ์ •์ฑ… Operator๊ฐ€ ๋ฐฐํฌํ•˜๋Š” MongoDB Ops Manager ์ด๋ฏธ์ง€์˜ ๊ฒฝ์šฐ.Kubernetes

Kubernetes ์—ฐ์‚ฐ์ž๋Š” ํ•ญ์ƒ, IfNotPresent ๋ฐ ์ ˆ๋Œ€ ๊ฐ’์„ ํ—ˆ์šฉํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ ํ•ญ์ƒ ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: OPS_MANAGER_IMAGE_PULL_POLICY
11 value: Always

Ops Manager ๋ฆฌ์†Œ์Šค ์˜ ์ด๋ฏธ์ง€๊ฐ€ ๋‹ค์šด๋กœ๋“œ๋˜๋Š” ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜URL ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: OPS_MANAGER_IMAGE_REPOSITORY
11 value: quay.io/mongodb/mongodb-enterprise-ops-manager-ubi

์ค€๋น„์„ฑ ํ”„๋กœ๋ธŒ์—์„œ ์œ ์ง€ ๊ด€๋ฆฌํ•˜๋Š” ์ˆœํ™˜๋œ readiness.log ๋ฐฑ์—… ํŒŒ์ผ์˜ ์ˆ˜์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 5 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: READINESS_PROBE_LOGGER_BACKUPS
11 value: 1

Readiness Probe์—์„œ ์œ ์ง€ ๊ด€๋ฆฌํ•˜๋Š” ์ˆœํ™˜๋œ readiness.log ๋ฐฑ์—… ํŒŒ์ผ์„ readiness.log.gz ํŒŒ์ผ๋กœ ์••์ถ•ํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’ ์€ false ์ด๋ฉฐ, readiness.log ํŒŒ์ผ์€ ์••์ถ•๋˜์ง€ ์•Š์€ ์ƒํƒœ๋กœ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: READINESS_PROBE_LOGGER_COMPRESS
11 value: true

readiness.log ํŒŒ์ผ์˜ ์ตœ๋Œ€ ํฌ๊ธฐ(MB)์ž…๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 100 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: READINESS_PROBE_LOGGER_MAX_SIZE
11 value: 125

ํŒŒ์ผ ํƒ€์ž„์Šคํƒฌํ”„์˜ ๋‚ ์งœ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•˜์—ฌ ๋กœํ…Œ์ด์…˜๋œ readiness.log ํŒŒ์ผ์„ ๋ณด๊ด€ํ•  ์ตœ๋Œ€ ์ผ์ˆ˜์ž…๋‹ˆ๋‹ค. 0 ์œผ๋กœ ์„ค์ •ํ•˜๋ฉด Kubernetes Operator๋Š” ๊ธฐ๊ฐ„์„ ๊ธฐ์ค€์œผ๋กœ readiness.log ํŒŒ์ผ์„ ์ œ๊ฑฐํ•˜์ง€ ์•Š๊ณ  ๋Œ€์‹  READINESS_PROBE_LOGGER_BACKUPS ์— ๋”ฐ๋ผ ๋ณด์กด์„ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ๋ณธ๊ฐ’์€ 0 ์ž…๋‹ˆ๋‹ค.

1spec:
2 template:
3 spec:
4 serviceAccountName: mongodb-enterprise-operator
5 containers:
6 - name: mongodb-enterprise-operator
7 image: <operatorVersionUrl>
8 imagePullPolicy: <policyChoice>
9 env:
10 - name: READINESS_PROBE_LOGGER_MAX_AGE
11 value: 3

Kubernetes Operator๊ฐ€ MongoDB ๋ฆฌ์†Œ์Šค ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ๊ฐ์‹œํ•˜๋Š” ๋„ค์ž„์ŠคํŽ˜์ด์Šค์ž…๋‹ˆ๋‹ค. ์ด ๋„ค์ž„์ŠคํŽ˜์ด์Šค ๊ฐ€ ๊ธฐ๋ณธ๊ฐ’๊ณผ ๋‹ค๋ฅธ ๊ฒฝ์šฐ, Kubernetes Operator ServiceAccount ๊ฐ€ ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”. ์ด ๋„ค์ž„์ŠคํŽ˜์ด์Šค.

  • ๋ชจ๋“  ๋„ค์ž„์ŠคํŽ˜์ด์Šค ๋ฅผ ๊ฐ์‹œํ•˜๋ ค๋ฉด * ๋ฅผ ์ง€์ •ํ•˜๊ณ  ClusterRole ์„ mongodb-enterprise-operator ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. Kubernetes Operator๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•˜๋Š” ServiceAccount์— ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

  • ๋ชจ๋“  ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ ํ•˜์œ„ ์ง‘ํ•ฉ ์„ ๊ฐ์‹œํ•˜๋ ค๋ฉด ์‰ผํ‘œ๋กœ ๊ตฌ๋ถ„๋œ ๋ชฉ๋ก์œผ๋กœ ์ง€์ •ํ•˜๊ณ  ๊ฐ ์‰ผํ‘œ๋ฅผ ๋ฐฑ์Šฌ๋ž˜์‹œ๋กœ ์ด์Šค์ผ€์ดํ”„ ์ฒ˜๋ฆฌํ•œ ๋‹ค์Œ ๋ชฉ๋ก์„ ๋”ฐ์˜ดํ‘œ๋กœ ๋ฌถ์Šต๋‹ˆ๋‹ค(์˜ˆ: "operator.watchNamespace=ns1\,ns2".

๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ ํ•˜์œ„ ์ง‘ํ•ฉ์„ ๊ฐ์‹œํ•˜๋Š” ๊ฒƒ์€ ๋‹จ์ผ Kubernetes ์—ฐ์‚ฐ์ž ์ธ์Šคํ„ด์Šค๊ฐ€ ๋‹ค๋ฅธ ํด๋Ÿฌ์Šคํ„ฐ ๋ฆฌ์†Œ์Šค ์œ ํ˜•์„ ๊ฐ์‹œํ•˜๋Š” ๋ฐฐํฌ์—์„œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ ํ•œ ํ•˜์œ„ ์ง‘ํ•ฉ์—์„œ MongoDB ๋ฆฌ์†Œ์Šค๋ฅผ ๊ฐ์‹œํ•˜๊ณ  ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ ๋‹ค๋ฅธ ํ•˜์œ„ ์ง‘ํ•ฉ์—์„œ MongoDBMultiCluster ๋ฆฌ์†Œ์Šค๋ฅผ ๊ฐ์‹œํ•˜๋„๋ก Kubernetes ์—ฐ์‚ฐ์ž๋ฅผ ๊ตฌ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฆฌ์†Œ์Šค ์กฐ์ • ์ค‘์— ๊ฒฝํ•ฉ ์ƒํƒœ๋ฅผ ๋ฐฉ์ง€ํ•˜๋ ค๋ฉด Kubernetes ์—ฐ์‚ฐ์ž๊ฐ€ ๊ฐ์‹œํ•˜๋ ค๋Š” ๊ฐ ์‚ฌ์šฉ์ž ์ง€์ • ๋ฆฌ์†Œ์Šค ์œ ํ˜•์— ๋Œ€ํ•ด ๋ฒ”์œ„๋ฅผ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ ๊ณ ์œ ํ•œ ํ•˜์œ„ ์ง‘ํ•ฉ์œผ๋กœ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ค‘์š”

ํ•˜๋‚˜ ์ด์ƒ์˜ ๋„ค์ž„์ŠคํŽ˜์ด์Šค ์— MongoDB Ops Manager ๋ฐ ๋ฆฌ์†Œ์Šค๋ฅผ MongoDB Kubernetes ๋ฐฐํฌํ•˜๋ ค๋ฉด ๋‹ค์Œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. Operator๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๊ฒฝ์šฐ ์™ธ์— ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ๊ฐ’๊ณผ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•  ์ถ”๊ฐ€ ๋‹จ๊ณ„๋Š” ๋ฐฐํฌ์˜ ๋ฒ”์œ„ ์„ค์ • ์„ ์ฐธ์กฐํ•˜์„ธ์š”.MongoDB Enterprise Kubernetes Operator

๊ธฐ๋ณธ๊ฐ’์€ <metadata.namespace> ์ž…๋‹ˆ๋‹ค.

๋Œ์•„๊ฐ€๊ธฐ

์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ์„ค์น˜ ์„ค์ •