diff --git a/chart/nsync/.helmignore b/chart/nsync/.helmignore new file mode 100644 index 0000000..f0c1319 --- /dev/null +++ b/chart/nsync/.helmignore @@ -0,0 +1,21 @@ +# 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 diff --git a/chart/nsync/Chart.yaml b/chart/nsync/Chart.yaml new file mode 100644 index 0000000..54605ac --- /dev/null +++ b/chart/nsync/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: "0.0.8" +description: A Helm chart for Kubernetes +name: nsync +version: 0.0.8 diff --git a/chart/nsync/templates/NOTES.txt b/chart/nsync/templates/NOTES.txt new file mode 100644 index 0000000..1998298 --- /dev/null +++ b/chart/nsync/templates/NOTES.txt @@ -0,0 +1 @@ +For further instructions, please see https://github.com/verloop/nsync/blob/master/README.md diff --git a/chart/nsync/templates/_helpers.tpl b/chart/nsync/templates/_helpers.tpl new file mode 100644 index 0000000..80af6f9 --- /dev/null +++ b/chart/nsync/templates/_helpers.tpl @@ -0,0 +1,43 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "nsync.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 "nsync.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 "nsync.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "nsync.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "nsync.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/chart/nsync/templates/deployment.yaml b/chart/nsync/templates/deployment.yaml new file mode 100644 index 0000000..4d0734f --- /dev/null +++ b/chart/nsync/templates/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1beta2 +kind: Deployment +metadata: + name: {{ template "nsync.fullname" . }} + labels: + app: {{ template "nsync.name" . }} + chart: {{ template "nsync.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ template "nsync.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "nsync.name" . }} + release: {{ .Release.Name }} + spec: + serviceAccountName: {{ template "nsync.serviceAccountName" . }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: +{{ toYaml .Values.resources | indent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: +{{ toYaml . | indent 8 }} + {{- end }} diff --git a/chart/nsync/templates/rbac.yaml b/chart/nsync/templates/rbac.yaml new file mode 100644 index 0000000..7f91eb9 --- /dev/null +++ b/chart/nsync/templates/rbac.yaml @@ -0,0 +1,37 @@ +{{- if .Values.rbac.create -}} +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: + name: {{ template "nsync.fullname" . }} + labels: + app: {{ template "nsync.name" . }} + chart: {{ template "nsync.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +rules: + - apiGroups: [""] + resources: ["configmaps", "secrets"] + verbs: ["create", "get", "watch", "list", "update", "patch"] + - apiGroups: [""] + resources: ["namespaces"] + verbs: ["get", "watch", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRoleBinding +metadata: + name: {{ template "nsync.fullname" . }} + labels: + app: {{ template "nsync.name" . }} + chart: {{ template "nsync.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ template "nsync.fullname" . }} +subjects: + - name: {{ template "nsync.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} + kind: ServiceAccount +{{- end -}} + diff --git a/chart/nsync/templates/serviceaccount.yaml b/chart/nsync/templates/serviceaccount.yaml new file mode 100644 index 0000000..43533d6 --- /dev/null +++ b/chart/nsync/templates/serviceaccount.yaml @@ -0,0 +1,13 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "nsync.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} + labels: + app: {{ template "nsync.name" . }} + chart: {{ template "nsync.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- end -}} + diff --git a/chart/nsync/values.yaml b/chart/nsync/values.yaml new file mode 100644 index 0000000..212b96e --- /dev/null +++ b/chart/nsync/values.yaml @@ -0,0 +1,39 @@ +# Default values for nsync. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +image: + repository: verloopio/nsync + tag: 0.0.8 + pullPolicy: IfNotPresent + +annotations: {} + +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: {} + +rbac: + # Specifies whether RBAC resources should be created + create: true + +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: