Skip to content

Commit 4a9a89a

Browse files
committed
Add kgateway helm chart
Signed-off-by: Cyclinder Kuo <qifeng.guo@daocloud.io>
1 parent 020f4d3 commit 4a9a89a

File tree

60 files changed

+53137
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+53137
-4
lines changed

charts/kgateway/config

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export USE_OPENSOURCE_CHART=false
2+
3+
# must
4+
export REPO_URL=oci://cr.kgateway.dev/kgateway-dev/charts
5+
export REPO_NAME=kgateway
6+
export CHART_NAME=kgateway
7+
export VERSION=v2.2.1
8+
9+
# pr, issue, none
10+
export UPGRADE_METHOD=pr
11+
export UPGRADE_REVIWER=cyclinder
12+
export TEST_ASSIGNER=cyclinder
13+
14+
# optional, for wrapper chart
15+
export CUSTOM_SHELL=custom.sh
16+
# push to daocloud repo
17+
export DAOCLOUD_REPO_PROJECT=addon
18+
19+
export NO_TRIVY=true

charts/kgateway/custom.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#! /bin/bash
2+
3+
set -euo pipefail
4+
5+
CHART_BUILD_DIR=${1}
6+
[ -n "${CHART_BUILD_DIR}" ] || { echo "error, empty CHART_BUILD_DIR" ; exit 1 ; }
7+
[ -d "${CHART_BUILD_DIR}" ] || { echo "error, CHART_BUILD_DIR not found: ${CHART_BUILD_DIR}" ; exit 1 ; }
8+
9+
CURRENT_DIR_PATH=$(cd $(dirname "$0"); pwd)
10+
PROJECT_ROOT_PATH=$( cd ${CURRENT_DIR_PATH}/../.. && pwd )
11+
12+
GATEWAY_API_CHART_SRC=${PROJECT_ROOT_PATH}/charts/gateway-api/gateway-api
13+
[ -d "${GATEWAY_API_CHART_SRC}" ] || { echo "error, failed to find gateway-api chart: ${GATEWAY_API_CHART_SRC}" ; exit 1 ; }
14+
15+
mkdir -p "${CHART_BUILD_DIR}/charts"
16+
17+
rm -rf "${CHART_BUILD_DIR}/charts/gateway-api"
18+
cp -R "${GATEWAY_API_CHART_SRC}" "${CHART_BUILD_DIR}/charts/gateway-api"
19+
20+
KGATEWAY_CRDS_OCI_REF="oci://cr.kgateway.dev/kgateway-dev/charts/kgateway-crds"
21+
KGATEWAY_VERSION=$(yq -r '.dependencies[] | select(.name == "kgateway") | .version' "${CHART_BUILD_DIR}/Chart.yaml" 2>/dev/null || true)
22+
23+
if [ -z "${KGATEWAY_VERSION}" ] ; then
24+
KGATEWAY_VERSION=$(yq -r '.version' "${CHART_BUILD_DIR}/charts/kgateway/Chart.yaml" 2>/dev/null || true)
25+
fi
26+
27+
rm -rf "${CHART_BUILD_DIR}/charts/kgateway-crds"
28+
if [ -n "${KGATEWAY_VERSION}" ] ; then
29+
helm pull "${KGATEWAY_CRDS_OCI_REF}" --untar --untardir "${CHART_BUILD_DIR}/charts" --version "${KGATEWAY_VERSION}"
30+
else
31+
helm pull "${KGATEWAY_CRDS_OCI_REF}" --untar --untardir "${CHART_BUILD_DIR}/charts"
32+
fi
33+
34+
cd "${CHART_BUILD_DIR}"
35+
36+
GATEWAY_API_VERSION=$(yq -r '.version' "${CHART_BUILD_DIR}/charts/gateway-api/Chart.yaml")
37+
KGATEWAY_CRDS_VERSION=$(yq -r '.version' "${CHART_BUILD_DIR}/charts/kgateway-crds/Chart.yaml")
38+
KGATEWAY_CHILD_VERSION=$(yq -r '.version' "${CHART_BUILD_DIR}/charts/kgateway/Chart.yaml")
39+
40+
yq -i '.dependencies = [
41+
{"name": "gateway-api", "version": strenv(GATEWAY_API_VERSION), "repository": "file://charts/gateway-api", "condition": "installGatewayApiCrd"},
42+
{"name": "kgateway-crds", "version": strenv(KGATEWAY_CRDS_VERSION), "repository": "file://charts/kgateway-crds"},
43+
{"name": "kgateway", "version": strenv(KGATEWAY_CHILD_VERSION), "repository": "file://charts/kgateway"}
44+
]' Chart.yaml
45+
46+
yq -i '.keywords = ["kubernetes", "networking", "api-gateway"]' Chart.yaml
47+
48+
export CHART_VERSION=$(yq -r '.version' Chart.yaml)
49+
yq -i '
50+
.kgateway.image.tag=strenv(CHART_VERSION) |
51+
.kgateway.resources.requests.cpu="256mi" |
52+
.kgateway.resources.requests.memory="400Mi" |
53+
.kgateway.resources.limits.cpu="512mi" |
54+
.kgateway.resources.limits.memory="800Mi" |
55+
.installK8sGatewayAPI=false
56+
' values.yaml
57+
58+
helm-docs
59+
exit 0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- "{{ .kgateway.image.registry }}/{{ .kgateway.controller.image.repository }}:{{ .kgateway.controller.image.tag | default .kgateway.image.tag | default \"v2.2.1\" }}"
2+
- "{{ .kgateway.image.registry }}/envoy-wrapper:{{ .kgateway.image.tag }}"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v2
2+
appVersion: v2.2.1
3+
description: A Helm chart for the kgateway project
4+
icon: https://raw.githubusercontent.com/kgateway-dev/kgateway.dev/main/static/favicon.svg
5+
name: kgateway
6+
type: application
7+
version: v2.2.1
8+
dependencies:
9+
- name: gateway-api
10+
version: ""
11+
repository: file://charts/gateway-api
12+
condition: installGatewayApiCrd
13+
- name: kgateway-crds
14+
version: ""
15+
repository: file://charts/kgateway-crds
16+
- name: kgateway
17+
version: ""
18+
repository: file://charts/kgateway
19+
keywords:
20+
- kubernetes
21+
- networking
22+
- api-gateway

charts/kgateway/kgateway/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# kgateway
2+
3+
![Version: v2.2.1](https://img.shields.io/badge/Version-v2.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.2.1](https://img.shields.io/badge/AppVersion-v2.2.1-informational?style=flat-square)
4+
5+
A Helm chart for the kgateway project
6+
7+
## Requirements
8+
9+
| Repository | Name | Version |
10+
|------------|------|---------|
11+
| file://charts/gateway-api | gateway-api | |
12+
| file://charts/kgateway-crds | kgateway-crds | |
13+
| file://charts/kgateway | kgateway | |
14+
15+
## Values
16+
17+
| Key | Type | Default | Description |
18+
|-----|------|---------|-------------|
19+
| installK8sGatewayAPI | bool | `false` | |
20+
| kgateway.affinity | object | `{}` | Set affinity rules for pod scheduling, such as 'nodeAffinity:'. |
21+
| kgateway.controller | object | `{"extraEnv":{},"image":{"pullPolicy":"","registry":"","repository":"kgateway","tag":""},"logLevel":"info","podDisruptionBudget":{},"replicaCount":1,"service":{"ports":{"grpc":9977,"health":9093,"metrics":9092},"type":"ClusterIP"},"strategy":{},"xds":{"tls":{"enabled":false}}}` | Configure the kgateway control plane deployment. |
22+
| kgateway.controller.extraEnv | object | `{}` | Add extra environment variables to the controller container. |
23+
| kgateway.controller.image | object | `{"pullPolicy":"","registry":"","repository":"kgateway","tag":""}` | Configure the controller container image. |
24+
| kgateway.controller.image.pullPolicy | string | `""` | Set the image pull policy for the controller. |
25+
| kgateway.controller.image.registry | string | `""` | Set the image registry for the controller. |
26+
| kgateway.controller.image.repository | string | `"kgateway"` | Set the image repository for the controller. |
27+
| kgateway.controller.image.tag | string | `""` | Set the image tag for the controller. |
28+
| kgateway.controller.logLevel | string | `"info"` | Set the log level for the controller. |
29+
| kgateway.controller.podDisruptionBudget | object | `{}` | Set pod disruption budget for the controller. Note that this does not affect the data plane. E.g.: podDisruptionBudget: minAvailable: 100% |
30+
| kgateway.controller.replicaCount | int | `1` | Set the number of controller pod replicas. |
31+
| kgateway.controller.service | object | `{"ports":{"grpc":9977,"health":9093,"metrics":9092},"type":"ClusterIP"}` | Configure the controller service. |
32+
| kgateway.controller.service.ports | object | `{"grpc":9977,"health":9093,"metrics":9092}` | Set the service ports for gRPC and health endpoints. |
33+
| kgateway.controller.service.type | string | `"ClusterIP"` | Set the service type for the controller. |
34+
| kgateway.controller.strategy | object | `{}` | Change the rollout strategy from the Kubernetes default of a RollingUpdate with 25% maxUnavailable, 25% maxSurge. E.g., to recreate pods, minimizing resources for the rollout but causing downtime: strategy: type: Recreate E.g., to roll out as a RollingUpdate but with non-default parameters: strategy: type: RollingUpdate rollingUpdate: maxSurge: 100% |
35+
| kgateway.controller.xds | object | `{"tls":{"enabled":false}}` | Configure TLS settings for the xDS gRPC servers. |
36+
| kgateway.controller.xds.tls.enabled | bool | `false` | Enable TLS encryption for xDS communication. When enabled, both the main xDS server (port 9977) and agent gateway xDS server (port 9978) will use TLS. When TLS is enabled, you must create a Secret named 'kgateway-xds-cert' in the kgateway installation namespace. The Secret must be of type 'kubernetes.io/tls' with 'tls.crt', 'tls.key', and 'ca.crt' data fields present. |
37+
| kgateway.deploymentAnnotations | object | `{}` | Add annotations to the kgateway deployment. |
38+
| kgateway.discoveryNamespaceSelectors | list | `[]` | List of namespace selectors (OR'ed): each entry can use 'matchLabels' or 'matchExpressions' (AND'ed within each entry if used together). Kgateway includes the selected namespaces in config discovery. For more information, see the docs https://kgateway.dev/docs/latest/install/advanced/#namespace-discovery. |
39+
| kgateway.fullnameOverride | string | `""` | Override the full name of resources created by the Helm chart, which is 'kgateway'. If you set 'fullnameOverride: "foo", the full name of the resources that the Helm release creates become 'foo', such as the deployment, service, and service account for the kgateway control plane in the kgateway-system namespace. |
40+
| kgateway.gatewayClassParametersRefs | object | `{}` | Map of GatewayClass names to GatewayParameters references that will be set on the default GatewayClasses managed by kgateway. Each entry must define both the name and namespace of the GatewayParameters resource. The default GatewayClasses managed by kgateway are: - kgateway - kgateway-waypoint Example: gatewayClassParametersRefs: kgateway: name: shared-gwp namespace: kgateway-system |
41+
| kgateway.image | object | `{"pullPolicy":"IfNotPresent","registry":"cr.kgateway.dev/kgateway-dev","tag":"v2.2.1"}` | Configure the default container image for the components that Helm deploys. You can override these settings for each particular component in that component's section, such as 'controller.image' for the kgateway control plane. If you use your own private registry, make sure to include the imagePullSecrets. |
42+
| kgateway.image.pullPolicy | string | `"IfNotPresent"` | Set the default image pull policy. |
43+
| kgateway.image.registry | string | `"cr.kgateway.dev/kgateway-dev"` | Set the default image registry. |
44+
| kgateway.image.tag | string | `"v2.2.1"` | Set the default image tag. |
45+
| kgateway.imagePullSecrets | list | `[]` | Set a list of image pull secrets for Kubernetes to use when pulling container images from your own private registry instead of the default kgateway registry. |
46+
| kgateway.nameOverride | string | `""` | Add a name to the default Helm base release, which is 'kgateway'. If you set 'nameOverride: "foo", the name of the resources that the Helm release creates become 'kgateway-foo', such as the deployment, service, and service account for the kgateway control plane in the kgateway-system namespace. |
47+
| kgateway.nodeSelector | object | `{}` | Set node selector labels for pod scheduling, such as 'kubernetes.io/arch: amd64'. |
48+
| kgateway.podAnnotations | object | `{"prometheus.io/scrape":"true"}` | Add annotations to the kgateway pods. |
49+
| kgateway.podSecurityContext | object | `{}` | Set the pod-level security context. For example, 'fsGroup: 2000' sets the filesystem group to 2000. |
50+
| kgateway.policyMerge | object | `{}` | Policy merging settings. Currently, TrafficPolicy's extAuth, extProc, and transformation policies support deep merging. E.g., to enable deep merging of extProc policy in TrafficPolicy: policyMerge: trafficPolicy: extProc: DeepMerge |
51+
| kgateway.resources | object | `{"limits":{"cpu":"512mi","memory":"800Mi"},"requests":{"cpu":"256mi","memory":"400Mi"}}` | Configure resource requests and limits for the container, such as 'limits.cpu: 100m' or 'requests.memory: 128Mi'. |
52+
| kgateway.securityContext | object | `{}` | Set the container-level security context, such as 'runAsNonRoot: true'. |
53+
| kgateway.serviceAccount | object | `{"annotations":{},"create":true,"name":""}` | Configure the service account for the deployment. |
54+
| kgateway.serviceAccount.annotations | object | `{}` | Add annotations to the service account. |
55+
| kgateway.serviceAccount.create | bool | `true` | Specify whether a service account should be created. |
56+
| kgateway.serviceAccount.name | string | `""` | Set the name of the service account to use. If not set and create is true, a name is generated using the fullname template. |
57+
| kgateway.tolerations | list | `[]` | Set tolerations for pod scheduling, such as 'key: "nvidia.com/gpu"'. |
58+
| kgateway.validation | object | `{"level":"standard"}` | Configure validation behavior for route and policy safety checks in the control plane. This setting determines how invalid configuration is handled to prevent security bypasses and to maintain multi-tenant isolation. |
59+
| kgateway.validation.level | string | `"standard"` | Validation level. Accepted values: "standard" or "strict" (case-insensitive). Standard replaces invalid routes with a direct 500 response and continues applying valid configuration. Strict adds xDS preflight validation and blocks snapshots that would NACK in Envoy. Default is "standard". |
60+
| kgateway.waypoint | object | `{"enabled":false}` | Enable the waypoint integration. This enables kgateway to translate istio waypoints and use kgateway as a waypoint in an Istio Ambient service mesh setup. |
61+
62+
----------------------------------------------
63+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.DS_Store
2+
# Common VCS dirs
3+
.git/
4+
.gitignore
5+
.bzr/
6+
.bzrignore
7+
.hg/
8+
.hgignore
9+
.svn/
10+
# Common backup files
11+
*.swp
12+
*.bak
13+
*.tmp
14+
*.orig
15+
*~
16+
# Various IDEs
17+
.project
18+
.idea/
19+
*.tmproj
20+
.vscode/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v2
2+
name: gateway-api
3+
description: Gateway API CRDs
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 1.4.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.4.0"
25+
keywords:
26+
- network
27+
- gateway-api
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# gateway-api
2+
3+
![Version: 1.4.0](https://img.shields.io/badge/Version-1.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.4.0](https://img.shields.io/badge/AppVersion-1.4.0-informational?style=flat-square)
4+
5+
Gateway API CRDs
6+
7+
## Values
8+
9+
| Key | Type | Default | Description |
10+
|-----|------|---------|-------------|
11+
| specification | string | `"standard"` | |
12+
13+
----------------------------------------------
14+
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You can use the following command to check the installation:
2+
3+
----------------------
4+
5+
kubectl api-resources --api-group=gateway.networking.k8s.io
6+
kubectl api-resources --api-group=gateway.networking.x-k8s.io
7+
8+
----------------------

charts/kgateway/kgateway/charts/gateway-api/templates/_helpers.tpl

Whitespace-only changes.

0 commit comments

Comments
 (0)