diff --git a/charts/atlas-advanced/.helmignore b/charts/atlas-advanced/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/atlas-advanced/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/atlas-advanced/Chart.yaml b/charts/atlas-advanced/Chart.yaml new file mode 100644 index 00000000..5c89f17d --- /dev/null +++ b/charts/atlas-advanced/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: atlas-advanced +description: This chart showcases Atlas Advanced (dedicated) deployment + +type: application + +version: 1.0.0 + +keywords: + - mongodb + - database + - nosql +home: https://github.com/mongodb/mongodb-atlas-kubernetes +icon: https://webimages.mongodb.com/_com_assets/cms/kuyjf3vea2hg34taa-horizontal_default_slate_blue.svg +appVersion: "2.4.1" +maintainers: + - name: MongoDB + email: support@mongodb.com diff --git a/charts/atlas-advanced/templates/_helpers.tpl b/charts/atlas-advanced/templates/_helpers.tpl new file mode 100644 index 00000000..3487d765 --- /dev/null +++ b/charts/atlas-advanced/templates/_helpers.tpl @@ -0,0 +1,86 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "atlas-advanced.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "atlas-advanced.fullname" -}} +{{- if .Values.deployment.name }} +{{- .Values.deployment.name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.deployment.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{- define "atlas-advanced.projectfullname" -}} +{{- if .Values.project.name }} +{{- .Values.project.name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.project.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "atlas-advanced.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "atlas-advanced.labels" -}} +helm.sh/chart: {{ include "atlas-advanced.chart" . }} +{{ include "atlas-advanced.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "atlas-advanced.selectorLabels" -}} +app.kubernetes.io/name: {{ include "atlas-advanced.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{- define "generateRandomString" -}} +{{ randAlphaNum 5 }} +{{- end }} + +{{- define "getInstanceSizeOrFail" -}} +{{- $arg := . -}} +{{ $instances := list "M10" "M20" "M30" "M40" "M50" "M60" "M80" "M100" "M140" "M200" "M300" "R40" "R50" "R60" "R80" "R200" "R300" "R400" "R700" "M40_NVME" "M50_NVME" "M60_NVME" "M80_NVME" "M200_NVME" "M400_NVME" }} +{{- if not (has (toString $arg) $instances)}} +{{- fail (printf "Instance size can only be one of: %s " (join "," $instances)) }} +{{- end }} +{{- $arg -}} +{{- end }} + +{{- define "getProviderNameOrFail" -}} +{{- $arg := . -}} +{{ $providers := list "AWS" "GCP" "AZURE" }} +{{- if not (has (toString $arg) $providers) }} +{{- fail (printf "Provider name can only be one of: %s. Got %s" (join "," $providers) $arg) }} +{{- end }} +{{- $arg -}} +{{- end }} \ No newline at end of file diff --git a/charts/atlas-advanced/templates/atlas-deployment.yaml b/charts/atlas-advanced/templates/atlas-deployment.yaml new file mode 100644 index 00000000..34f53c20 --- /dev/null +++ b/charts/atlas-advanced/templates/atlas-deployment.yaml @@ -0,0 +1,33 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasDeployment +metadata: + name: {{ include "atlas-advanced.fullname" $ }} + labels: + {{- include "atlas-advanced.labels" $ | nindent 4 }} + namespace: {{ $.Release.Namespace }} +spec: + projectRef: + name: {{ include "atlas-advanced.projectfullname" $ }} + namespace: {{ $.Release.Namespace }} + deploymentSpec: + name: {{ include "atlas-advanced.fullname" $ }} + clusterType: REPLICASET + replicationSpecs: + - zoneName: Zone 1 + regionConfigs: + {{- range $idx, $val := index .Values.deployment.regions }} + - regionName: {{ $val.name }} + electableSpecs: + instanceSize: {{ include "getInstanceSizeOrFail" $val.instanceSize }} + nodeCount: {{ $val.nodeCount }} + providerName: {{ include "getProviderNameOrFail" $val.providerName }} + backingProviderName: {{ include "getProviderNameOrFail" $val.providerName }} + priority: {{ $val.priority }} + {{- if $val.autoscaling.enabled }} + autoScaling: + compute: + enabled: true + minInstanceSize: {{ include "getInstanceSizeOrFail" $val.autoscaling.min }} + maxInstanceSize: {{ include "getInstanceSizeOrFail" $val.autoscaling.max }} + {{- end }} + {{- end }} diff --git a/charts/atlas-advanced/templates/atlas-mongodb-user-secret.yaml b/charts/atlas-advanced/templates/atlas-mongodb-user-secret.yaml new file mode 100644 index 00000000..056a6338 --- /dev/null +++ b/charts/atlas-advanced/templates/atlas-mongodb-user-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "atlas-advanced.fullname" $ }}-{{ .Values.dbUser.name }} + namespace: {{ $.Release.Namespace }} + labels: + atlas.mongodb.com/type: "credentials" + {{- include "atlas-advanced.labels" $ | nindent 4 }} +type: Opaque +stringData: + password: {{ .Values.dbUser.password | default (randAlphaNum 32 | b64enc)| quote }} diff --git a/charts/atlas-advanced/templates/atlas-mongodb-user.yaml b/charts/atlas-advanced/templates/atlas-mongodb-user.yaml new file mode 100644 index 00000000..bb9903d9 --- /dev/null +++ b/charts/atlas-advanced/templates/atlas-mongodb-user.yaml @@ -0,0 +1,18 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasDatabaseUser +metadata: + name: {{ include "atlas-advanced.fullname" $ }}-{{ .Values.dbUser.name }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "atlas-advanced.labels" $ | nindent 4 }} +spec: + username: {{ .Values.dbUser.name }} + databaseName: {{ .Values.dbUser.databaseName }} + passwordSecretRef: + name: {{ include "atlas-advanced.fullname" $ }}-{{ .Values.dbUser.name }} + projectRef: + name: {{ include "atlas-advanced.projectfullname" $ }} + namespace: {{ $.Release.Namespace }} + roles: + - roleName: "readWriteAnyDatabase" + databaseName: "admin" diff --git a/charts/atlas-advanced/templates/atlas-project.yaml b/charts/atlas-advanced/templates/atlas-project.yaml new file mode 100644 index 00000000..ef6a43f8 --- /dev/null +++ b/charts/atlas-advanced/templates/atlas-project.yaml @@ -0,0 +1,15 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasProject +metadata: + name: {{ include "atlas-advanced.projectfullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "atlas-advanced.labels" . | nindent 4 }} +spec: + name: {{ include "atlas-advanced.projectfullname" . }} + connectionSecretRef: + name: {{ include "atlas-advanced.fullname" . }}-secret + namespace: {{ $.Release.Namespace }} + projectIpAccessList: + - comment: "Example" + cidrBlock: {{ .Values.project.cidrEntry }} diff --git a/charts/atlas-advanced/templates/atlas-secret.yaml b/charts/atlas-advanced/templates/atlas-secret.yaml new file mode 100644 index 00000000..02806218 --- /dev/null +++ b/charts/atlas-advanced/templates/atlas-secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ include "atlas-advanced.fullname" . }}-secret + namespace: {{ .Release.Namespace }} + labels: + atlas.mongodb.com/type: "credentials" +data: + orgId: {{ .Values.secret.orgID | b64enc }} + publicApiKey: {{ .Values.secret.publicKey | b64enc }} + privateApiKey: {{ .Values.secret.privateKey | b64enc }} diff --git a/charts/atlas-advanced/values.yaml b/charts/atlas-advanced/values.yaml new file mode 100644 index 00000000..0d12630a --- /dev/null +++ b/charts/atlas-advanced/values.yaml @@ -0,0 +1,43 @@ +secret: + orgID: "" + privateKey: "" + publicKey: "" + +project: + name: "" + cidrEntry: 0.0.0.0/0 + +deployment: + regions: + # For AWS: "US_GOV_WEST_1" "US_GOV_EAST_1" "US_EAST_1" "US_EAST_2" "US_WEST_1" "US_WEST_2" "CA_CENTRAL_1" "EU_NORTH_1" "EU_WEST_1" "EU_WEST_2" "EU_WEST_3" "EU_CENTRAL_1" "EU_CENTRAL_2" "AP_EAST_1" "AP_NORTHEAST_1" "AP_NORTHEAST_2" "AP_NORTHEAST_3" "AP_SOUTHEAST_1" "AP_SOUTHEAST_2" "AP_SOUTHEAST_3" "AP_SOUTHEAST_4" "AP_SOUTH_1" "AP_SOUTH_2" "SA_EAST_1" "CN_NORTH_1" "CN_NORTHWEST_1" "ME_SOUTH_1" "ME_CENTRAL_1" "AF_SOUTH_1" "EU_SOUTH_1" "EU_SOUTH_2" "IL_CENTRAL_1" "CA_WEST_1" "GLOBAL" + # For GCP: "EASTERN_US" "EASTERN_US_AW" "US_EAST_4" "US_EAST_4_AW" "US_EAST_5" "US_EAST_5_AW" "US_WEST_2" "US_WEST_2_AW" "US_WEST_3" "US_WEST_3_AW" "US_WEST_4" "US_WEST_4_AW" "US_SOUTH_1" "US_SOUTH_1_AW" "CENTRAL_US" "CENTRAL_US_AW" "WESTERN_US" "WESTERN_US_AW" "NORTH_AMERICA_NORTHEAST_1" "NORTH_AMERICA_NORTHEAST_2" "SOUTH_AMERICA_EAST_1" "SOUTH_AMERICA_WEST_1" "WESTERN_EUROPE" "EUROPE_NORTH_1" "EUROPE_WEST_2" "EUROPE_WEST_3" "EUROPE_WEST_4" "EUROPE_WEST_6" "EUROPE_WEST_8" "EUROPE_WEST_9" "EUROPE_WEST_10" "EUROPE_WEST_12" "EUROPE_SOUTHWEST_1" "EUROPE_CENTRAL_2" "MIDDLE_EAST_CENTRAL_1" "MIDDLE_EAST_CENTRAL_2" "MIDDLE_EAST_WEST_1" "AUSTRALIA_SOUTHEAST_1" "AUSTRALIA_SOUTHEAST_2" "EASTERN_ASIA_PACIFIC" "NORTHEASTERN_ASIA_PACIFIC" "SOUTHEASTERN_ASIA_PACIFIC" "ASIA_EAST_2" "ASIA_NORTHEAST_2" "ASIA_NORTHEAST_3" "ASIA_SOUTH_1" "ASIA_SOUTH_2" "ASIA_SOUTHEAST_2" + # FOR AZURE: "US_CENTRAL" "US_EAST" "US_EAST_2" "US_NORTH_CENTRAL" "US_WEST" "US_SOUTH_CENTRAL" "EUROPE_NORTH" "EUROPE_WEST" "US_WEST_CENTRAL" "US_WEST_2" "US_WEST_3" "CANADA_EAST" "CANADA_CENTRAL" "BRAZIL_SOUTH" "BRAZIL_SOUTHEAST" "AUSTRALIA_CENTRAL" "AUSTRALIA_CENTRAL_2" "AUSTRALIA_EAST" "AUSTRALIA_SOUTH_EAST" "GERMANY_CENTRAL" "GERMANY_NORTH_EAST" "GERMANY_WEST_CENTRAL" "GERMANY_NORTH" "SWEDEN_CENTRAL" "SWEDEN_SOUTH" "SWITZERLAND_NORTH" "SWITZERLAND_WEST" "UK_SOUTH" "UK_WEST" "NORWAY_EAST" "NORWAY_WEST" "INDIA_CENTRAL" "INDIA_SOUTH" "INDIA_WEST" "CHINA_EAST" "CHINA_NORTH" "ASIA_EAST" "JAPAN_EAST" "JAPAN_WEST" "ASIA_SOUTH_EAST" "KOREA_CENTRAL" "KOREA_SOUTH" "FRANCE_CENTRAL" "FRANCE_SOUTH" "SOUTH_AFRICA_NORTH" "SOUTH_AFRICA_WEST" "UAE_CENTRAL" "UAE_NORTH" "QATAR_CENTRAL" + # See the up to date list of regions and providers here: https://www.mongodb.com/docs/atlas/cloud-providers-regions/ + - name: US_EAST_1 + providerName: AWS + instanceSize: M10 + nodeCount: 2 + priority: 7 + autoscaling: + enabled: true + min: M10 + max: M20 + # For AWS: "US_GOV_WEST_1" "US_GOV_EAST_1" "US_EAST_1" "US_EAST_2" "US_WEST_1" "US_WEST_2" "CA_CENTRAL_1" "EU_NORTH_1" "EU_WEST_1" "EU_WEST_2" "EU_WEST_3" "EU_CENTRAL_1" "EU_CENTRAL_2" "AP_EAST_1" "AP_NORTHEAST_1" "AP_NORTHEAST_2" "AP_NORTHEAST_3" "AP_SOUTHEAST_1" "AP_SOUTHEAST_2" "AP_SOUTHEAST_3" "AP_SOUTHEAST_4" "AP_SOUTH_1" "AP_SOUTH_2" "SA_EAST_1" "CN_NORTH_1" "CN_NORTHWEST_1" "ME_SOUTH_1" "ME_CENTRAL_1" "AF_SOUTH_1" "EU_SOUTH_1" "EU_SOUTH_2" "IL_CENTRAL_1" "CA_WEST_1" "GLOBAL" + # For GCP: "EASTERN_US" "EASTERN_US_AW" "US_EAST_4" "US_EAST_4_AW" "US_EAST_5" "US_EAST_5_AW" "US_WEST_2" "US_WEST_2_AW" "US_WEST_3" "US_WEST_3_AW" "US_WEST_4" "US_WEST_4_AW" "US_SOUTH_1" "US_SOUTH_1_AW" "CENTRAL_US" "CENTRAL_US_AW" "WESTERN_US" "WESTERN_US_AW" "NORTH_AMERICA_NORTHEAST_1" "NORTH_AMERICA_NORTHEAST_2" "SOUTH_AMERICA_EAST_1" "SOUTH_AMERICA_WEST_1" "WESTERN_EUROPE" "EUROPE_NORTH_1" "EUROPE_WEST_2" "EUROPE_WEST_3" "EUROPE_WEST_4" "EUROPE_WEST_6" "EUROPE_WEST_8" "EUROPE_WEST_9" "EUROPE_WEST_10" "EUROPE_WEST_12" "EUROPE_SOUTHWEST_1" "EUROPE_CENTRAL_2" "MIDDLE_EAST_CENTRAL_1" "MIDDLE_EAST_CENTRAL_2" "MIDDLE_EAST_WEST_1" "AUSTRALIA_SOUTHEAST_1" "AUSTRALIA_SOUTHEAST_2" "EASTERN_ASIA_PACIFIC" "NORTHEASTERN_ASIA_PACIFIC" "SOUTHEASTERN_ASIA_PACIFIC" "ASIA_EAST_2" "ASIA_NORTHEAST_2" "ASIA_NORTHEAST_3" "ASIA_SOUTH_1" "ASIA_SOUTH_2" "ASIA_SOUTHEAST_2" + # FOR AZURE: "US_CENTRAL" "US_EAST" "US_EAST_2" "US_NORTH_CENTRAL" "US_WEST" "US_SOUTH_CENTRAL" "EUROPE_NORTH" "EUROPE_WEST" "US_WEST_CENTRAL" "US_WEST_2" "US_WEST_3" "CANADA_EAST" "CANADA_CENTRAL" "BRAZIL_SOUTH" "BRAZIL_SOUTHEAST" "AUSTRALIA_CENTRAL" "AUSTRALIA_CENTRAL_2" "AUSTRALIA_EAST" "AUSTRALIA_SOUTH_EAST" "GERMANY_CENTRAL" "GERMANY_NORTH_EAST" "GERMANY_WEST_CENTRAL" "GERMANY_NORTH" "SWEDEN_CENTRAL" "SWEDEN_SOUTH" "SWITZERLAND_NORTH" "SWITZERLAND_WEST" "UK_SOUTH" "UK_WEST" "NORWAY_EAST" "NORWAY_WEST" "INDIA_CENTRAL" "INDIA_SOUTH" "INDIA_WEST" "CHINA_EAST" "CHINA_NORTH" "ASIA_EAST" "JAPAN_EAST" "JAPAN_WEST" "ASIA_SOUTH_EAST" "KOREA_CENTRAL" "KOREA_SOUTH" "FRANCE_CENTRAL" "FRANCE_SOUTH" "SOUTH_AFRICA_NORTH" "SOUTH_AFRICA_WEST" "UAE_CENTRAL" "UAE_NORTH" "QATAR_CENTRAL" + # See the up to date list of regions and providers here: https://www.mongodb.com/docs/atlas/cloud-providers-regions/ + - name: EUROPE_WEST_2 + providerName: GCP + instanceSize: M10 + priority: 6 + nodeCount: 1 + autoscaling: + enabled: true + min: M10 + max: M20 + name: "" + +dbUser: + name: admin + databaseName: admin + password: "" diff --git a/charts/atlas-basic/.helmignore b/charts/atlas-basic/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/atlas-basic/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/atlas-basic/Chart.yaml b/charts/atlas-basic/Chart.yaml new file mode 100644 index 00000000..c8f6ff2a --- /dev/null +++ b/charts/atlas-basic/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: atlas-basic +description: This chart showcases Atlas Basic (shared) deployment + +type: application + +version: 1.0.0 + +keywords: + - mongodb + - database + - nosql +home: https://github.com/mongodb/mongodb-atlas-kubernetes +icon: https://webimages.mongodb.com/_com_assets/cms/kuyjf3vea2hg34taa-horizontal_default_slate_blue.svg +appVersion: "2.4.1" +maintainers: + - name: MongoDB + email: support@mongodb.com diff --git a/charts/atlas-basic/templates/_helpers.tpl b/charts/atlas-basic/templates/_helpers.tpl new file mode 100644 index 00000000..7ea235ab --- /dev/null +++ b/charts/atlas-basic/templates/_helpers.tpl @@ -0,0 +1,84 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "atlas-basic.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "atlas-basic.fullname" -}} +{{- if .Values.deployment.name }} +{{- .Values.deployment.name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.deployment.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{- define "atlas-basic.projectfullname" -}} +{{- if .Values.project.name }} +{{- .Values.project.name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.project.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "atlas-basic.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "atlas-basic.labels" -}} +helm.sh/chart: {{ include "atlas-basic.chart" . }} +{{ include "atlas-basic.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "atlas-basic.selectorLabels" -}} +app.kubernetes.io/name: {{ include "atlas-basic.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{- define "generateRandomString" -}} +{{ randAlphaNum 5 }} +{{- end }} + +{{- define "getInstanceSizeOrFail" -}} +{{ $instances := list "M0" "M2" "M5"}} +{{- if not (has .Values.deployment.instanceSize $instances)}} +{{- fail "Instance size can only be one of M0, M2, M5" }} +{{- end }} +{{- .Values.deployment.instanceSize }} +{{- end }} + +{{- define "getProviderNameOrFail" -}} +{{ $providers := list "AWS" "GCP" "AZURE" }} +{{- if not (has .Values.deployment.providerName $providers) }} +{{- fail "Provider name can only be one of AWS, GCP, AZURE" }} +{{- end}} +{{- .Values.deployment.providerName }} +{{- end}} \ No newline at end of file diff --git a/charts/atlas-basic/templates/atlas-deployment.yaml b/charts/atlas-basic/templates/atlas-deployment.yaml new file mode 100644 index 00000000..d783fe65 --- /dev/null +++ b/charts/atlas-basic/templates/atlas-deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasDeployment +metadata: + name: {{ include "atlas-basic.fullname" $ }} + labels: + {{- include "atlas-basic.labels" $ | nindent 4 }} + namespace: {{ $.Release.Namespace }} +spec: + projectRef: + name: {{ include "atlas-basic.projectfullname" $ }} + namespace: {{ $.Release.Namespace }} + deploymentSpec: + name: {{ include "atlas-basic.fullname" $ }} + clusterType: REPLICASET + replicationSpecs: + - zoneName: Zone 1 + regionConfigs: + - electableSpecs: + instanceSize: {{ include "getInstanceSizeOrFail" $ }} + nodeCount: 1 + providerName: TENANT + backingProviderName: {{ include "getProviderNameOrFail" $ }} + regionName: {{ .Values.deployment.regionName }} + priority: 7 diff --git a/charts/atlas-basic/templates/atlas-mongodb-user-secret.yaml b/charts/atlas-basic/templates/atlas-mongodb-user-secret.yaml new file mode 100644 index 00000000..1fbffb1d --- /dev/null +++ b/charts/atlas-basic/templates/atlas-mongodb-user-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "atlas-basic.fullname" $ }}-{{ .Values.dbUser.name }} + namespace: {{ $.Release.Namespace }} + labels: + atlas.mongodb.com/type: "credentials" + {{- include "atlas-basic.labels" $ | nindent 4 }} +type: Opaque +stringData: + password: {{ .Values.dbUser.password | default (randAlphaNum 32 | b64enc)| quote }} diff --git a/charts/atlas-basic/templates/atlas-mongodb-user.yaml b/charts/atlas-basic/templates/atlas-mongodb-user.yaml new file mode 100644 index 00000000..ff38c9e0 --- /dev/null +++ b/charts/atlas-basic/templates/atlas-mongodb-user.yaml @@ -0,0 +1,18 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasDatabaseUser +metadata: + name: {{ include "atlas-basic.fullname" $ }}-{{ .Values.dbUser.name }} + namespace: {{ $.Release.Namespace }} + labels: + {{- include "atlas-basic.labels" $ | nindent 4 }} +spec: + username: {{ .Values.dbUser.name }} + databaseName: {{ .Values.dbUser.databaseName }} + passwordSecretRef: + name: {{ include "atlas-basic.fullname" $ }}-{{ .Values.dbUser.name }} + projectRef: + name: {{ include "atlas-basic.projectfullname" $ }} + namespace: {{ $.Release.Namespace }} + roles: + - roleName: "readWriteAnyDatabase" + databaseName: "admin" diff --git a/charts/atlas-basic/templates/atlas-project.yaml b/charts/atlas-basic/templates/atlas-project.yaml new file mode 100644 index 00000000..f14cb83f --- /dev/null +++ b/charts/atlas-basic/templates/atlas-project.yaml @@ -0,0 +1,15 @@ +apiVersion: atlas.mongodb.com/v1 +kind: AtlasProject +metadata: + name: {{ include "atlas-basic.projectfullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "atlas-basic.labels" . | nindent 4 }} +spec: + name: {{ include "atlas-basic.projectfullname" . }} + connectionSecretRef: + name: {{ include "atlas-basic.fullname" . }}-secret + namespace: {{ $.Release.Namespace }} + projectIpAccessList: + - comment: "Example" + cidrBlock: {{ .Values.project.cidrEntry }} diff --git a/charts/atlas-basic/templates/atlas-secret.yaml b/charts/atlas-basic/templates/atlas-secret.yaml new file mode 100644 index 00000000..dbec0e89 --- /dev/null +++ b/charts/atlas-basic/templates/atlas-secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +type: Opaque +metadata: + name: {{ include "atlas-basic.fullname" . }}-secret + namespace: {{ .Release.Namespace }} + labels: + atlas.mongodb.com/type: "credentials" +data: + orgId: {{ .Values.secret.orgID | b64enc }} + publicApiKey: {{ .Values.secret.publicKey | b64enc }} + privateApiKey: {{ .Values.secret.privateKey | b64enc }} diff --git a/charts/atlas-basic/values.yaml b/charts/atlas-basic/values.yaml new file mode 100644 index 00000000..145babf1 --- /dev/null +++ b/charts/atlas-basic/values.yaml @@ -0,0 +1,22 @@ +secret: + orgID: "" + privateKey: "" + publicKey: "" + +project: + name: "" + cidrEntry: 0.0.0.0/0 + +deployment: + name: "" + providerName: AWS + instanceSize: M2 + # For AWS: "US_GOV_WEST_1" "US_GOV_EAST_1" "US_EAST_1" "US_EAST_2" "US_WEST_1" "US_WEST_2" "CA_CENTRAL_1" "EU_NORTH_1" "EU_WEST_1" "EU_WEST_2" "EU_WEST_3" "EU_CENTRAL_1" "EU_CENTRAL_2" "AP_EAST_1" "AP_NORTHEAST_1" "AP_NORTHEAST_2" "AP_NORTHEAST_3" "AP_SOUTHEAST_1" "AP_SOUTHEAST_2" "AP_SOUTHEAST_3" "AP_SOUTHEAST_4" "AP_SOUTH_1" "AP_SOUTH_2" "SA_EAST_1" "CN_NORTH_1" "CN_NORTHWEST_1" "ME_SOUTH_1" "ME_CENTRAL_1" "AF_SOUTH_1" "EU_SOUTH_1" "EU_SOUTH_2" "IL_CENTRAL_1" "CA_WEST_1" "GLOBAL" + # For GCP: "EASTERN_US" "EASTERN_US_AW" "US_EAST_4" "US_EAST_4_AW" "US_EAST_5" "US_EAST_5_AW" "US_WEST_2" "US_WEST_2_AW" "US_WEST_3" "US_WEST_3_AW" "US_WEST_4" "US_WEST_4_AW" "US_SOUTH_1" "US_SOUTH_1_AW" "CENTRAL_US" "CENTRAL_US_AW" "WESTERN_US" "WESTERN_US_AW" "NORTH_AMERICA_NORTHEAST_1" "NORTH_AMERICA_NORTHEAST_2" "SOUTH_AMERICA_EAST_1" "SOUTH_AMERICA_WEST_1" "WESTERN_EUROPE" "EUROPE_NORTH_1" "EUROPE_WEST_2" "EUROPE_WEST_3" "EUROPE_WEST_4" "EUROPE_WEST_6" "EUROPE_WEST_8" "EUROPE_WEST_9" "EUROPE_WEST_10" "EUROPE_WEST_12" "EUROPE_SOUTHWEST_1" "EUROPE_CENTRAL_2" "MIDDLE_EAST_CENTRAL_1" "MIDDLE_EAST_CENTRAL_2" "MIDDLE_EAST_WEST_1" "AUSTRALIA_SOUTHEAST_1" "AUSTRALIA_SOUTHEAST_2" "EASTERN_ASIA_PACIFIC" "NORTHEASTERN_ASIA_PACIFIC" "SOUTHEASTERN_ASIA_PACIFIC" "ASIA_EAST_2" "ASIA_NORTHEAST_2" "ASIA_NORTHEAST_3" "ASIA_SOUTH_1" "ASIA_SOUTH_2" "ASIA_SOUTHEAST_2" + # FOR AZURE: "US_CENTRAL" "US_EAST" "US_EAST_2" "US_NORTH_CENTRAL" "US_WEST" "US_SOUTH_CENTRAL" "EUROPE_NORTH" "EUROPE_WEST" "US_WEST_CENTRAL" "US_WEST_2" "US_WEST_3" "CANADA_EAST" "CANADA_CENTRAL" "BRAZIL_SOUTH" "BRAZIL_SOUTHEAST" "AUSTRALIA_CENTRAL" "AUSTRALIA_CENTRAL_2" "AUSTRALIA_EAST" "AUSTRALIA_SOUTH_EAST" "GERMANY_CENTRAL" "GERMANY_NORTH_EAST" "GERMANY_WEST_CENTRAL" "GERMANY_NORTH" "SWEDEN_CENTRAL" "SWEDEN_SOUTH" "SWITZERLAND_NORTH" "SWITZERLAND_WEST" "UK_SOUTH" "UK_WEST" "NORWAY_EAST" "NORWAY_WEST" "INDIA_CENTRAL" "INDIA_SOUTH" "INDIA_WEST" "CHINA_EAST" "CHINA_NORTH" "ASIA_EAST" "JAPAN_EAST" "JAPAN_WEST" "ASIA_SOUTH_EAST" "KOREA_CENTRAL" "KOREA_SOUTH" "FRANCE_CENTRAL" "FRANCE_SOUTH" "SOUTH_AFRICA_NORTH" "SOUTH_AFRICA_WEST" "UAE_CENTRAL" "UAE_NORTH" "QATAR_CENTRAL" + regionName: US_EAST_1 + +dbUser: + name: admin + databaseName: admin + password: "" diff --git a/charts/atlas-deployment/Chart.yaml b/charts/atlas-deployment/Chart.yaml index 936b4e71..dd308c7b 100644 --- a/charts/atlas-deployment/Chart.yaml +++ b/charts/atlas-deployment/Chart.yaml @@ -4,15 +4,15 @@ description: A Helm chart to manage Atlas resources with Atlas operator type: application -version: 1.0.1 +version: 2.4.1 keywords: - mongodb - database - nosql home: https://github.com/mongodb/mongodb-enterprise-kubernetes -icon: https://camo.githubusercontent.com/d473c25e361fb2206f06bdcf24028e8d52bc30d1/68747470733a2f2f6d6f6e676f64622d6b756265726e657465732d6f70657261746f722e73332e616d617a6f6e6177732e636f6d2f696d672f4c6561662d466f7265737425343032782e706e67 -appVersion: "1.0.0" +icon: https://webimages.mongodb.com/_com_assets/cms/kuyjf3vea2hg34taa-horizontal_default_slate_blue.svg +appVersion: "2.4.1" maintainers: - name: MongoDB email: support@mongodb.com diff --git a/charts/atlas-operator/Chart.yaml b/charts/atlas-operator/Chart.yaml index e0df39a1..dbb79a63 100644 --- a/charts/atlas-operator/Chart.yaml +++ b/charts/atlas-operator/Chart.yaml @@ -13,7 +13,7 @@ keywords: - cluster - nosql home: https://github.com/mongodb/mongodb-atlas-kubernetes -icon: https://camo.githubusercontent.com/d473c25e361fb2206f06bdcf24028e8d52bc30d1/68747470733a2f2f6d6f6e676f64622d6b756265726e657465732d6f70657261746f722e73332e616d617a6f6e6177732e636f6d2f696d672f4c6561662d466f7265737425343032782e706e67 +icon: https://webimages.mongodb.com/_com_assets/cms/kuyjf3vea2hg34taa-horizontal_default_slate_blue.svg maintainers: - name: MongoDB email: support@mongodb.com