diff --git a/stable/openiban/.helmignore b/stable/openiban/.helmignore new file mode 100644 index 000000000000..f0c131944441 --- /dev/null +++ b/stable/openiban/.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/stable/openiban/Chart.yaml b/stable/openiban/Chart.yaml new file mode 100644 index 000000000000..c867ebf6e1cb --- /dev/null +++ b/stable/openiban/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +appVersion: 1.0.1 +description: OpenIBAN is a self-hosted, free and open-source IBAN validation API. +name: openiban +version: 1.0.0 +keywords: +- iban +- golang +home: https://openiban.com +sources: +- https://github.com/fourcube/goiban-service +maintainers: +- name: verwilst + email: bart@verwilst.be diff --git a/stable/openiban/OWNERS b/stable/openiban/OWNERS new file mode 100644 index 000000000000..bfc8a2c1add1 --- /dev/null +++ b/stable/openiban/OWNERS @@ -0,0 +1,4 @@ +approvers: +- verwilst +reviewers: +- verwilst diff --git a/stable/openiban/README.md b/stable/openiban/README.md new file mode 100644 index 000000000000..b5d86d3a1a0b --- /dev/null +++ b/stable/openiban/README.md @@ -0,0 +1,79 @@ +# OpenIBAN + +[OpenIBAN](https://github.com/fourcube/goiban-service) implements a basic REST Web-service for validating IBAN account numbers in GO. + +## TL;DR; + +```bash +$ helm install stable/openiban +``` + +## Introduction + +This chart bootstraps an [OpenIBAN](https://github.com/fourcube/goiban-service) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Prerequisites + +- Kubernetes 1.9+ with Beta APIs enabled + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```bash +$ helm update --install my-release stable/openiban +``` + +The command deploys OpenIBAN on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```bash +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the Redmine chart and their default values. + +| Parameter | Description | Default | +| --------------------------------- | ---------------------------------------- | ------------------------------------------------------- | +| `replicaCount` | Number of replicas to start | `1` | +| `image.repository` | Image name | `fourcube/openiban` | +| `image.tag` | Image tag | `1.0.1` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `service.type` | Desired service type | `ClusterIP` | +| `service.port` | Service exposed port | `8080` | +| `rbac.create` | Use Role-based Access Control | `true` | +| `serviceAccount.create` | Should we create a ServiceAccount | `true` | +| `serviceAccount.name` | Name of the ServiceAccount to use | `null` | +| `ingress.enabled` | Enable or disable the ingress | `false` | +| `ingress.hosts` | The virtual host name(s) | `{}` | +| `ingress.annotations` | An array of service annotations | `nil` | +| `ingress.tls[i].secretName` | The secret kubernetes.io/tls | `nil` | +| `ingress.tls[i].hosts[j]` | The virtual host name | `nil` | +| `resources` | Resources allocation (Requests and Limits) | `{}` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```bash +$ helm upgrade --install my-release \ + --set replicaCount=2 \ + stable/openiban +``` + +The above command enables starts 2 replicas. + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, + +```bash +$ helm upgrade --install my-release -f values.yaml stable/openiban +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) diff --git a/stable/openiban/templates/NOTES.txt b/stable/openiban/templates/NOTES.txt new file mode 100644 index 000000000000..13bcd1a68148 --- /dev/null +++ b/stable/openiban/templates/NOTES.txt @@ -0,0 +1,19 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range .Values.ingress.hosts }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "openiban.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get svc -w {{ template "openiban.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "openiban.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "openiban.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl port-forward $POD_NAME 8080:80 +{{- end }} diff --git a/stable/openiban/templates/_helpers.tpl b/stable/openiban/templates/_helpers.tpl new file mode 100644 index 000000000000..85a221d5c6e0 --- /dev/null +++ b/stable/openiban/templates/_helpers.tpl @@ -0,0 +1,44 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "openiban.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 "openiban.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 "openiban.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "openiban.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "openiban.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} + diff --git a/stable/openiban/templates/deployment.yaml b/stable/openiban/templates/deployment.yaml new file mode 100644 index 000000000000..3ffe28b2412e --- /dev/null +++ b/stable/openiban/templates/deployment.yaml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "openiban.fullname" . }} + labels: + app: {{ template "openiban.name" . }} + chart: {{ template "openiban.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "openiban.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "openiban.name" . }} + release: {{ .Release.Name }} + spec: + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8080 + protocol: TCP + livenessProbe: + httpGet: + path: /validate/DE89370400440532013000 + port: http + initialDelaySeconds: 5 + readinessProbe: + httpGet: + path: /validate/DE89370400440532013000 + port: http + 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/stable/openiban/templates/ingress.yaml b/stable/openiban/templates/ingress.yaml new file mode 100644 index 000000000000..473c7041df9b --- /dev/null +++ b/stable/openiban/templates/ingress.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "openiban.fullname" . -}} +{{- $servicePort := .Values.service.port -}} +{{- $ingressPath := .Values.ingress.path -}} +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + app: {{ template "openiban.name" . }} + chart: {{ template "openiban.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- with .Values.ingress.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ . }} + http: + paths: + - path: {{ $ingressPath }} + backend: + serviceName: {{ $fullName }} + servicePort: http + {{- end }} +{{- end }} diff --git a/stable/openiban/templates/role.yaml b/stable/openiban/templates/role.yaml new file mode 100644 index 000000000000..7082dcf93429 --- /dev/null +++ b/stable/openiban/templates/role.yaml @@ -0,0 +1,15 @@ +{{- if .Values.rbac.create }} +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ template "openiban.fullname" . }} + labels: + app: {{ template "openiban.name" . }} + chart: {{ template "openiban.chart" . }} + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +rules: +- apiGroups: [""] + resources: ["endpoints"] + verbs: ["get"] +{{- end }} diff --git a/stable/openiban/templates/rolebinding.yaml b/stable/openiban/templates/rolebinding.yaml new file mode 100644 index 000000000000..5496e0243d5c --- /dev/null +++ b/stable/openiban/templates/rolebinding.yaml @@ -0,0 +1,18 @@ +{{- if .Values.rbac.create }} +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ template "openiban.fullname" . }} + labels: + app: {{ template "openiban.name" . }} + chart: {{ template "openiban.chart" . }} + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +subjects: +- kind: ServiceAccount + name: {{ template "openiban.serviceAccountName" . }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ template "openiban.fullname" . }} +{{- end }} diff --git a/stable/openiban/templates/service.yaml b/stable/openiban/templates/service.yaml new file mode 100644 index 000000000000..36a3ff8c83ca --- /dev/null +++ b/stable/openiban/templates/service.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "openiban.fullname" . }} + labels: + app: {{ template "openiban.name" . }} + chart: {{ template "openiban.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 8080 + protocol: TCP + name: http + selector: + app: {{ template "openiban.name" . }} + release: {{ .Release.Name }} diff --git a/stable/openiban/templates/serviceaccount.yaml b/stable/openiban/templates/serviceaccount.yaml new file mode 100644 index 000000000000..baf61d70e769 --- /dev/null +++ b/stable/openiban/templates/serviceaccount.yaml @@ -0,0 +1,11 @@ +{{ if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: {{ template "openiban.name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "openiban.serviceAccountName" . }} +{{- end -}} diff --git a/stable/openiban/values.yaml b/stable/openiban/values.yaml new file mode 100644 index 000000000000..4d87b1a10206 --- /dev/null +++ b/stable/openiban/values.yaml @@ -0,0 +1,63 @@ +# Default values for openiban. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: fourcube/openiban + tag: 1.0.1 + pullPolicy: IfNotPresent + +service: + type: ClusterIP + port: 8080 + +securityContext: + enabled: true + runAsUser: 1000 + fsGroup: 1000 + +## For RBAC support: +rbac: + # Specifies whether RBAC resources should be created + create: true + +serviceAccount: + # Specifies whether a ServiceAccount should be created + create: true + + # The name of the ServiceAccount to use. + # If not set and create is true, a name is generated using the fullname template + name: + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + path: / + hosts: + - chart-example.local + 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: {}