From 95520f61b694bb2fa884a4ed36cabbd5af3711b7 Mon Sep 17 00:00:00 2001 From: Eugen Stan Date: Mon, 3 Jan 2022 21:31:06 +0200 Subject: [PATCH] Added another-ldap-auth chart --- NOTICE | 1 + charts/another-ldap-auth/.helmignore | 23 ++++++ charts/another-ldap-auth/Chart.yaml | 16 ++++ charts/another-ldap-auth/LICENSE | 21 +++++ charts/another-ldap-auth/README.md | 56 ++++++++++++++ charts/another-ldap-auth/templates/NOTES.txt | 1 + .../another-ldap-auth/templates/_helpers.tpl | 62 +++++++++++++++ .../templates/deployment.yaml | 76 +++++++++++++++++++ charts/another-ldap-auth/templates/hpa.yaml | 28 +++++++ .../another-ldap-auth/templates/secret.yaml | 9 +++ .../another-ldap-auth/templates/service.yaml | 14 ++++ .../templates/serviceaccount.yaml | 12 +++ charts/another-ldap-auth/values.yaml | 73 ++++++++++++++++++ 13 files changed, 392 insertions(+) create mode 100644 NOTICE create mode 100644 charts/another-ldap-auth/.helmignore create mode 100644 charts/another-ldap-auth/Chart.yaml create mode 100644 charts/another-ldap-auth/LICENSE create mode 100644 charts/another-ldap-auth/README.md create mode 100644 charts/another-ldap-auth/templates/NOTES.txt create mode 100644 charts/another-ldap-auth/templates/_helpers.tpl create mode 100644 charts/another-ldap-auth/templates/deployment.yaml create mode 100644 charts/another-ldap-auth/templates/hpa.yaml create mode 100644 charts/another-ldap-auth/templates/secret.yaml create mode 100644 charts/another-ldap-auth/templates/service.yaml create mode 100644 charts/another-ldap-auth/templates/serviceaccount.yaml create mode 100644 charts/another-ldap-auth/values.yaml diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..ada9a0e --- /dev/null +++ b/NOTICE @@ -0,0 +1 @@ +License for charts/another-ldap-auth is MIT. \ No newline at end of file diff --git a/charts/another-ldap-auth/.helmignore b/charts/another-ldap-auth/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/another-ldap-auth/.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/another-ldap-auth/Chart.yaml b/charts/another-ldap-auth/Chart.yaml new file mode 100644 index 0000000..7875898 --- /dev/null +++ b/charts/another-ldap-auth/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v2 +name: another-ldap-auth +description: A Helm chart using another-ldap-auth to enable AD or LDAP based basic-authentication for ingress resources +type: application +version: 0.3.0 +appVersion: 2.2.1 +keywords: + - ingress + - nginx + - ldap + - activedirectory + - authentication + - another-ldap-auth +home: https://github.com/dignajar/another-ldap-auth +sources: + - https://github.com/dignajar/another-ldap-auth diff --git a/charts/another-ldap-auth/LICENSE b/charts/another-ldap-auth/LICENSE new file mode 100644 index 0000000..e288f8d --- /dev/null +++ b/charts/another-ldap-auth/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Diego Najar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/charts/another-ldap-auth/README.md b/charts/another-ldap-auth/README.md new file mode 100644 index 0000000..1f4f9ea --- /dev/null +++ b/charts/another-ldap-auth/README.md @@ -0,0 +1,56 @@ +# another-ldap-auth + +![Version: 0.3.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.2.1](https://img.shields.io/badge/AppVersion-2.2.1-informational?style=flat-square) + +A Helm chart using another-ldap-auth to enable AD or LDAP based basic-authentication for ingress resources + +**Homepage:** + +## Source Code + +* + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | | +| autoscaling.enabled | bool | `false` | | +| autoscaling.maxReplicas | int | `100` | | +| autoscaling.minReplicas | int | `1` | | +| autoscaling.targetCPUUtilizationPercentage | int | `80` | | +| fullnameOverride | string | `""` | | +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"dignajar/another-ldap-auth"` | | +| image.tag | string | `"1.9"` | | +| imagePullSecrets | list | `[]` | | +| ldap.cacheExpiration | int | `10` | | +| ldap.endpoint | string | `"ldaps://testmyldap.com:636"` | | +| ldap.existingSecret | string | `nil` | | +| ldap.httpsSupport | string | `"enabled"` | | +| ldap.logLevel | string | `"INFO"` | | +| ldap.managerDnUsername | string | `"CN=john,OU=Administrators,DC=TESTMYLDAP,DC=COM"` | | +| ldap.searchBase | string | `"DC=TESTMYLDAP,DC=COM"` | | +| ldap.searchFilter | string | `"(sAMAccountName={username})"` | | +| ldap.bindDN | string | `"{username}@TESTMYLDAP.com"` | | +| nameOverride | string | `""` | | +| nodeSelector | object | `{}` | | +| podAnnotations | object | `{}` | | +| podSecurityContext | object | `{}` | | +| replicaCount | int | `1` | | +| resources.limits.cpu | string | `"500m"` | | +| resources.limits.memory | string | `"256Mi"` | | +| resources.requests.cpu | string | `"50m"` | | +| resources.requests.memory | string | `"64Mi"` | | +| securityContext | object | `{}` | | +| service.containerPort | int | `9000` | | +| service.port | int | `80` | | +| service.protocol | string | `"TCP"` | | +| service.type | string | `"ClusterIP"` | | +| serviceAccount.annotations | object | `{}` | | +| serviceAccount.create | bool | `true` | | +| serviceAccount.name | string | `""` | | +| tolerations | list | `[]` | | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.5.0](https://github.com/norwoodj/helm-docs/releases/v1.5.0) diff --git a/charts/another-ldap-auth/templates/NOTES.txt b/charts/another-ldap-auth/templates/NOTES.txt new file mode 100644 index 0000000..af31a21 --- /dev/null +++ b/charts/another-ldap-auth/templates/NOTES.txt @@ -0,0 +1 @@ +Deployed another-ldap-auth. \ No newline at end of file diff --git a/charts/another-ldap-auth/templates/_helpers.tpl b/charts/another-ldap-auth/templates/_helpers.tpl new file mode 100644 index 0000000..0c505a5 --- /dev/null +++ b/charts/another-ldap-auth/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "another-ldap-auth.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 "another-ldap-auth.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 "another-ldap-auth.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "another-ldap-auth.labels" -}} +helm.sh/chart: {{ include "another-ldap-auth.chart" . }} +{{ include "another-ldap-auth.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "another-ldap-auth.selectorLabels" -}} +app.kubernetes.io/name: {{ include "another-ldap-auth.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "another-ldap-auth.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "another-ldap-auth.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/charts/another-ldap-auth/templates/deployment.yaml b/charts/another-ldap-auth/templates/deployment.yaml new file mode 100644 index 0000000..dafe77f --- /dev/null +++ b/charts/another-ldap-auth/templates/deployment.yaml @@ -0,0 +1,76 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "another-ldap-auth.fullname" . }} + labels: + {{- include "another-ldap-auth.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "another-ldap-auth.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "another-ldap-auth.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "another-ldap-auth.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: CACHE_EXPIRATION + value: "{{ .Values.ldap.cacheExpiration }}" + - name: LDAP_ENDPOINT + value: {{ .Values.ldap.endpoint }} + - name: LDAP_HTTPS_SUPPORT + value: {{ .Values.ldap.httpsSupport }} + - name: LDAP_MANAGER_DN_USERNAME + value: {{ .Values.ldap.managerDnUsername }} + - name: LDAP_BIND_DN + value: {{ .Values.ldap.bindDN }} + - name: LDAP_SEARCH_BASE + value: {{ .Values.ldap.searchBase }} + - name: LDAP_SEARCH_FILTER + value: {{ .Values.ldap.searchFilter }} + - name: LOG_LEVEL + value: {{ .Values.ldap.logLevel }} + - name: LOG_FORMAT + value: {{ .Values.ldap.logFormat }} + - name: LDAP_MANAGER_PASSWORD + valueFrom: + secretKeyRef: + name: {{ if .Values.ldap.existingSecret }}{{ .Values.ldap.existingSecret }}{{ else }}{{ include "another-ldap-auth.fullname" . }}{{ end }} + key: LDAP_MANAGER_PASSWORD + ports: + - containerPort: {{ .Values.service.containerPort }} + protocol: {{ .Values.service.protocol }} + 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/charts/another-ldap-auth/templates/hpa.yaml b/charts/another-ldap-auth/templates/hpa.yaml new file mode 100644 index 0000000..07d5eb8 --- /dev/null +++ b/charts/another-ldap-auth/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "another-ldap-auth.fullname" . }} + labels: + {{- include "another-ldap-auth.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "another-ldap-auth.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/charts/another-ldap-auth/templates/secret.yaml b/charts/another-ldap-auth/templates/secret.yaml new file mode 100644 index 0000000..61b4a35 --- /dev/null +++ b/charts/another-ldap-auth/templates/secret.yaml @@ -0,0 +1,9 @@ +{{- if not .Values.ldap.existingSecret -}} +kind: Secret +apiVersion: v1 +metadata: + name: {{ include "another-ldap-auth.fullname" . }} +type: Opaque +data: + LDAP_MANAGER_PASSWORD: {{ .Values.ldap.managerDnPassword | b64enc }} +{{- end }} diff --git a/charts/another-ldap-auth/templates/service.yaml b/charts/another-ldap-auth/templates/service.yaml new file mode 100644 index 0000000..35c98f9 --- /dev/null +++ b/charts/another-ldap-auth/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "another-ldap-auth.fullname" . }} + labels: + {{- include "another-ldap-auth.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.service.containerPort }} + protocol: TCP + selector: + {{- include "another-ldap-auth.selectorLabels" . | nindent 4 }} diff --git a/charts/another-ldap-auth/templates/serviceaccount.yaml b/charts/another-ldap-auth/templates/serviceaccount.yaml new file mode 100644 index 0000000..60e24e6 --- /dev/null +++ b/charts/another-ldap-auth/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "another-ldap-auth.serviceAccountName" . }} + labels: + {{- include "another-ldap-auth.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/charts/another-ldap-auth/values.yaml b/charts/another-ldap-auth/values.yaml new file mode 100644 index 0000000..ad08642 --- /dev/null +++ b/charts/another-ldap-auth/values.yaml @@ -0,0 +1,73 @@ +replicaCount: 1 + +image: + repository: dignajar/another-ldap-auth + pullPolicy: IfNotPresent + tag: "2.2.1" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +# AD config +ldap: + existingSecret: + logLevel: "INFO" + logFormat: "TEXT" + cacheExpiration: 10 + httpsSupport: "enabled" + endpoint: "ldaps://testmyldap.com:636" + managerDnUsername: "CN=john,OU=Administrators,DC=TESTMYLDAP,DC=COM" + managerDnPassword: + bindDN: "{username}@TESTMYLDAP.com" + searchBase: "DC=TESTMYLDAP,DC=COM" + searchFilter: "(sAMAccountName={username})" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + protocol: TCP + containerPort: 9000 + +resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 50m + memory: 64Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {}