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

helm: support PriorityClassName on gateway-proxy #9902

Merged
merged 7 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
28 changes: 28 additions & 0 deletions changelog/v1.18.0-beta16/helm-priority-class-name.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
changelog:
- type: HELM
issueLink: https://github.com/solo-io/gloo/issues/8677
resolvesIssue: false
description: >-
Introduce `gatewayProxy.NAME.podTemplate.priorityClassName` which allows you to set the PriorityClassName
for gateway-proxy Pods. This is already supported on all other Gloo deployments.
- type: FIX
issueLink: https://github.com/solo-io/gloo/issues/9010
resolvesIssue: false
description: >-
Support defining the PriorityClassName on a GatewayProxy deployment. This allows users to
attach pods to PriorityClasses (https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/)
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/gloo/issues/9823
resolvesIssue: false
description: >-
This is a duplicate issue that tracks the single enhancement that we are adding here.
- type: NON_USER_FACING
issueLink: https://github.com/solo-io/gloo/issues/9731
resolvesIssue: false
description: >-
This is a duplicate issue that tracks the single enhancement that we are adding here.





2 changes: 2 additions & 0 deletions docs/content/reference/values.txt
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@
|gatewayProxies.NAME.podTemplate.tolerations[].value|string|||
|gatewayProxies.NAME.podTemplate.tolerations[].effect|string|||
|gatewayProxies.NAME.podTemplate.tolerations[].tolerationSeconds|int64|||
|gatewayProxies.NAME.podTemplate.priorityClassName|string||name of a defined priority class|
|gatewayProxies.NAME.podTemplate.probes|bool||Set to true to enable a readiness probe (default is false). Then, you can also enable a liveness probe.|
|gatewayProxies.NAME.podTemplate.livenessProbeEnabled|bool||Set to true to enable a liveness probe (default is false).|
|gatewayProxies.NAME.podTemplate.resources.limits.memory|string||amount of memory|
Expand Down Expand Up @@ -1045,6 +1046,7 @@
|gatewayProxies.gatewayProxy.podTemplate.tolerations[].value|string|||
|gatewayProxies.gatewayProxy.podTemplate.tolerations[].effect|string|||
|gatewayProxies.gatewayProxy.podTemplate.tolerations[].tolerationSeconds|int64|||
|gatewayProxies.gatewayProxy.podTemplate.priorityClassName|string||name of a defined priority class|
|gatewayProxies.gatewayProxy.podTemplate.probes|bool|false|Set to true to enable a readiness probe (default is false). Then, you can also enable a liveness probe.|
|gatewayProxies.gatewayProxy.podTemplate.livenessProbeEnabled|bool||Set to true to enable a liveness probe (default is false).|
|gatewayProxies.gatewayProxy.podTemplate.resources.limits.memory|string||amount of memory|
Expand Down
8 changes: 8 additions & 0 deletions install/helm/gloo/generate/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,13 @@ type DaemonSetSpec struct {
HostNetwork *bool `json:"hostNetwork,omitempty"`
}

// GatewayProxyPodTemplate contains the Helm API available to configure the PodTemplate on the gateway-proxy Deployment
//
// Note to Developers:
// The PodSpec defined below is our standard way of exposing these APIs consistently. This PodTemplate pre-dated that struct, so
// we didn't rely on it, and instead have to manage each of the fields individually.
// Since some of the fields available on the PodSpec aren't all exposed in this PodTemplate, and instead are availabe up a level on the API,
// there isn't ean easy way to rely on that PodSpec definition. One solution would be to deprecate the old fields, and migrate them all to this API
type GatewayProxyPodTemplate struct {
HttpPort *int `json:"httpPort,omitempty" desc:"HTTP port for the gateway service target port."`
HttpsPort *int `json:"httpsPort,omitempty" desc:"HTTPS port for the gateway service target port."`
Expand All @@ -651,6 +658,7 @@ type GatewayProxyPodTemplate struct {
NodeName *string `json:"nodeName,omitempty" desc:"name of node to run on."`
NodeSelector map[string]string `json:"nodeSelector,omitempty" desc:"label selector for nodes."`
Tolerations []*corev1.Toleration `json:"tolerations,omitempty"`
PriorityClassName *string `json:"priorityClassName,omitempty" desc:"name of a defined priority class"`
Probes *bool `json:"probes,omitempty" desc:"Set to true to enable a readiness probe (default is false). Then, you can also enable a liveness probe."`
LivenessProbeEnabled *bool `json:"livenessProbeEnabled,omitempty" desc:"Set to true to enable a liveness probe (default is false)."`
Resources *ResourceRequirements `json:"resources,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions install/helm/gloo/templates/7-gateway-proxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ spec:
{{- if $spec.podTemplate.nodeName }}
nodeName: {{$spec.podTemplate.nodeName}}
{{- end }}
{{- if $spec.podTemplate.priorityClassName }}
priorityClassName: {{$spec.podTemplate.priorityClassName}}
{{- end }}
{{- if $spec.podTemplate.nodeSelector }}
nodeSelector:
{{- range $key, $value := $spec.podTemplate.nodeSelector }}
Expand Down
11 changes: 11 additions & 0 deletions install/test/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3297,6 +3297,17 @@ spec:
testManifest.ExpectDeploymentAppsV1(gatewayProxyDeployment)
})

It("enables priorityClassName", func() {
prepareMakefile(namespace, glootestutils.HelmValues{
ValuesArgs: []string{
"gatewayProxies.gatewayProxy.podTemplate.priorityClassName=example-priority",
},
})

gatewayProxyDeployment.Spec.Template.Spec.PriorityClassName = "example-priority"
testManifest.ExpectDeploymentAppsV1(gatewayProxyDeployment)
})

It("supports custom readiness and liveness probe", func() {
prepareMakefile(namespace, glootestutils.HelmValues{
ValuesArgs: []string{
Expand Down
Loading