From 0247bc3df45fcbee0faf45eb4496a36fe59bd688 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Fri, 17 Jul 2020 19:08:50 -0400 Subject: [PATCH] [incubator/mongodb] deprecate missing chart (#23229) Signed-off-by: Scott Rigby Signed-off-by: Miguel Mingorance --- incubator/mongodb/.helmignore | 22 ++++++ incubator/mongodb/Chart.yaml | 11 +++ incubator/mongodb/README.md | 4 ++ incubator/mongodb/templates/NOTES.txt | 3 + incubator/mongodb/templates/_helpers.tpl | 56 +++++++++++++++ incubator/mongodb/templates/deployment.yaml | 57 ++++++++++++++++ incubator/mongodb/templates/ingress.yaml | 41 +++++++++++ incubator/mongodb/templates/service.yaml | 16 +++++ .../mongodb/templates/serviceaccount.yaml | 8 +++ .../templates/tests/test-connection.yaml | 15 ++++ incubator/mongodb/values.yaml | 68 +++++++++++++++++++ 11 files changed, 301 insertions(+) create mode 100644 incubator/mongodb/.helmignore create mode 100644 incubator/mongodb/Chart.yaml create mode 100644 incubator/mongodb/README.md create mode 100644 incubator/mongodb/templates/NOTES.txt create mode 100644 incubator/mongodb/templates/_helpers.tpl create mode 100644 incubator/mongodb/templates/deployment.yaml create mode 100644 incubator/mongodb/templates/ingress.yaml create mode 100644 incubator/mongodb/templates/service.yaml create mode 100644 incubator/mongodb/templates/serviceaccount.yaml create mode 100644 incubator/mongodb/templates/tests/test-connection.yaml create mode 100644 incubator/mongodb/values.yaml diff --git a/incubator/mongodb/.helmignore b/incubator/mongodb/.helmignore new file mode 100644 index 000000000000..50af03172541 --- /dev/null +++ b/incubator/mongodb/.helmignore @@ -0,0 +1,22 @@ +# 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 +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/incubator/mongodb/Chart.yaml b/incubator/mongodb/Chart.yaml new file mode 100644 index 000000000000..f445bfc47dcd --- /dev/null +++ b/incubator/mongodb/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +appVersion: "0.0.1" +deprecated: true +description: DEPRECATED - incubator/mongodb +name: mongodb +# This chart is deprecated and no longer maintained. For details on the +# deprecation policy, including how to un-deprecate a chart, see the +# PROCESSES.md file. +version: 0.1.2 +home: https://mongodb.org +maintainers: [] diff --git a/incubator/mongodb/README.md b/incubator/mongodb/README.md new file mode 100644 index 000000000000..383ae68b2187 --- /dev/null +++ b/incubator/mongodb/README.md @@ -0,0 +1,4 @@ +`incubator/mongodb` is deprecated in favor of the Bitnami maintained MongoDB Helm chart at [bitnami/charts](https://github.com/bitnami/charts/). + + +Note: this chart was previously moved from `incubator` to `stable` before a deprecated version was published to this helm repo. Therefore, in order to remove the old versions from aggregators such as [Helm Hub](https://hub.helm.sh) and [Artifact Hub](https://artifacthub.io/) we have re-added this placeholder deprecated chart. See https://github.com/helm/charts/issues/23128 for further details. diff --git a/incubator/mongodb/templates/NOTES.txt b/incubator/mongodb/templates/NOTES.txt new file mode 100644 index 000000000000..2a8b62f751d8 --- /dev/null +++ b/incubator/mongodb/templates/NOTES.txt @@ -0,0 +1,3 @@ +incubator/mongodb is deprecated in favor of the Bitnami maintained MongoDB Helm chart at bitnami/charts (https://github.com/bitnami/charts/). + +Note: this chart was previously moved from incubator to stable before a deprecated version was published to this helm repo. Therefore, in order to remove the old versions from aggregators such as Helm Hub (https://hub.helm.sh) and Artifact Hub (https://artifacthub.io/) we have re-added this placeholder deprecated chart. See https://github.com/helm/charts/issues/23128 for further details. diff --git a/incubator/mongodb/templates/_helpers.tpl b/incubator/mongodb/templates/_helpers.tpl new file mode 100644 index 000000000000..e9beebd1e580 --- /dev/null +++ b/incubator/mongodb/templates/_helpers.tpl @@ -0,0 +1,56 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "mongodb.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 "mongodb.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- 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 "mongodb.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "mongodb.labels" -}} +app.kubernetes.io/name: {{ include "mongodb.name" . }} +helm.sh/chart: {{ include "mongodb.chart" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "mongodb.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "mongodb.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/incubator/mongodb/templates/deployment.yaml b/incubator/mongodb/templates/deployment.yaml new file mode 100644 index 000000000000..b3aa7cc26b01 --- /dev/null +++ b/incubator/mongodb/templates/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mongodb.fullname" . }} + labels: +{{ include "mongodb.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "mongodb.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "mongodb.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ template "mongodb.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/incubator/mongodb/templates/ingress.yaml b/incubator/mongodb/templates/ingress.yaml new file mode 100644 index 000000000000..6ce8107773e7 --- /dev/null +++ b/incubator/mongodb/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "mongodb.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "mongodb.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/incubator/mongodb/templates/service.yaml b/incubator/mongodb/templates/service.yaml new file mode 100644 index 000000000000..15dd8a3b3a44 --- /dev/null +++ b/incubator/mongodb/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mongodb.fullname" . }} + labels: +{{ include "mongodb.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "mongodb.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/incubator/mongodb/templates/serviceaccount.yaml b/incubator/mongodb/templates/serviceaccount.yaml new file mode 100644 index 000000000000..3b52fa48341f --- /dev/null +++ b/incubator/mongodb/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "mongodb.serviceAccountName" . }} + labels: +{{ include "mongodb.labels" . | indent 4 }} +{{- end -}} diff --git a/incubator/mongodb/templates/tests/test-connection.yaml b/incubator/mongodb/templates/tests/test-connection.yaml new file mode 100644 index 000000000000..c40786b18354 --- /dev/null +++ b/incubator/mongodb/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "mongodb.fullname" . }}-test-connection" + labels: +{{ include "mongodb.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "mongodb.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/incubator/mongodb/values.yaml b/incubator/mongodb/values.yaml new file mode 100644 index 000000000000..0603e2848d54 --- /dev/null +++ b/incubator/mongodb/values.yaml @@ -0,0 +1,68 @@ +# Default values for mongodb. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: nginx + tag: stable + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {}