From 65498b07dc7edf8f615c18431eb7b904f0649d82 Mon Sep 17 00:00:00 2001 From: Dries De Peuter Date: Sat, 14 Nov 2020 01:20:00 +0100 Subject: [PATCH] proxy: Allow more config --- charts/proxy/Chart.yaml | 2 +- charts/proxy/README.md | 4 ++-- charts/proxy/templates/service.yaml | 7 +++++-- charts/proxy/values.yaml | 14 ++++---------- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/charts/proxy/Chart.yaml b/charts/proxy/Chart.yaml index 8b83e28..0e0ceb2 100644 --- a/charts/proxy/Chart.yaml +++ b/charts/proxy/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: proxy description: A Helm chart for Kubernetes type: application -version: 0.1.3 +version: 1.0.0 appVersion: 1.0.0 diff --git a/charts/proxy/README.md b/charts/proxy/README.md index 67dcd3c..6c63c2f 100644 --- a/charts/proxy/README.md +++ b/charts/proxy/README.md @@ -55,13 +55,13 @@ The following tables list the configurable parameters of the Ledger chart and th | `serviceAccount.create` | Configures if a ServiceAccount with this name should be created | `true` | | `serviceAccount.annotations` | Configures annotation for the ServiceAccount | `{}` | | `serviceAccountAgent.name` | Name of the agent ServiceAccount to be used by access-controlled resources | autogenerated | -| `service.type` | Kubernetes service type | `ClusterIP` | -| `service.port` | Kubernetes service port | `80` | | `ingress.enabled` | Enables ingress | `false` | | `ingress.annotations` | Ingress annotations | `{}` | | `proxy[].name` | Name of the proxy | nil | | `proxy[].hosts[].host` | Hostname to listen to | nil | | `proxy[].hosts[].paths` | Paths to listen to | `[]` | +| `proxy[].service.extras` | Kubernetes service configuration | nil | +| `proxy[].service.port` | Kubernetes service port | `80` | | `proxy[].backend.ip` | The IP of the backend | nil | | `proxy[].backend.port` | The port of the backend | nil | | `proxy[].tls` | TLS configuration | nil | diff --git a/charts/proxy/templates/service.yaml b/charts/proxy/templates/service.yaml index d3205e3..4926e05 100644 --- a/charts/proxy/templates/service.yaml +++ b/charts/proxy/templates/service.yaml @@ -1,13 +1,16 @@ -{{- $servicePort := .Values.service.port -}} {{- range .Values.proxy }} +{{ $svc := .service | default dict}} --- apiVersion: v1 kind: Service metadata: name: {{ .name }} spec: +{{- with $svc.extras -}} + {{- toYaml . | nindent 2 }} +{{- end }} ports: - protocol: TCP - port: {{ $servicePort }} + port: {{ $svc.port | default .backend.port }} targetPort: {{ .backend.port }} {{- end }} \ No newline at end of file diff --git a/charts/proxy/values.yaml b/charts/proxy/values.yaml index 02b4c96..89f53a0 100644 --- a/charts/proxy/values.yaml +++ b/charts/proxy/values.yaml @@ -6,18 +6,12 @@ serviceAccount: annotations: {} name: "" -ingress: - enabled: false - annotations: - # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" - -service: - type: ClusterIP - port: 80 - proxy: # - name: nas + # service: + # extras: + # loadBalancerIP: 192.168.22.170 + # type: LoadBalancer # hosts: # - host: nas.k8s # paths: ["/"]