-
Notifications
You must be signed in to change notification settings - Fork 460
feat: support infra deployment in the gateway namespace #5137
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
Merged
zirain
merged 26 commits into
envoyproxy:main
from
cnvergence:feat-support-infra-different-ns
Apr 30, 2025
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
86109a2
wip: feat: support infra deployment in the gateway namespace
cnvergence a7bbb4f
add helm rbac for infra namespaced mode
cnvergence 316bc22
add helm testdata for namespaced mode
cnvergence 83d1aaf
check for gateway namespace mod in infra volumes
cnvergence 57180e0
mount serviceaccount token to envoy pod
cnvergence ff8b499
support gateway namespaces in kubernetes predicate funcs
cnvergence b9b30dd
add bootstrap config for credential injector and jwt interceptor in s…
cnvergence 139f530
add the cluster role if deploy mode is set without watched namespaces
cnvergence cc24e5e
add helm clusterrole
cnvergence 4c2bb6d
fix tests
cnvergence f8d0bcd
update grpc xds server and share eg ca cert in the infra configmap
cnvergence c198bfe
fix tests
cnvergence 20e56ca
lint code
cnvergence 3f71f3a
update stls config for xds server in namespace mode
cnvergence 0c64a64
update codgen
cnvergence d520d8a
update stls+jwt config
cnvergence a5d8e86
move to token review API for jwt validation
cnvergence e03dd69
remove old func
cnvergence f0ecfc8
go lint
cnvergence 63a3e51
Update testdata
cnvergence 826de23
check for serviceaccount group in the tokenReview groups slice
cnvergence 77ebebb
fix tests
cnvergence 1ef7776
update testdata
cnvergence 5bc031f
Add initial token validation, add tests and review changes
cnvergence 91c297b
lint code
cnvergence bbddde9
add zone envvar
cnvergence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
charts/gateway-helm/templates/namespaced-infra-manager-rbac.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{{ $watchedNamespaces := list }} | ||
{{ if .Values.config.envoyGateway.provider.kubernetes }} | ||
{{ $kube := .Values.config.envoyGateway.provider.kubernetes }} | ||
{{ if and ($kube.watch) ($kube.deploy) (eq $kube.deploy.type "GatewayNamespace") }} | ||
zhaohuabing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: {{ include "eg.fullname" $ }}-infra-manager-tokenreview | ||
labels: | ||
{{- include "eg.labels" $ | nindent 4 }} | ||
rules: | ||
{{ include "eg.rbac.infra.tokenreview" . }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: {{ include "eg.fullname" $ }}-infra-manager-tokenreview | ||
labels: | ||
{{- include "eg.labels" $ | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: '{{ include "eg.fullname" $ }}-infra-manager-tokenreview' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: 'envoy-gateway' | ||
namespace: '{{ $.Release.Namespace }}' | ||
{{ if $kube.watch.namespaces }} | ||
{{ if gt (len $kube.watch.namespaces) 0 }} | ||
{{ $watchedNamespaces = $kube.watch.namespaces }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ end }} | ||
{{ if gt (len $watchedNamespaces) 0 }} | ||
{{ range $_, $ns := $watchedNamespaces }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: {{ include "eg.fullname" $ }}-namespaced-infra-manager | ||
namespace: {{ $ns | quote }} | ||
labels: | ||
{{- include "eg.labels" $ | nindent 4 }} | ||
rules: | ||
{{ include "eg.rbac.infra.basic" . }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ include "eg.fullname" $ }}-namespaced-infra-manager | ||
namespace: {{ $ns | quote }} | ||
labels: | ||
{{- include "eg.labels" $ | nindent 4 }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: '{{ include "eg.fullname" $ }}-namespaced-infra-manager' | ||
subjects: | ||
- kind: ServiceAccount | ||
name: 'envoy-gateway' | ||
namespace: '{{ $.Release.Namespace }}' | ||
--- | ||
{{- end }} | ||
{{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,6 +98,7 @@ infraIR: | |
gateway.envoyproxy.io/owning-gateway-name: eg | ||
gateway.envoyproxy.io/owning-gateway-namespace: envoy-gateway-system | ||
name: envoy-gateway-system/eg | ||
namespace: "" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct? |
||
xdsIR: | ||
envoy-gateway-system/eg: | ||
accessLog: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, non-blocking: this might just be a personal preference, but I would prefer a clearer name to make it easier to read. For example:
IsInfraDeployedInGatewayNamespace
orShouldInfraDeployedInGatewayNamespace
. This also applies to other places using the same name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with changing the name, however, I would like to keep a shorter name, just like
GatewayNamespaceMode