-
Notifications
You must be signed in to change notification settings - Fork 123
Implement provisioner #683
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Provisioner | ||
|
||
Provisioner implements data plane provisioning for NGINX Kubernetes Gateway (NKG): it creates an NKG static mode | ||
Deployment for each Gateway that belongs to the provisioner GatewayClass. | ||
|
||
``` | ||
Usage: | ||
gateway provisioner-mode [flags] | ||
|
||
Flags: | ||
-h, --help help for provisioner-mode | ||
|
||
Global Flags: | ||
--gateway-ctlr-name string The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is 'k8s-gateway.nginx.org' (default "") | ||
--gatewayclass string The name of the GatewayClass resource. Every NGINX Gateway must have a unique corresponding GatewayClass resource. (default "") | ||
``` | ||
|
||
Provisioner is not meant to be used in production yet (see this issue for more details | ||
https://github.com/nginxinc/nginx-kubernetes-gateway/issues/634). However, it can be used in the Gateway API conformance | ||
tests, which expect a Gateway API implementation to provision an independent data plane per Gateway. | ||
|
||
How to deploy: | ||
|
||
1. Follow the [installation](/docs/installation.md) instructions up until the Deploy the NGINX Kubernetes Gateway Step | ||
to deploy prerequisites for both the static mode Deployments and the provisioner. | ||
1. Deploy provisioner: | ||
``` | ||
kubectl apply -f conformance/provisioner/provisioner.yaml | ||
``` | ||
1. Confirm the provisioner is running in nginx-gateway namespace: | ||
``` | ||
kubectl get pods -n nginx-gateway | ||
NAME READY STATUS RESTARTS AGE | ||
nginx-gateway-provisioner-6c9d9fdcb8-b2pf8 1/1 Running 0 11m | ||
``` |
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,72 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nginx-gateway-provisioner | ||
namespace: nginx-gateway | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: nginx-gateway-provisioner | ||
rules: | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
verbs: | ||
- create | ||
- delete | ||
- apiGroups: | ||
- gateway.networking.k8s.io | ||
resources: | ||
- gatewayclasses | ||
- gateways | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- gateway.networking.k8s.io | ||
resources: | ||
- gatewayclasses/status | ||
verbs: | ||
- update | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: nginx-gateway-provisioner | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nginx-gateway-provisioner | ||
namespace: nginx-gateway | ||
roleRef: | ||
kind: ClusterRole | ||
name: nginx-gateway-provisioner | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nginx-gateway-provisioner | ||
namespace: nginx-gateway | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nginx-gateway-provisioner | ||
template: | ||
metadata: | ||
labels: | ||
app: nginx-gateway-provisioner | ||
spec: | ||
serviceAccountName: nginx-gateway-provisioner | ||
containers: | ||
- image: ghcr.io/nginxinc/nginx-kubernetes-gateway:edge | ||
imagePullPolicy: Always | ||
name: nginx-gateway-provisioner | ||
securityContext: | ||
runAsUser: 1001 | ||
args: | ||
- provisioner-mode | ||
- --gateway-ctlr-name=k8s-gateway.nginx.org/nginx-gateway-controller | ||
- --gatewayclass=nginx |
92 changes: 0 additions & 92 deletions
92
deploy/manifests/nginx-gateway.yaml → deploy/manifests/deployment.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
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,20 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-conf | ||
namespace: nginx-gateway | ||
data: | ||
nginx.conf: | | ||
load_module /usr/lib/nginx/modules/ngx_http_js_module.so; | ||
|
||
events {} | ||
|
||
pid /etc/nginx/nginx.pid; | ||
error_log stderr debug; | ||
|
||
http { | ||
include /etc/nginx/conf.d/*.conf; | ||
js_import /usr/lib/nginx/modules/njs/httpmatches.js; | ||
server_names_hash_bucket_size 256; | ||
server_names_hash_max_size 1024; | ||
} |
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,70 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: nginx-gateway | ||
namespace: nginx-gateway | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: nginx-gateway | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- services | ||
- secrets | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- discovery.k8s.io | ||
resources: | ||
- endpointslices | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- gateway.networking.k8s.io | ||
resources: | ||
- gatewayclasses | ||
- gateways | ||
- httproutes | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- gateway.nginx.org | ||
resources: | ||
- gatewayconfigs | ||
verbs: | ||
- list | ||
- watch | ||
- apiGroups: | ||
- gateway.networking.k8s.io | ||
resources: | ||
- httproutes/status | ||
- gateways/status | ||
- gatewayclasses/status | ||
verbs: | ||
- update | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: nginx-gateway | ||
subjects: | ||
- kind: ServiceAccount | ||
name: nginx-gateway | ||
namespace: nginx-gateway | ||
roleRef: | ||
kind: ClusterRole | ||
name: nginx-gateway | ||
apiGroup: rbac.authorization.k8s.io |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package embeddedfiles | ||
|
||
import _ "embed" | ||
sjberman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// StaticModeDeploymentYAML contains the YAML manifest of the Deployment resource for the static mode. | ||
// | ||
// We put this in the root of the repo because goembed doesn't support relative/absolute paths and symlinks, | ||
// and we want to keep the manifests in the deploy/manifests directory. | ||
// | ||
//go:embed deploy/manifests/deployment.yaml | ||
var StaticModeDeploymentYAML []byte |
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.
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.
Uh oh!
There was an error while loading. Please reload this page.