From ceaf710dee219dfe375622430ea7ebf0d261c85e Mon Sep 17 00:00:00 2001 From: Daniel Jiang Date: Mon, 5 Aug 2019 16:38:47 +0800 Subject: [PATCH] Skip unknown expose.type This commit adjust the creation of the service of nginx. It will skip the creation of the service if the `expose.type` is set to an unknown value. One benefit of this change is that user can create the service to expose Harbor first, and deploy other components using the chart. Signed-off-by: Daniel Jiang --- README.md | 2 +- templates/nginx/service.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cbf2b4106..dfbef0601 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ The following table lists the configurable parameters of the Harbor chart and th | Parameter | Description | Default | | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | | **Expose** | -| `expose.type` | The way how to expose the service: `ingress`, `clusterIP`, `nodePort` or `loadBalancer` | `ingress` | +| `expose.type` | The way how to expose the service: `ingress`, `clusterIP`, `nodePort` or `loadBalancer`, other values will be ignored and the creation of service will be skipped. | `ingress` | | `expose.tls.enabled` | Enable the tls or not | `true` | | `expose.ingress.controller` | The ingress controller type. Currently supports `default`, `gce` and `ncp` | `default` | | `expose.tls.secretName` | Fill the name of secret if you want to use your own TLS certificate and private key. The secret must contain keys named `tls.crt` and `tls.key` that contain the certificate and private key to use for TLS. The certificate and private key will be generated automatically if it is not set | | diff --git a/templates/nginx/service.yaml b/templates/nginx/service.yaml index cdc00939a..af39b1ffa 100644 --- a/templates/nginx/service.yaml +++ b/templates/nginx/service.yaml @@ -1,4 +1,4 @@ -{{- if ne .Values.expose.type "ingress" }} +{{- if or (eq .Values.expose.type "clusterIP") (eq .Values.expose.type "nodePort") (eq .Values.expose.type "loadBalancer") }} apiVersion: v1 kind: Service metadata: