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

Feat: adding support for PodDisruptionBudget with eg control plane #3545

Merged
merged 22 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions charts/gateway-addons-helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# gateway-addons-helm
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the changes in gateway-addons-helm intentional?

Copy link
Contributor

@shawnh2 shawnh2 Jun 11, 2024

Choose a reason for hiding this comment

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

will be fixed via #3555


![Version: v0.0.0-latest](https://img.shields.io/badge/Version-v0.0.0--latest-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

An Add-ons Helm chart for Envoy Gateway

**Homepage:** <https://gateway.envoyproxy.io/>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| envoy-gateway-steering-committee | | <https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md> |
| envoy-gateway-maintainers | | <https://github.com/envoyproxy/gateway/blob/main/CODEOWNERS> |

## Source Code

* <https://github.com/envoyproxy/gateway>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://grafana.github.io/helm-charts | grafana | 6.58.4 |
| https://prometheus-community.github.io/helm-charts | prometheus | 23.1.0 |

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

### Install from DockerHub

Once Helm has been set up correctly, install the chart from dockerhub:

``` shell
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --create-namespace
```
You can find all helm chart release in [Dockerhub](https://hub.docker.com/r/envoyproxy/gateway-helm/tags)

### Install from Source Code

You can also install the helm chart from the source code:

To install the eg chart along with Gateway API CRDs and Envoy Gateway CRDs:

``` shell
make kube-deploy TAG=latest
```

### Skip install CRDs

You can install the eg chart along without Gateway API CRDs and Envoy Gateway CRDs, make sure CRDs exist in Cluster first if you want to skip to install them, otherwise EG may fail to start:

``` shell
helm install eg --create-namespace oci://docker.io/envoyproxy/gateway-helm --version v0.0.0-latest -n envoy-gateway-system --skip-crds
```

To uninstall the chart:

``` shell
helm delete eg
```

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| grafana.adminPassword | string | `"admin"` | |
| grafana.datasources."datasources.yaml".apiVersion | int | `1` | |
| grafana.datasources."datasources.yaml".datasources[0].name | string | `"Prometheus"` | |
| grafana.datasources."datasources.yaml".datasources[0].type | string | `"prometheus"` | |
| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus-server"` | |
| grafana.service.type | string | `"LoadBalancer"` | |
| prometheus.alertmanager.enabled | bool | `false` | |
| prometheus.kube-state-metrics.enabled | bool | `false` | |
| prometheus.prometheus-node-exporter.enabled | bool | `false` | |
| prometheus.prometheus-pushgateway.enabled | bool | `false` | |
| prometheus.server.fullnameOverride | string | `"prometheus"` | |
| prometheus.server.global.scrape_interval | string | `"15s"` | |
| prometheus.server.image.repository | string | `"prom/prometheus"` | |
| prometheus.server.persistentVolume.enabled | bool | `false` | |
| prometheus.server.readinessProbeInitialDelay | int | `0` | |
| prometheus.server.securityContext | string | `nil` | |
| prometheus.server.service.type | string | `"LoadBalancer"` | |

50 changes: 50 additions & 0 deletions charts/gateway-addons-helm/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
+++
title = "Gateway Helm Chart"
+++

![Version: v0.0.0-latest](https://img.shields.io/badge/Version-v0.0.0--latest-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)

An Add-ons Helm chart for Envoy Gateway

**Homepage:** <https://gateway.envoyproxy.io/>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| envoy-gateway-steering-committee | | <https://github.com/envoyproxy/gateway/blob/main/GOVERNANCE.md> |
| envoy-gateway-maintainers | | <https://github.com/envoyproxy/gateway/blob/main/CODEOWNERS> |

## Source Code

* <https://github.com/envoyproxy/gateway>

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://grafana.github.io/helm-charts | grafana | 6.58.4 |
| https://prometheus-community.github.io/helm-charts | prometheus | 23.1.0 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| grafana.adminPassword | string | `"admin"` | |
| grafana.datasources."datasources.yaml".apiVersion | int | `1` | |
| grafana.datasources."datasources.yaml".datasources[0].name | string | `"Prometheus"` | |
| grafana.datasources."datasources.yaml".datasources[0].type | string | `"prometheus"` | |
| grafana.datasources."datasources.yaml".datasources[0].url | string | `"http://prometheus-server"` | |
| grafana.service.type | string | `"LoadBalancer"` | |
| prometheus.alertmanager.enabled | bool | `false` | |
| prometheus.kube-state-metrics.enabled | bool | `false` | |
| prometheus.prometheus-node-exporter.enabled | bool | `false` | |
| prometheus.prometheus-pushgateway.enabled | bool | `false` | |
| prometheus.server.fullnameOverride | string | `"prometheus"` | |
| prometheus.server.global.scrape_interval | string | `"15s"` | |
| prometheus.server.image.repository | string | `"prom/prometheus"` | |
| prometheus.server.persistentVolume.enabled | bool | `false` | |
| prometheus.server.readinessProbeInitialDelay | int | `0` | |
| prometheus.server.securityContext | string | `nil` | |
| prometheus.server.service.type | string | `"LoadBalancer"` | |

1 change: 1 addition & 0 deletions charts/gateway-helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ To uninstall the chart:
| global.images.ratelimit.pullPolicy | string | `"IfNotPresent"` | |
| global.images.ratelimit.pullSecrets | list | `[]` | |
| kubernetesClusterDomain | string | `"cluster.local"` | |
| podDisruptionBudget.minAvailable | int | `0` | |

12 changes: 12 additions & 0 deletions charts/gateway-helm/templates/envoy-gateway-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ metadata:
labels:
{{- include "eg.labels" . | nindent 4 }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: envoy-gateway
namespace: '{{ .Release.Namespace }}'
spec:
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
selector:
matchLabels:
control-plane: envoy-gateway
{{- include "eg.selectorLabels" . | nindent 6 }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down
3 changes: 2 additions & 1 deletion charts/gateway-helm/values.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ global:
pullPolicy: IfNotPresent
# List of secrets in the same namespace of the component that can be used to pull images from private repositories.
pullSecrets: []

podDisruptionBudget:
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe keep this 0 for backwards compatibility?

Copy link
Contributor Author

@alexwo alexwo Jun 11, 2024

Choose a reason for hiding this comment

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

Changed this to 0.

minAvailable: 0
deployment:
envoyGateway:
image:
Expand Down
1 change: 1 addition & 0 deletions site/content/en/latest/install/gateway-helm-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ The Helm chart for Envoy Gateway
| global.images.ratelimit.pullPolicy | string | `"IfNotPresent"` | |
| global.images.ratelimit.pullSecrets | list | `[]` | |
| kubernetesClusterDomain | string | `"cluster.local"` | |
| podDisruptionBudget.minAvailable | int | `0` | |

1 change: 1 addition & 0 deletions site/content/zh/latest/install/gateway-helm-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ The Helm chart for Envoy Gateway
| global.images.ratelimit.pullPolicy | string | `"IfNotPresent"` | |
| global.images.ratelimit.pullSecrets | list | `[]` | |
| kubernetesClusterDomain | string | `"cluster.local"` | |
| podDisruptionBudget.minAvailable | int | `0` | |

14 changes: 14 additions & 0 deletions test/helm/default-config.out.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: policy/v1
Copy link
Member

Choose a reason for hiding this comment

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

this seems unreasonable, PDB should be opt-in.

Copy link
Contributor Author

@alexwo alexwo Jun 11, 2024

Choose a reason for hiding this comment

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

I have changed this, we will deploy an extra pdb resource only if podDisruptionBudget.minAvailable is configured to be > 0.

kind: PodDisruptionBudget
metadata:
name: envoy-gateway
namespace: 'envoy-gateway-system'
spec:
minAvailable: 0
selector:
matchLabels:
control-plane: envoy-gateway
app.kubernetes.io/name: gateway-helm
app.kubernetes.io/instance: eg
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
14 changes: 14 additions & 0 deletions test/helm/deployment-images-config.out.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: envoy-gateway
namespace: 'envoy-gateway-system'
spec:
minAvailable: 0
selector:
matchLabels:
control-plane: envoy-gateway
app.kubernetes.io/name: gateway-helm
app.kubernetes.io/instance: eg
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
14 changes: 14 additions & 0 deletions test/helm/envoy-gateway-config.out.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: envoy-gateway
namespace: 'envoy-gateway-system'
spec:
minAvailable: 0
selector:
matchLabels:
control-plane: envoy-gateway
app.kubernetes.io/name: gateway-helm
app.kubernetes.io/instance: eg
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
14 changes: 14 additions & 0 deletions test/helm/global-images-config.out.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: envoy-gateway
namespace: 'envoy-gateway-system'
spec:
minAvailable: 0
selector:
matchLabels:
control-plane: envoy-gateway
app.kubernetes.io/name: gateway-helm
app.kubernetes.io/instance: eg
---
# Source: gateway-helm/templates/envoy-gateway-deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down
Loading