Skip to content

Commit

Permalink
fix: rename gateway api + add enabled flag
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweaver87 committed Dec 9, 2024
1 parent c5f8ebf commit 9a10aa3
Show file tree
Hide file tree
Showing 13 changed files with 10,404 additions and 10,384 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ If you still want to manage CRDs your self, it can be opt-out:

```bash
# Upgrade Traefik and skip all CRDs installation
helm upgrade traefik traefik/traefik --set traefik-crds.traefik=false --set traefik-crds.hub=false --set traefik-crds.gateway_api=false
helm upgrade traefik traefik/traefik --set traefik-crds.enabled=true --set traefik-crds.traefik=false --set traefik-crds.hub=false --set traefik-crds.gatewayAPI=false
```

### Upgrade up to 27.X
Expand Down
3 changes: 2 additions & 1 deletion traefik-crds/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Kubernetes: `>=1.22.0-0`
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| deleteOnUninstall | bool | `false` | |
| gateway_api | bool | `false` | |
| enabled | bool | `true` | |
| gatewayAPI | bool | `false` | |
| global | string | `nil` | |
| hub | bool | `false` | |
| traefik | bool | `false` | |
Expand Down
10,345 changes: 10,345 additions & 0 deletions traefik-crds/crds-files/gatewayAPI/gateway-standard-install-v1.2.0.yaml

Large diffs are not rendered by default.

10,345 changes: 0 additions & 10,345 deletions traefik-crds/crds-files/gateway_api/gateway-standard-install-v1.2.0.yaml

This file was deleted.

24 changes: 12 additions & 12 deletions traefik-crds/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ kind: Kustomization
apiVersion: kustomize.config.k8s.io/v1beta1
resources:
# curl -o gateway-standard-install-v1.2.0.yaml -L https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml
- crds-files/gateway_api/gateway-standard-install-v1.2.0.yaml
- crds-files/hub.traefik.io_accesscontrolpolicies.yaml
- crds-files/hub.traefik.io_aiservices.yaml
- crds-files/hub.traefik.io_apiaccesses.yaml
- crds-files/hub.traefik.io_apibundles.yaml
- crds-files/hub.traefik.io_apicatalogitems.yaml
- crds-files/hub.traefik.io_apiplans.yaml
- crds-files/hub.traefik.io_apiportals.yaml
- crds-files/hub.traefik.io_apiratelimits.yaml
- crds-files/hub.traefik.io_apis.yaml
- crds-files/hub.traefik.io_apiversions.yaml
- crds-files/hub.traefik.io_managedsubscriptions.yaml
- crds-files/gatewayAPI/gateway-standard-install-v1.2.0.yaml
- crds-files/hub/hub.traefik.io_accesscontrolpolicies.yaml
- crds-files/hub/hub.traefik.io_aiservices.yaml
- crds-files/hub/hub.traefik.io_apiaccesses.yaml
- crds-files/hub/hub.traefik.io_apibundles.yaml
- crds-files/hub/hub.traefik.io_apicatalogitems.yaml
- crds-files/hub/hub.traefik.io_apiplans.yaml
- crds-files/hub/hub.traefik.io_apiportals.yaml
- crds-files/hub/hub.traefik.io_apiratelimits.yaml
- crds-files/hub/hub.traefik.io_apis.yaml
- crds-files/hub/hub.traefik.io_apiversions.yaml
- crds-files/hub/hub.traefik.io_managedsubscriptions.yaml
- crds-files/traefik/traefik.io_ingressroutes.yaml
- crds-files/traefik/traefik.io_ingressroutetcps.yaml
- crds-files/traefik/traefik.io_ingressrouteudps.yaml
Expand Down
4 changes: 2 additions & 2 deletions traefik-crds/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
{{ include "traefik-crds.render-crds" (dict "scope" . "path" "crds-files/hub/*.yaml") }}
{{- end }}

{{- if eq (.Values.gateway_api | toString) "true" -}}
{{ include "traefik-crds.render-crds" (dict "scope" . "path" "crds-files/gateway_api/*.yaml") }}
{{- if eq (.Values.gatewayAPI | toString) "true" -}}
{{ include "traefik-crds.render-crds" (dict "scope" . "path" "crds-files/gatewayAPI/*.yaml") }}
{{- end }}
4 changes: 2 additions & 2 deletions traefik-crds/tests/crds_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tests:

- it: should have all Gateway API crds
set:
gateway_api: true
gatewayAPI: true
asserts:
- hasDocuments:
count: 5
Expand All @@ -63,7 +63,7 @@ tests:

- it: should have all Gateway API crds without helm keep resource policy
set:
gateway_api: true
gatewayAPI: true
deleteOnUninstall: true
asserts:
- hasDocuments:
Expand Down
5 changes: 4 additions & 1 deletion traefik-crds/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
"deleteOnUninstall": {
"type": "boolean"
},
"gateway_api": {
"enabled": {
"type": "boolean"
},
"gatewayAPI": {
"default": false,
"type": [
"string",
Expand Down
3 changes: 2 additions & 1 deletion traefik-crds/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
global: # @schema type:[object, null]; additionalProperties: true
enabled: true
traefik: false
gateway_api: false # @schema type:[string, boolean]; default: false
gatewayAPI: false # @schema type:[string, boolean]; default: false
hub: false # @schema type:[string, boolean]; default: false
deleteOnUninstall: false
2 changes: 1 addition & 1 deletion traefik/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ dependencies:
- name: traefik-crds
version: 0.0.1
repository: https://traefik.github.io/charts
condition: or traefik-crds.traefik traefik-crds.hub traefik-crds.gateway_api
condition: traefik-crds.enabled
9 changes: 5 additions & 4 deletions traefik/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ Kubernetes: `>=1.22.0-0`
| extraObjects | list | `[]` | Extra objects to deploy (value evaluated as a template) In some cases, it can avoid the need for additional, extended or adhoc deployments. See #595 for more details and traefik/tests/values/extra.yaml for example. |
| gateway.annotations | object | `{}` | Additional gateway annotations (e.g. for cert-manager.io/issuer) |
| gateway.enabled | bool | `true` | When providers.kubernetesGateway.enabled, deploy a default gateway |
| gateway.infrastructure | object | `{}` | [Infrastructure](https://kubernetes.io/blog/2023/11/28/gateway-api-ga/#gateway-infrastructure-labels) |
| gateway.infrastructure | object | `{}` | [Infrastructure](https://kubernetes.io/blog/2023/11/28/gatewayAPI-ga/#gateway-infrastructure-labels) |
| gateway.listeners | object | `{"web":{"hostname":"","namespacePolicy":null,"port":8000,"protocol":"HTTP"}}` | Define listeners |
| gateway.listeners.web.hostname | string | `""` | Optional hostname. See [Hostname](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname) |
| gateway.listeners.web.namespacePolicy | string | `nil` | Routes are restricted to namespace of the gateway [by default](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces |
| gateway.listeners.web.hostname | string | `""` | Optional hostname. See [Hostname](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname) |
| gateway.listeners.web.namespacePolicy | string | `nil` | Routes are restricted to namespace of the gateway [by default](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces |
| gateway.listeners.web.port | int | `8000` | Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules. The port must match a port declared in ports section. |
| gateway.name | string | `""` | Set a custom name to gateway |
| gateway.namespace | string | `""` | By default, Gateway is created in the same `Namespace` than Traefik. |
Expand Down Expand Up @@ -317,7 +317,8 @@ Kubernetes: `>=1.22.0-0`
| tracing.otlp.http.tls.cert | string | `""` | The path to the public certificate. When using this option, setting the key option is required. |
| tracing.otlp.http.tls.insecureSkipVerify | bool | `false` | When set to true, the TLS connection accepts any certificate presented by the server regardless of the hostnames it covers. |
| tracing.otlp.http.tls.key | string | `""` | The path to the private key. When using this option, setting the cert option is required. |
| traefik-crds.gateway_api | string | `"{{- tpl \".Values.providers.kubernetesGateway.enabled\" . }}\n"` | |
| traefik-crds.enabled | bool | `false` | Set it to true to opt-in CRD management |
| traefik-crds.gatewayAPI | string | `"{{- tpl \".Values.providers.kubernetesGateway.enabled\" . }}\n"` | |
| traefik-crds.hub | string | `"{{- tpl \"and .Values.hub.token .Values.hub.apimanagement.enabled\"' . }}\n"` | |
| traefik-crds.traefik | bool | `true` | Set all the following to false if you want to manage CRDs your-self |
| updateStrategy.rollingUpdate.maxSurge | int | `1` | |
Expand Down
17 changes: 14 additions & 3 deletions traefik/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1644,11 +1644,22 @@
},
"traefik-crds": {
"properties": {
"gateway_api": {
"type": "string"
"enabled": {
"type": "boolean"
},
"gatewayAPI": {
"default": false,
"type": [
"string",
"boolean"
]
},
"hub": {
"type": "string"
"default": false,
"type": [
"string",
"boolean"
]
},
"traefik": {
"type": "boolean"
Expand Down
25 changes: 14 additions & 11 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,35 +140,35 @@ gateway:
namespace: ""
# -- Additional gateway annotations (e.g. for cert-manager.io/issuer)
annotations: {}
# -- [Infrastructure](https://kubernetes.io/blog/2023/11/28/gateway-api-ga/#gateway-infrastructure-labels)
# -- [Infrastructure](https://kubernetes.io/blog/2023/11/28/gatewayAPI-ga/#gateway-infrastructure-labels)
infrastructure: {}
# -- Define listeners
listeners:
web:
# -- Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.
# The port must match a port declared in ports section.
port: 8000
# -- Optional hostname. See [Hostname](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname)
# -- Optional hostname. See [Hostname](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname)
hostname: ""
# Specify expected protocol on this listener. See [ProtocolType](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ProtocolType)
# Specify expected protocol on this listener. See [ProtocolType](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ProtocolType)
protocol: HTTP
# -- Routes are restricted to namespace of the gateway [by default](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces
# -- Routes are restricted to namespace of the gateway [by default](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces
namespacePolicy: # @schema type:[string, null]
# websecure listener is disabled by default because certificateRefs needs to be added,
# or you may specify TLS protocol with Passthrough mode and add "--providers.kubernetesGateway.experimentalChannel=true" in additionalArguments section.
# websecure:
# # -- Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.
# # The port must match a port declared in ports section.
# port: 8443
# # -- Optional hostname. See [Hostname](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname)
# # -- Optional hostname. See [Hostname](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.Hostname)
# hostname:
# # Specify expected protocol on this listener See [ProtocolType](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ProtocolType)
# # Specify expected protocol on this listener See [ProtocolType](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.ProtocolType)
# protocol: HTTPS
# # -- Routes are restricted to namespace of the gateway [by default](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces)
# # -- Routes are restricted to namespace of the gateway [by default](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.FromNamespaces)
# namespacePolicy:
# # -- Add certificates for TLS or HTTPS protocols. See [GatewayTLSConfig](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.GatewayTLSConfig)
# # -- Add certificates for TLS or HTTPS protocols. See [GatewayTLSConfig](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.GatewayTLSConfig)
# certificateRefs:
# # -- TLS behavior for the TLS session initiated by the client. See [TLSModeType](https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.TLSModeType).
# # -- TLS behavior for the TLS session initiated by the client. See [TLSModeType](https://gatewayAPI.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.TLSModeType).
# mode:

gatewayClass: # @schema additionalProperties: false
Expand Down Expand Up @@ -953,9 +953,12 @@ hub:
sendlogs: # @schema type:[boolean, null]

traefik-crds:
# -- Set it to true to opt-in CRD management
enabled: false

# -- Set all the following to false if you want to manage CRDs your-self
traefik: true
hub: |
hub: | # @schema type:[string, boolean]; default: false
{{- tpl "and .Values.hub.token .Values.hub.apimanagement.enabled"' . }}
gateway_api: |
gatewayAPI: | # @schema type:[string, boolean]; default: false
{{- tpl ".Values.providers.kubernetesGateway.enabled" . }}

0 comments on commit 9a10aa3

Please sign in to comment.