Skip to content

Commit 40e3d6e

Browse files
authored
api: allow to custom service account name (envoyproxy#6360)
* api: allow reuse exiting service account Signed-off-by: zirain <zirain2009@gmail.com> * update Signed-off-by: zirain <zirain2009@gmail.com> --------- Signed-off-by: zirain <zirain2009@gmail.com>
1 parent a03b857 commit 40e3d6e

File tree

7 files changed

+91
-0
lines changed

7 files changed

+91
-0
lines changed

api/v1alpha1/envoyproxy_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,17 @@ type EnvoyProxyKubernetesProvider struct {
373373
// EnvoyPDB allows to control the pod disruption budget of an Envoy Proxy.
374374
// +optional
375375
EnvoyPDB *KubernetesPodDisruptionBudgetSpec `json:"envoyPDB,omitempty"`
376+
377+
// EnvoyServiceAccount defines the desired state of the Envoy service account resource.
378+
EnvoyServiceAccount *KubernetesServiceAccountSpec `json:"envoyServiceAccount,omitempty"`
379+
}
380+
381+
type KubernetesServiceAccountSpec struct {
382+
// Name of the Service Account.
383+
// When unset, this defaults to an autogenerated name.
384+
//
385+
// +optional
386+
Name *string `json:"name,omitempty"`
376387
}
377388

378389
// ProxyLogging defines logging parameters for managed proxies.

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoyproxies.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10445,6 +10445,16 @@ spec:
1044510445
- message: loadBalancerIP can only be set for LoadBalancer
1044610446
type
1044710447
rule: '!has(self.loadBalancerIP) || self.type == ''LoadBalancer'''
10448+
envoyServiceAccount:
10449+
description: EnvoyServiceAccount defines the desired state
10450+
of the Envoy service account resource.
10451+
properties:
10452+
name:
10453+
description: |-
10454+
Name of the Service Account.
10455+
When unset, this defaults to an autogenerated name.
10456+
type: string
10457+
type: object
1044810458
useListenerPortAsContainerPort:
1044910459
description: |-
1045010460
UseListenerPortAsContainerPort disables the port shifting feature in the Envoy Proxy.

charts/gateway-helm/crds/generated/gateway.envoyproxy.io_envoyproxies.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10444,6 +10444,16 @@ spec:
1044410444
- message: loadBalancerIP can only be set for LoadBalancer
1044510445
type
1044610446
rule: '!has(self.loadBalancerIP) || self.type == ''LoadBalancer'''
10447+
envoyServiceAccount:
10448+
description: EnvoyServiceAccount defines the desired state
10449+
of the Envoy service account resource.
10450+
properties:
10451+
name:
10452+
description: |-
10453+
Name of the Service Account.
10454+
When unset, this defaults to an autogenerated name.
10455+
type: string
10456+
type: object
1044710457
useListenerPortAsContainerPort:
1044810458
description: |-
1044910459
UseListenerPortAsContainerPort disables the port shifting feature in the Envoy Proxy.

site/content/en/latest/api/extension_types.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,7 @@ _Appears in:_
15901590
| `envoyHpa` | _[KubernetesHorizontalPodAutoscalerSpec](#kuberneteshorizontalpodautoscalerspec)_ | false | | EnvoyHpa defines the Horizontal Pod Autoscaler settings for Envoy Proxy Deployment. |
15911591
| `useListenerPortAsContainerPort` | _boolean_ | false | | UseListenerPortAsContainerPort disables the port shifting feature in the Envoy Proxy.<br />When set to false (default value), if the service port is a privileged port (1-1023), add a constant to the value converting it into an ephemeral port.<br />This allows the container to bind to the port without needing a CAP_NET_BIND_SERVICE capability. |
15921592
| `envoyPDB` | _[KubernetesPodDisruptionBudgetSpec](#kubernetespoddisruptionbudgetspec)_ | false | | EnvoyPDB allows to control the pod disruption budget of an Envoy Proxy. |
1593+
| `envoyServiceAccount` | _[KubernetesServiceAccountSpec](#kubernetesserviceaccountspec)_ | true | | EnvoyServiceAccount defines the desired state of the Envoy service account resource. |
15931594

15941595

15951596
#### EnvoyProxyProvider
@@ -2925,6 +2926,20 @@ _Appears in:_
29252926
| `topologySpreadConstraints` | _[TopologySpreadConstraint](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#topologyspreadconstraint-v1-core) array_ | false | | TopologySpreadConstraints describes how a group of pods ought to spread across topology<br />domains. Scheduler will schedule pods in a way which abides by the constraints.<br />All topologySpreadConstraints are ANDed. |
29262927

29272928

2929+
#### KubernetesServiceAccountSpec
2930+
2931+
2932+
2933+
2934+
2935+
_Appears in:_
2936+
- [EnvoyProxyKubernetesProvider](#envoyproxykubernetesprovider)
2937+
2938+
| Field | Type | Required | Default | Description |
2939+
| --- | --- | --- | --- | --- |
2940+
| `name` | _string_ | false | | Name of the Service Account.<br />When unset, this defaults to an autogenerated name. |
2941+
2942+
29282943
#### KubernetesServiceSpec
29292944

29302945

test/helm/gateway-crds-helm/all.out.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34026,6 +34026,16 @@ spec:
3402634026
- message: loadBalancerIP can only be set for LoadBalancer
3402734027
type
3402834028
rule: '!has(self.loadBalancerIP) || self.type == ''LoadBalancer'''
34029+
envoyServiceAccount:
34030+
description: EnvoyServiceAccount defines the desired state
34031+
of the Envoy service account resource.
34032+
properties:
34033+
name:
34034+
description: |-
34035+
Name of the Service Account.
34036+
When unset, this defaults to an autogenerated name.
34037+
type: string
34038+
type: object
3402934039
useListenerPortAsContainerPort:
3403034040
description: |-
3403134041
UseListenerPortAsContainerPort disables the port shifting feature in the Envoy Proxy.

test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16714,6 +16714,16 @@ spec:
1671416714
- message: loadBalancerIP can only be set for LoadBalancer
1671516715
type
1671616716
rule: '!has(self.loadBalancerIP) || self.type == ''LoadBalancer'''
16717+
envoyServiceAccount:
16718+
description: EnvoyServiceAccount defines the desired state
16719+
of the Envoy service account resource.
16720+
properties:
16721+
name:
16722+
description: |-
16723+
Name of the Service Account.
16724+
When unset, this defaults to an autogenerated name.
16725+
type: string
16726+
type: object
1671716727
useListenerPortAsContainerPort:
1671816728
description: |-
1671916729
UseListenerPortAsContainerPort disables the port shifting feature in the Envoy Proxy.

0 commit comments

Comments
 (0)