aspnet-core - Adding the health ingress (#3454)

This commit is contained in:
BaskaranSelvaraj
2020-08-20 03:00:29 -04:00
committed by GitHub
parent 90349b2159
commit f50459860d
5 changed files with 174 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v1
name: aspnet-core
version: 0.1.4
version: 0.2.0
appVersion: 3.1.7
description: ASP.NET Core is an open-source framework created by Microsoft for building cloud-enabled, modern applications.
keywords:

View File

@@ -164,6 +164,18 @@ The following tables lists the configurable parameters of the ASP.NET Core chart
| `ingress.secrets[0].name` | TLS Secret Name | `nil` |
| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` |
| `ingress.secrets[0].key` | TLS Secret Key | `nil` |
| `healthIngress.enabled` | Enable healthIngress controller resource | `false` |
| `healthIngress.certManager` | Add annotations for cert-manager | `false` |
| `healthIngress.hostname` | Default host for the healthIngress resource | `aspnet-core.local` |
| `healthIngress.tls` | Enable TLS configuration for the hostname defined at `healthIngress.hostname` parameter | `false` |
| `healthIngress.annotations` | Ingress annotations | `[]` |
| `healthIngress.extraHosts[0].name` | Additional hostnames to be covered | `nil` |
| `healthIngress.extraHosts[0].path` | Additional hostnames to be covered | `nil` |
| `healthIngress.extraTls[0].hosts[0]` | TLS configuration for additional hostnames to be covered | `nil` |
| `healthIngress.extraTls[0].secretName` | TLS configuration for additional hostnames to be covered | `nil` |
| `healthIngress.secrets[0].name` | TLS Secret Name | `nil` |
| `healthIngress.secrets[0].certificate` | TLS Secret Certificate | `nil` |
| `healthIngress.secrets[0].key` | TLS Secret Key | `nil` |
### RBAC parameters

View File

@@ -0,0 +1,51 @@
{{- if .Values.healthIngress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ include "aspnet-core.fullname" . }}-health
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.healthIngress.certManager }}
kubernetes.io/tls-acme: "true"
{{- end }}
{{- if .Values.healthIngress.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.healthIngress.annotations "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
rules:
{{- if .Values.healthIngress.hostname }}
- host: {{ .Values.healthIngress.hostname }}
http:
paths:
- path: /
backend:
serviceName: {{ include "aspnet-core.fullname" . }}
servicePort: http
{{- end }}
{{- range .Values.healthIngress.extraHosts }}
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
backend:
serviceName: {{ include "aspnet-core.fullname" $ }}
servicePort: http
{{- end }}
{{- if or .Values.healthIngress.tls .Values.healthIngress.extraTls .Values.healthIngress.hosts }}
tls:
{{- if .Values.healthIngress.tls }}
- hosts:
- {{ .Values.healthIngress.hostname }}
secretName: {{ printf "%s-tls" .Values.healthIngress.hostname }}
{{- end }}
{{- if .Values.healthIngress.extraTls }}
{{- toYaml .Values.healthIngress.extraTls | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -394,6 +394,61 @@ ingress:
## key:
## certificate:
healthIngress:
## Set to true to enable heallth ingress record generation
##
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
##
certManager: false
## When the heallth ingress is enabled, a host pointing to this will be created
##
hostname: aspnet-core.local
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
##
annotations: {}
## Enable TLS configuration for the hostname defined at ingress.hostname parameter
## TLS certificates will be retrieved from a TLS secret with name: {{- printf "%s-tls" .Values.ingress.hostname }}
## You can use the ingress.secrets parameter to create this TLS secret, relay on cert-manager to create it, or
## let the chart create self-signed certificates for you
##
tls: false
## The list of additional hostnames to be covered with this heallth ingress record.
## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array
## extraHosts:
## - name: aspnet-core.local
## path: /
## The tls configuration for additional hostnames to be covered with this heallth ingress record.
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## extraTls:
## - hosts:
## - aspnet-core.local
## secretName: aspnet-core.local-tls
## If you're providing your own certificates, please use this to add the certificates as secrets
## key and certificate should start with -----BEGIN CERTIFICATE----- or -----BEGIN RSA PRIVATE KEY-----
## name should line up with a secretName set further up
##
## If it is not set and you're using cert-manager, this is unneeded, as it will create the secret for you
## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created
## It is also possible to create and manage the certificates outside of this helm chart
## Please see README.md for more information
##
secrets: []
## - name: aspnet-core.local-tls
## key:
## certificate:
## K8s Service Account.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##

View File

@@ -395,6 +395,61 @@ ingress:
## key:
## certificate:
healthIngress:
## Set to true to enable heallth ingress record generation
##
enabled: false
## Set this to true in order to add the corresponding annotations for cert-manager
##
certManager: false
## When the heallth ingress is enabled, a host pointing to this will be created
##
hostname: aspnet-core.local
## Ingress annotations done as key:value pairs
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
##
## If certManager is set to true, annotation kubernetes.io/tls-acme: "true" will automatically be set
##
annotations: {}
## Enable TLS configuration for the hostname defined at ingress.hostname parameter
## TLS certificates will be retrieved from a TLS secret with name: {{- printf "%s-tls" .Values.ingress.hostname }}
## You can use the ingress.secrets parameter to create this TLS secret, relay on cert-manager to create it, or
## let the chart create self-signed certificates for you
##
tls: false
## The list of additional hostnames to be covered with this heallth ingress record.
## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array
## extraHosts:
## - name: aspnet-core.local
## path: /
## The tls configuration for additional hostnames to be covered with this heallth ingress record.
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## extraTls:
## - hosts:
## - aspnet-core.local
## secretName: aspnet-core.local-tls
## If you're providing your own certificates, please use this to add the certificates as secrets
## key and certificate should start with -----BEGIN CERTIFICATE----- or -----BEGIN RSA PRIVATE KEY-----
## name should line up with a secretName set further up
##
## If it is not set and you're using cert-manager, this is unneeded, as it will create the secret for you
## If it is not set and you're NOT using cert-manager either, self-signed certificates will be created
## It is also possible to create and manage the certificates outside of this helm chart
## Please see README.md for more information
##
secrets: []
## - name: aspnet-core.local-tls
## key:
## certificate:
## K8s Service Account.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
##