Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph: add networking.k8s.io/v1 Ingress chart compatability #8666

Merged
merged 1 commit into from
Sep 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions cluster/charts/rook-ceph-cluster/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{{- if .Values.ingress.dashboard.host }}
---
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
apiVersion: networking.k8s.io/v1
{{ else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
apiVersion: networking.k8s.io/v1beta1
{{ else }}
apiVersion: extensions/v1beta1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this condition still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on which k8s versions rook supports. networking.k8s.io/v1 was introduced in 1.19 and networking.k8s.io/v1beta1 was introduced in 1.14. Do we want to keep the latter to support <1.19 or remove it and force those users install an older version of the chart?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant this one apiVersion: extensions/v1beta1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah. That one's pretty old but the docs say 1.11 is the minimum supported version so it should probably stay.

Expand All @@ -16,10 +18,18 @@ spec:
- host: {{ .Values.ingress.dashboard.host.name }}
http:
paths:
- path: {{ .Values.ingress.dashboard.host.path }}
- path: {{ .Values.ingress.dashboard.host.path | default "/" }}
backend:
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
service:
name: rook-ceph-mgr-dashboard
port:
name: http-dashboard
pathType: Prefix
{{- else }}
serviceName: rook-ceph-mgr-dashboard
servicePort: http-dashboard
{{- end }}
{{- if .Values.ingress.dashboard.tls }}
tls: {{- toYaml .Values.ingress.dashboard.tls | nindent 4 }}
{{- end }}
Expand Down