diff --git a/incubator/kube-spot-termination-notice-handler/.helmignore b/incubator/kube-spot-termination-notice-handler/.helmignore new file mode 100644 index 000000000000..50af03172541 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/.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/kube-spot-termination-notice-handler/Chart.yaml b/incubator/kube-spot-termination-notice-handler/Chart.yaml new file mode 100644 index 000000000000..e4617ec6cec6 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/Chart.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +appVersion: "0.0.1" +deprecated: true +description: DEPRECATED - incubator/kube-spot-termination-notice-handler +name: kube-spot-termination-notice-handler +# 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.4.1 +home: https://github.com/kube-aws/kube-spot-termination-notice-handler +maintainers: [] diff --git a/incubator/kube-spot-termination-notice-handler/README.md b/incubator/kube-spot-termination-notice-handler/README.md new file mode 100644 index 000000000000..1b53ed5bf1a3 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/README.md @@ -0,0 +1,3 @@ +`incubator/kube-spot-termination-notice-handler` is deprecated in favor of the `stable/k8s-spot-termination-handler`. + +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/kube-spot-termination-notice-handler/templates/NOTES.txt b/incubator/kube-spot-termination-notice-handler/templates/NOTES.txt new file mode 100644 index 000000000000..af11c9d31d65 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/NOTES.txt @@ -0,0 +1,3 @@ +incubator/kube-spot-termination-notice-handler is deprecated in favor of the stable/k8s-spot-termination-handler. + +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/kube-spot-termination-notice-handler/templates/_helpers.tpl b/incubator/kube-spot-termination-notice-handler/templates/_helpers.tpl new file mode 100644 index 000000000000..69dbe5d2683e --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/_helpers.tpl @@ -0,0 +1,56 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "kube-spot-termination-notice-handler.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 "kube-spot-termination-notice-handler.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 "kube-spot-termination-notice-handler.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "kube-spot-termination-notice-handler.labels" -}} +app.kubernetes.io/name: {{ include "kube-spot-termination-notice-handler.name" . }} +helm.sh/chart: {{ include "kube-spot-termination-notice-handler.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 "kube-spot-termination-notice-handler.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "kube-spot-termination-notice-handler.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/incubator/kube-spot-termination-notice-handler/templates/deployment.yaml b/incubator/kube-spot-termination-notice-handler/templates/deployment.yaml new file mode 100644 index 000000000000..df5a4a187c16 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "kube-spot-termination-notice-handler.fullname" . }} + labels: +{{ include "kube-spot-termination-notice-handler.labels" . | indent 4 }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "kube-spot-termination-notice-handler.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "kube-spot-termination-notice-handler.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ template "kube-spot-termination-notice-handler.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/kube-spot-termination-notice-handler/templates/ingress.yaml b/incubator/kube-spot-termination-notice-handler/templates/ingress.yaml new file mode 100644 index 000000000000..7ecaa5223641 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "kube-spot-termination-notice-handler.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 "kube-spot-termination-notice-handler.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/kube-spot-termination-notice-handler/templates/service.yaml b/incubator/kube-spot-termination-notice-handler/templates/service.yaml new file mode 100644 index 000000000000..00d59d343771 --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "kube-spot-termination-notice-handler.fullname" . }} + labels: +{{ include "kube-spot-termination-notice-handler.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 "kube-spot-termination-notice-handler.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/incubator/kube-spot-termination-notice-handler/templates/serviceaccount.yaml b/incubator/kube-spot-termination-notice-handler/templates/serviceaccount.yaml new file mode 100644 index 000000000000..6cb507c7cdbf --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "kube-spot-termination-notice-handler.serviceAccountName" . }} + labels: +{{ include "kube-spot-termination-notice-handler.labels" . | indent 4 }} +{{- end -}} diff --git a/incubator/kube-spot-termination-notice-handler/templates/tests/test-connection.yaml b/incubator/kube-spot-termination-notice-handler/templates/tests/test-connection.yaml new file mode 100644 index 000000000000..03e92d29416d --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "kube-spot-termination-notice-handler.fullname" . }}-test-connection" + labels: +{{ include "kube-spot-termination-notice-handler.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "kube-spot-termination-notice-handler.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/incubator/kube-spot-termination-notice-handler/values.yaml b/incubator/kube-spot-termination-notice-handler/values.yaml new file mode 100644 index 000000000000..94d17f01228e --- /dev/null +++ b/incubator/kube-spot-termination-notice-handler/values.yaml @@ -0,0 +1,68 @@ +# Default values for kube-spot-termination-notice-handler. +# 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: {}