Skip to content

Commit

Permalink
helm: support PriorityClassName on gateway-proxy (#9902)
Browse files Browse the repository at this point in the history
* add priority class name, no tests

* add unit test

* add changelog

* update changelog to include other issue ref

* another duplicate

* update helm api, tests

* add conditional for kind.deployment
  • Loading branch information
sam-heilbron committed Aug 16, 2024
1 parent c469393 commit a44a3ed
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
29 changes: 29 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,29 @@
changelog:
- type: HELM
issueLink: https://github.com/solo-io/gloo/issues/8677
resolvesIssue: false
description: >-
Ensure that gateway-proxy deployments respect the `gatewayProxy.NAME.kind.deployment.priorityClassName` field.
This API 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.
6 changes: 6 additions & 0 deletions install/helm/gloo/generate/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,12 @@ 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 Helm API for the PodTemplate is split between the values defined in this struct, and the values
// in the PodSpec, which is available for a GatewayProxy under `gatewayProxy.kind.Deployment`.
// The side effect of this, is that there may be Helm values which may live on both structs, but only one is used by our templates.
// Always refer back to the Helm templates to see which is used.
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 Down
5 changes: 5 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,11 @@ spec:
{{- if $spec.podTemplate.nodeName }}
nodeName: {{$spec.podTemplate.nodeName}}
{{- end }}
{{- if $spec.kind.deployment}}
{{- if $spec.kind.deployment.priorityClassName }}
priorityClassName: {{ $spec.kind.deployment.priorityClassName }}
{{- end }}
{{- 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.kind.deployment.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

0 comments on commit a44a3ed

Please sign in to comment.