Skip to content

Commit afa658a

Browse files
committed
CP/DP Split: remove unneeded provisioner mode (#3180)
With the new deployment model, the provisioner mode for conformance tests is no longer needed. This code is removed, and at a later date the conformance tests will be updated to work with the new model. Renamed the "static-mode" to "controller". Also removed some unneeded metrics collection.
1 parent 9ff3f4e commit afa658a

File tree

33 files changed

+27
-1511
lines changed

33 files changed

+27
-1511
lines changed

.github/workflows/conformance.yml

-8
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@ jobs:
7676
type=ref,event=pr
7777
type=ref,event=branch,suffix=-rc,enable=${{ startsWith(github.ref, 'refs/heads/release') }}
7878
79-
- name: Generate static deployment
80-
run: |
81-
ngf_prefix=ghcr.io/nginx/nginx-gateway-fabric
82-
ngf_tag=${{ steps.ngf-meta.outputs.version }}
83-
make generate-static-deployment PLUS_ENABLED=${{ inputs.image == 'plus' && 'true' || 'false' }} PREFIX=${ngf_prefix} TAG=${ngf_tag}
84-
working-directory: ./tests
85-
8679
- name: Build binary
8780
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
8881
with:
@@ -151,7 +144,6 @@ jobs:
151144
ngf_tag=${{ steps.ngf-meta.outputs.version }}
152145
if [ ${{ github.event_name }} == "schedule" ]; then export GW_API_VERSION=main; fi
153146
make helm-install-local${{ inputs.image == 'plus' && '-with-plus' || ''}} PREFIX=${ngf_prefix} TAG=${ngf_tag}
154-
make deploy-updated-provisioner PREFIX=${ngf_prefix} TAG=${ngf_tag}
155147
working-directory: ./tests
156148

157149
- name: Run conformance tests

charts/nginx-gateway-fabric/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
spec:
3232
containers:
3333
- args:
34-
- static-mode
34+
- controller
3535
- --gateway-ctlr-name={{ .Values.nginxGateway.gatewayControllerName }}
3636
- --gatewayclass={{ .Values.nginxGateway.gatewayClassName }}
3737
- --config={{ include "nginx-gateway.config-name" . }}

cmd/gateway/commands.go

+4-55
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
ctlrZap "sigs.k8s.io/controller-runtime/pkg/log/zap"
2222

2323
"github.com/nginx/nginx-gateway-fabric/internal/framework/file"
24-
"github.com/nginx/nginx-gateway-fabric/internal/mode/provisioner"
2524
"github.com/nginx/nginx-gateway-fabric/internal/mode/static"
2625
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/config"
2726
"github.com/nginx/nginx-gateway-fabric/internal/mode/static/licensing"
@@ -53,7 +52,7 @@ func createRootCommand() *cobra.Command {
5352
return rootCmd
5453
}
5554

56-
func createStaticModeCommand() *cobra.Command {
55+
func createControllerCommand() *cobra.Command {
5756
// flag names
5857
const (
5958
gatewayFlag = "gateway"
@@ -145,8 +144,8 @@ func createStaticModeCommand() *cobra.Command {
145144
)
146145

147146
cmd := &cobra.Command{
148-
Use: "static-mode",
149-
Short: "Configure NGINX in the scope of a single Gateway resource",
147+
Use: "controller",
148+
Short: "Run the NGINX Gateway Fabric control plane",
150149
RunE: func(cmd *cobra.Command, _ []string) error {
151150
atom := zap.NewAtomicLevel()
152151

@@ -155,7 +154,7 @@ func createStaticModeCommand() *cobra.Command {
155154

156155
commit, date, dirty := getBuildInfo()
157156
logger.Info(
158-
"Starting NGINX Gateway Fabric in static mode",
157+
"Starting the NGINX Gateway Fabric control plane",
159158
"version", version,
160159
"commit", commit,
161160
"date", date,
@@ -443,56 +442,6 @@ func createStaticModeCommand() *cobra.Command {
443442
return cmd
444443
}
445444

446-
func createProvisionerModeCommand() *cobra.Command {
447-
var (
448-
gatewayCtlrName = stringValidatingValue{
449-
validator: validateGatewayControllerName,
450-
}
451-
gatewayClassName = stringValidatingValue{
452-
validator: validateResourceName,
453-
}
454-
)
455-
456-
cmd := &cobra.Command{
457-
Use: "provisioner-mode",
458-
Short: "Provision a static-mode NGINX Gateway Fabric Deployment per Gateway resource",
459-
Hidden: true,
460-
RunE: func(_ *cobra.Command, _ []string) error {
461-
logger := ctlrZap.New()
462-
commit, date, dirty := getBuildInfo()
463-
logger.Info(
464-
"Starting NGINX Gateway Fabric Provisioner",
465-
"version", version,
466-
"commit", commit,
467-
"date", date,
468-
"dirty", dirty,
469-
)
470-
471-
return provisioner.StartManager(provisioner.Config{
472-
Logger: logger,
473-
GatewayClassName: gatewayClassName.value,
474-
GatewayCtlrName: gatewayCtlrName.value,
475-
})
476-
},
477-
}
478-
479-
cmd.Flags().Var(
480-
&gatewayCtlrName,
481-
gatewayCtlrNameFlag,
482-
fmt.Sprintf(gatewayCtlrNameUsageFmt, domain),
483-
)
484-
utilruntime.Must(cmd.MarkFlagRequired(gatewayCtlrNameFlag))
485-
486-
cmd.Flags().Var(
487-
&gatewayClassName,
488-
gatewayClassFlag,
489-
gatewayClassNameUsage,
490-
)
491-
utilruntime.Must(cmd.MarkFlagRequired(gatewayClassFlag))
492-
493-
return cmd
494-
}
495-
496445
// FIXME(pleshakov): Remove this command once NGF min supported Kubernetes version supports sleep action in
497446
// preStop hook.
498447
// See https://github.com/kubernetes/enhancements/tree/4ec371d92dcd4f56a2ab18c8ba20bb85d8d20efe/keps/sig-node/3960-pod-lifecycle-sleep-action

cmd/gateway/commands_test.go

+3-23
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,9 @@ func TestCommonFlagsValidation(t *testing.T) {
122122
}
123123

124124
for _, test := range tests {
125-
t.Run(test.name+"_static_mode", func(t *testing.T) {
125+
t.Run(test.name+"_controller", func(t *testing.T) {
126126
t.Parallel()
127-
testFlag(t, createStaticModeCommand(), test)
128-
})
129-
t.Run(test.name+"_provisioner_mode", func(t *testing.T) {
130-
t.Parallel()
131-
testFlag(t, createProvisionerModeCommand(), test)
127+
testFlag(t, createControllerCommand(), test)
132128
})
133129
}
134130
}
@@ -439,28 +435,12 @@ func TestStaticModeCmdFlagValidation(t *testing.T) {
439435
for _, test := range tests {
440436
t.Run(test.name, func(t *testing.T) {
441437
t.Parallel()
442-
cmd := createStaticModeCommand()
438+
cmd := createControllerCommand()
443439
testFlag(t, cmd, test)
444440
})
445441
}
446442
}
447443

448-
func TestProvisionerModeCmdFlagValidation(t *testing.T) {
449-
t.Parallel()
450-
testCase := flagTestCase{
451-
name: "valid flags",
452-
args: []string{
453-
"--gateway-ctlr-name=gateway.nginx.org/nginx-gateway", // common and required flag
454-
"--gatewayclass=nginx", // common and required flag
455-
},
456-
wantErr: false,
457-
}
458-
459-
// common flags validation is tested separately
460-
461-
testFlag(t, createProvisionerModeCommand(), testCase)
462-
}
463-
464444
func TestSleepCmdFlagValidation(t *testing.T) {
465445
t.Parallel()
466446
tests := []flagTestCase{

cmd/gateway/main.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ func main() {
2121
rootCmd := createRootCommand()
2222

2323
rootCmd.AddCommand(
24-
createStaticModeCommand(),
25-
createProvisionerModeCommand(),
24+
createControllerCommand(),
2625
createInitializeCommand(),
2726
createSleepCommand(),
2827
)

config/tests/static-deployment.yaml

-82
This file was deleted.

deploy/aws-nlb/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ spec:
200200
spec:
201201
containers:
202202
- args:
203-
- static-mode
203+
- controller
204204
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
205205
- --gatewayclass=nginx
206206
- --config=nginx-gateway-config

deploy/azure/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ spec:
200200
spec:
201201
containers:
202202
- args:
203-
- static-mode
203+
- controller
204204
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
205205
- --gatewayclass=nginx
206206
- --config=nginx-gateway-config

deploy/default/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ spec:
200200
spec:
201201
containers:
202202
- args:
203-
- static-mode
203+
- controller
204204
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
205205
- --gatewayclass=nginx
206206
- --config=nginx-gateway-config

deploy/experimental-nginx-plus/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ spec:
204204
spec:
205205
containers:
206206
- args:
207-
- static-mode
207+
- controller
208208
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
209209
- --gatewayclass=nginx
210210
- --config=nginx-gateway-config

deploy/experimental/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ spec:
204204
spec:
205205
containers:
206206
- args:
207-
- static-mode
207+
- controller
208208
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
209209
- --gatewayclass=nginx
210210
- --config=nginx-gateway-config

deploy/nginx-plus/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ spec:
200200
spec:
201201
containers:
202202
- args:
203-
- static-mode
203+
- controller
204204
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
205205
- --gatewayclass=nginx
206206
- --config=nginx-gateway-config

deploy/nodeport/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ spec:
200200
spec:
201201
containers:
202202
- args:
203-
- static-mode
203+
- controller
204204
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
205205
- --gatewayclass=nginx
206206
- --config=nginx-gateway-config

deploy/openshift/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ spec:
210210
spec:
211211
containers:
212212
- args:
213-
- static-mode
213+
- controller
214214
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
215215
- --gatewayclass=nginx
216216
- --config=nginx-gateway-config

deploy/snippets-filters-nginx-plus/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ spec:
202202
spec:
203203
containers:
204204
- args:
205-
- static-mode
205+
- controller
206206
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
207207
- --gatewayclass=nginx
208208
- --config=nginx-gateway-config

deploy/snippets-filters/deploy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ spec:
202202
spec:
203203
containers:
204204
- args:
205-
- static-mode
205+
- controller
206206
- --gateway-ctlr-name=gateway.nginx.org/nginx-gateway-controller
207207
- --gatewayclass=nginx
208208
- --config=nginx-gateway-config

docs/developer/release-process.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ To create a new release, follow these steps:
4444
1. Kick off the [longevity tests](https://github.com/nginx/nginx-gateway-fabric/blob/main/tests/README.md#longevity-testing) for both OSS and Plus. You'll need to create two clusters and VMs for this. Before running, update your `vars.env` file with the proper image tag and prefixes. NGF and nginx images will be available from `ghcr.io`, and nginx plus will be available in GCP (`us-docker.pkg.dev/<GCP_PROJECT_ID>/nginx-gateway-fabric/nginx-plus`). These tests need to run for 4 days before releasing. The results should be committed to the main branch and then cherry-picked to the release branch.
4545
2. Kick off the [NFR workflow](https://github.com/nginx/nginx-gateway-fabric/actions/workflows/nfr.yml) in the browser. For `image_tag`, use `release-X.X-rc`, and for `version`, use the upcoming `X.Y.Z` NGF version. Run the workflow on the new release branch. This will run all of the NFR tests which are automated and open a PR with the results files when it is complete. Review this PR and make any necessary changes before merging. Once merged, be sure to cherry-pick the commit to the main branch as well (the original PR targets the release branch).
4646
5. Run the [Release PR](https://github.com/nginx/nginx-gateway-fabric/actions/workflows/release-pr.yml) workflow to update the repo files for the release. Then there are a few manual steps to complete:
47-
1. Update the version tag used in the [provisioner manifest](/tests/conformance/provisioner/provisioner.yaml) and [getting started guide](/site/content/get-started.md).
48-
2. Update the [README](/README.md) to include information about the release.
49-
3. Update the [changelog](/CHANGELOG.md). There is going to be a new blank section generated by the automation that needs to be adjusted accordingly.
47+
1. Update the [README](/README.md) to include information about the release.
48+
2. Update the [changelog](/CHANGELOG.md). There is going to be a new blank section generated by the automation that needs to be adjusted accordingly.
5049
- At the top there will be a list of all PRs that are labeled with `release-notes`.
5150
The changelog includes only important (from the user perspective)
5251
changes to NGF. This is in contrast with the autogenerated full changelog, which is created in the next

docs/proposals/nginx-extensions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ spec:
155155
name: my-annotation
156156
```
157157

158-
Infrastructure labels and annotations should be applied to all resources created in response to the Gateway. This only applies to _automated deployments_ (i.e., provisioner mode), implementations that automatically deploy the data plane based on a Gateway.
158+
Infrastructure labels and annotations should be applied to all resources created in response to the Gateway.
159159
Other use cases for this API are Service type, Service IP, CPU memory requests, affinity rules, and Gateway routability (public, private, and cluster).
160160

161161
### TLS Options

embedded.go

-11
This file was deleted.

0 commit comments

Comments
 (0)