diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 0fa82fe..cf41776 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -61,8 +61,8 @@ rules: - verbs: - "*" apiGroups: - - "networking.k8s.io" + - "gateway.networking.k8s.io" resources: - - "ingresses" + - "httproutes" # +kubebuilder:scaffold:rules diff --git a/helm-charts/stage/templates/http-route.yaml b/helm-charts/stage/templates/http-route.yaml new file mode 100644 index 0000000..8055d68 --- /dev/null +++ b/helm-charts/stage/templates/http-route.yaml @@ -0,0 +1,17 @@ + +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ include "stage.fullname" . }} +spec: + parentRefs: + - name: {{ .Values.gateway.name }} + namespace: {{ .Values.gateway.namespace }} + rules: + - backendRefs: + - name: {{ include "stage.fullname" $ }} + port: {{ $.Values.service.port }} + matches: + - path: + type: PathPrefix + value: /{{ .Values.ontime.prefix}} \ No newline at end of file diff --git a/helm-charts/stage/templates/ingress.yaml b/helm-charts/stage/templates/ingress.yaml deleted file mode 100644 index 386bf95..0000000 --- a/helm-charts/stage/templates/ingress.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ include "stage.fullname" . }} - labels: - {{- include "stage.labels" . | nindent 4 }} - annotations: - {{- if .Values.ingress.tls.issuer }} - cert-manager.io/cluster-issuer: {{ .Values.ingress.tls.issuer}} - {{- end}} -spec: - {{- with .Values.ingress.className }} - ingressClassName: {{ . }} - {{- end }} - rules: - - http: - paths: - - path: /{{ .Values.ontime.prefix}} - pathType: ImplementationSpecific - backend: - service: - name: {{ include "stage.fullname" $ }} - port: - number: {{ $.Values.service.port }} - {{- if .Values.ingress.hostname }} - host: {{ .Values.ingress.hostname | quote }} - {{- if .Values.ingress.tls.enabled }} - tls: - - hosts: - - {{ .Values.ingress.hostname | quote }} - secretName: {{ include "stage.fullname" . }}-cert - {{- end }} - {{- end }} diff --git a/helm-charts/stage/values.yaml b/helm-charts/stage/values.yaml index c84b5a3..c06e169 100644 --- a/helm-charts/stage/values.yaml +++ b/helm-charts/stage/values.yaml @@ -42,13 +42,9 @@ service: type: ClusterIP port: 4001 -# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ -ingress: - className: "" - # hostname: "ontime.example.com" - tls: - enabled: false - issuer: '' +gateway: + name: "ontime" + namespace: "kube-system" resources: {} # We usually recommend not to specify default resources and to leave this as a conscious