adutra commented on code in PR #3314: URL: https://github.com/apache/polaris/pull/3314#discussion_r2668638621
########## helm/polaris/README.md: ########## @@ -151,6 +151,17 @@ Below are two sample deployment models for installing the chart: one with a non- > **These files are intended for testing purposes primarily, and may not be > suitable for production use**. > For production deployments, create your own values files based on the > provided examples. +### Using the Gateway API (Advanced) Review Comment: I think this section is not well placed, because the text right above makes references to the sections right below. Maybe move this down? ########## helm/polaris/README.md: ########## @@ -151,6 +151,17 @@ Below are two sample deployment models for installing the chart: one with a non- > **These files are intended for testing purposes primarily, and may not be > suitable for production use**. > For production deployments, create your own values files based on the > provided examples. +### Using the Gateway API (Advanced) + +You may want to use the [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/) for more advanced network routing. To do so, you may need to run the following commands: +```bash +kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/latest/download/standard-install.yaml +helm install envoy-gateway oci://docker.io/envoyproxy/gateway-helm -n gateway --create-namespace Review Comment: Maybe mention above or below that this is just an example of Gateway implementation by Envoy. ########## helm/polaris/templates/httproute.yaml: ########## @@ -0,0 +1,52 @@ +{{/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/}} + +{{- include "polaris.validateRouting" . }} +{{- if .Values.httproute.enabled }} +{{- $fullName := include "polaris.fullname" . }} +{{- $svcPort := get (first .Values.service.ports) "port" }} + +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "polaris.labels" . | nindent 4 }} + {{- with .Values.httproute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + hostnames: {{ .Values.httproute.hosts }} + # This will be different depending on which Gateway implementation is in use and the configuration of the Gateway resource Review Comment: Does this mean that a user could provide a Gateway configuration that would be incompatible with the HTTPRoute resource being generated? Just trying to understand what this comment implies. ########## helm/polaris/README.md: ########## @@ -151,6 +151,17 @@ Below are two sample deployment models for installing the chart: one with a non- > **These files are intended for testing purposes primarily, and may not be > suitable for production use**. > For production deployments, create your own values files based on the > provided examples. +### Using the Gateway API (Advanced) + +You may want to use the [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/) for more advanced network routing. To do so, you may need to run the following commands: Review Comment: I am not sure these commands make sense here, unless we are talking about testing the Helm chart (there is a constant fluctuation in this file between production vs testing guidelines). Assuming this section is about production guidelines: I think the most important thing to mention is that in most cases, a Gateway will be already present in the cluster (since this resource is generally managed by an admin persona). The below commands would basically correspond to what that admin persona would have done. So imho they only make sense for testing purposes, not for deploying in production. And finally we could also mention that a Gateway can be installed as part of the chart installation. This should be restricted to simpler setups, since it installs a Gateway in the same namespace as Polaris, and with the same privileges. ########## helm/polaris/templates/_helpers.tpl: ########## @@ -89,6 +89,15 @@ app.kubernetes.io/name: {{ include "polaris.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Validate that only one of ingress or httproute is enabled +*/}} +{{- define "polaris.validateRouting" -}} +{{- if and .Values.ingress.enabled .Values.httproute.enabled }} +{{- fail "Cannot enable both ingress and httproute. Please enable only one." }} Review Comment: You could also validate that if `.Values.gateway.enabled` is true, then `.Values.httproute.enabled` must be true as well, wdyt? ########## helm/polaris/README.md: ########## @@ -151,6 +151,17 @@ Below are two sample deployment models for installing the chart: one with a non- > **These files are intended for testing purposes primarily, and may not be > suitable for production use**. > For production deployments, create your own values files based on the > provided examples. +### Using the Gateway API (Advanced) Review Comment: Please don't make changes directly to this file, but modify `README.md.gotmpl` instead then run `helm-docs --chart-search-root=helm`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
