mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-26 08:14:42 +00:00
🏗️ Give the user ability to set ingress as needed (#1417)
* Give the user hability to set ingress as needed - Removed unecessary IngressClass. - If no IngressClassName passed, use cluster's default class - Renamed `ingressclass` with `IngressClassName`. Is the standard name used for it. - Included custom annotations for Ingress. This way user can set any custom annotation for the ingress only. Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> * Update helm-chart/templates/11-ingress.yaml Co-authored-by: M. Mert Yildiran <me@mertyildiran.com> * Update config/configStructs/tapConfig.go Co-authored-by: M. Mert Yildiran <me@mertyildiran.com> * Update helm-chart/templates/11-ingress.yaml Co-authored-by: M. Mert Yildiran <me@mertyildiran.com> * update default ingressClassName value Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> --------- Signed-off-by: Luiz Oliveira <ziuloliveira@gmail.com> Co-authored-by: M. Mert Yildiran <me@mertyildiran.com>
This commit is contained in:
parent
3222212367
commit
1ccaa03fb2
@ -88,11 +88,10 @@ type AuthConfig struct {
|
|||||||
|
|
||||||
type IngressConfig struct {
|
type IngressConfig struct {
|
||||||
Enabled bool `yaml:"enabled" json:"enabled" default:"false"`
|
Enabled bool `yaml:"enabled" json:"enabled" default:"false"`
|
||||||
ClassName string `yaml:"classname" json:"classname" default:"kubeshark-ingress-class"`
|
ClassName string `yaml:"classname" json:"classname" default:""`
|
||||||
Controller string `yaml:"controller" json:"controller" default:"k8s.io/ingress-nginx"`
|
|
||||||
Host string `yaml:"host" json:"host" default:"ks.svc.cluster.local"`
|
Host string `yaml:"host" json:"host" default:"ks.svc.cluster.local"`
|
||||||
TLS []networking.IngressTLS `yaml:"tls" json:"tls"`
|
TLS []networking.IngressTLS `yaml:"tls" json:"tls" default:"[]"`
|
||||||
CertManager string `yaml:"certmanager" json:"certmanager" default:"letsencrypt-prod"`
|
Annotations map[string]string `yaml:"annotations" json:"annotations" default:"{}"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReleaseConfig struct {
|
type ReleaseConfig struct {
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
{{- if .Values.tap.ingress.enabled }}
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: IngressClass
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
{{- include "kubeshark.labels" . | nindent 4 }}
|
|
||||||
annotations:
|
|
||||||
{{- if .Values.tap.annotations }}
|
|
||||||
{{- toYaml .Values.tap.annotations | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
name: kubeshark-ingress-class
|
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
spec:
|
|
||||||
controller: {{ .Values.tap.ingress.controller }}
|
|
||||||
{{- end }}
|
|
@ -4,17 +4,21 @@ apiVersion: networking.k8s.io/v1
|
|||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
certmanager.k8s.io/cluster-issuer: {{ .Values.tap.ingress.certmanager }}
|
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||||
{{- if .Values.tap.annotations }}
|
{{- if .Values.tap.annotations }}
|
||||||
{{- toYaml .Values.tap.annotations | nindent 4 }}
|
{{- toYaml .Values.tap.annotations | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.tap.ingress.annotations }}
|
||||||
|
{{- toYaml .Values.tap.ingress.annotations | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "kubeshark.labels" . | nindent 4 }}
|
{{- include "kubeshark.labels" . | nindent 4 }}
|
||||||
name: kubeshark-ingress
|
name: kubeshark-ingress
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
spec:
|
spec:
|
||||||
|
{{- if .Values.tap.ingress.classname }}
|
||||||
ingressClassName: {{ .Values.tap.ingress.classname }}
|
ingressClassName: {{ .Values.tap.ingress.classname }}
|
||||||
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ .Values.tap.ingress.host }}
|
- host: {{ .Values.tap.ingress.host }}
|
||||||
http:
|
http:
|
||||||
@ -24,17 +28,17 @@ spec:
|
|||||||
name: kubeshark-hub
|
name: kubeshark-hub
|
||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
path: /api(/|$)(.*)
|
path: /api
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
- backend:
|
- backend:
|
||||||
service:
|
service:
|
||||||
name: kubeshark-front
|
name: kubeshark-front
|
||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
path: /()(.*)
|
path: /
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
|
{{- if .Values.tap.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
{{- if gt (len .Values.tap.ingress.tls) 0}}
|
|
||||||
{{- toYaml .Values.tap.ingress.tls | nindent 2 }}
|
{{- toYaml .Values.tap.ingress.tls | nindent 2 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
status:
|
status:
|
||||||
|
@ -28,12 +28,11 @@ tap:
|
|||||||
dryrun: false
|
dryrun: false
|
||||||
ignoretainted: false
|
ignoretainted: false
|
||||||
ingress:
|
ingress:
|
||||||
certmanager: letsencrypt-prod
|
|
||||||
classname: kubeshark-ingress-class
|
|
||||||
controller: k8s.io/ingress-nginx
|
|
||||||
enabled: false
|
enabled: false
|
||||||
host: ks.svc.cluster.local
|
classname: ""
|
||||||
tls: null
|
host: kubeshark.local
|
||||||
|
annotations: {}
|
||||||
|
tls: []
|
||||||
ipv6: true
|
ipv6: true
|
||||||
labels: {}
|
labels: {}
|
||||||
namespaces: []
|
namespaces: []
|
||||||
|
Loading…
Reference in New Issue
Block a user