diff --git a/Chart.yaml b/Chart.yaml index a1c3027..efa0c24 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -13,7 +13,7 @@ dependencies: - bitnami-common version: 1.x.x home: https://www.openldap.org -version: 4.1.2 +version: 4.1.3 appVersion: 2.6.3 description: Community developed LDAP software icon: https://raw.githubusercontent.com/jp-gouin/helm-openldap/master/logo.png @@ -27,4 +27,4 @@ sources: maintainers: - name: Jean-Philippe Gouin email: jp-gouin@hotmail.fr -engine: gotpl \ No newline at end of file +engine: gotpl diff --git a/README.md b/README.md index 96f9e8a..eb9979b 100755 --- a/README.md +++ b/README.md @@ -130,6 +130,8 @@ Parameters related to Kubernetes. | `extraDeploy` | extraDeploy Array of extra objects to deploy with the release | `""` | | `service.annotations` | Annotations to add to the service | `{}` | | `service.externalIPs` | Service external IP addresses | `[]` | +| `service.enableLdapPort` | Enable LDAP port on the service and headless service | `true` | +| `service.enableSslLdapPort` | Enable SSL LDAP port on the service and headless service | `true` | | `service.ldapPortNodePort` | Nodeport of External service port for LDAP if service.type is NodePort | `nil` | | `service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` | | `service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | `[]` | diff --git a/templates/service.yaml b/templates/service.yaml index 5c65c45..a43ba11 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -24,6 +24,7 @@ spec: loadBalancerSourceRanges: {{ toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} {{- end }} ports: + {{- if .Values.service.enableLdapPort }} - name: ldap-port protocol: TCP port: {{ .Values.global.ldapPort }} @@ -33,6 +34,8 @@ spec: {{- else if eq .Values.service.type "ClusterIP" }} nodePort: null {{- end }} + {{- end }} + {{- if .Values.service.enableSslLdapPort }} - name: ssl-ldap-port protocol: TCP port: {{ .Values.global.sslLdapPort }} @@ -42,6 +45,7 @@ spec: {{- else if eq .Values.service.type "ClusterIP" }} nodePort: null {{- end }} + {{- end }} sessionAffinity: {{ .Values.service.sessionAffinity }} selector: app.kubernetes.io/component: {{ template "openldap.fullname" . }} diff --git a/templates/svc-headless.yaml b/templates/svc-headless.yaml index 3c755b8..1e6cdac 100755 --- a/templates/svc-headless.yaml +++ b/templates/svc-headless.yaml @@ -9,12 +9,19 @@ metadata: heritage: {{ .Release.Service }} spec: ports: + {{- if .Values.service.enableLdapPort }} - port: {{ .Values.global.ldapPort }} name: ldap-port targetPort: ldap-port + {{- end }} + {{- if .Values.service.enableSslLdapPort }} + - port: {{ .Values.global.sslLdapPort }} + name: ssl-ldap-port + targetPort: ssl-ldap-port + {{- end }} clusterIP: None selector: app.kubernetes.io/component: {{ template "openldap.fullname" . }} release: {{ .Release.Name }} type: ClusterIP - sessionAffinity: None \ No newline at end of file + sessionAffinity: None diff --git a/values.yaml b/values.yaml index b31332a..013890c 100644 --- a/values.yaml +++ b/values.yaml @@ -70,6 +70,11 @@ service: ## If service type NodePort, define the value here #ldapPortNodePort: #sslLdapPortNodePort: + + # Disable if you do not want to expose port on service + enableLdapPort: true + enableSslLdapPort: true + ## List of IP addresses at which the service is available ## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips ##