Skip to content

Commit

Permalink
Backport(v3.0.x): fix(manager) restore InitCacheSyncDuration (#5238) (#…
Browse files Browse the repository at this point in the history
…5414)

* fix(manager) restore InitCacheSyncDuration (#5238)

Fix regression that removed initial cache sync delay.

Add --init-cache-sync-duration flag to override the delay period.

---------

Co-authored-by: Travis Raines <[email protected]>
(cherry picked from commit 1737253)

* chore(gha): preemptively add 1p creds

* chore: remove "password" input in kong/license step of workflows (#5316)

---------

Co-authored-by: Jonah Back <[email protected]>
Co-authored-by: Isa Farnik <[email protected]>
Co-authored-by: Tao Yi <[email protected]>
  • Loading branch information
4 people authored Jan 10, 2024
1 parent fad6167 commit 7ac256a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/_e2e_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
- uses: Kong/kong-license@master
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: split image and tag
id: split
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
continue-on-error: true
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: split image and tag
id: split
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
- uses: Kong/kong-license@master
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: split image and tag
id: split
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_integration_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
- uses: Kong/kong-license@master
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: Set image of Kong
id: set_kong_image
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- uses: Kong/kong-license@master
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- uses: Kong/kong-license@master
id: license
with:
password: ${{ secrets.PULP_PASSWORD }}
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

- name: checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Adding a new version? You'll need three changes:
in translating and applying configurations to Kong.
[#5296](https://github.com/Kong/kubernetes-ingress-controller/pull/5296)
[#5299](https://github.com/Kong/kubernetes-ingress-controller/pull/5299)
- Added `-init-cache-sync-duration` CLI flag. This flag configures how long the controller waits for Kubernetes resources to populate at startup before generating the initial Kong configuration. It also fixes a bug that removed the default 5 second wait period.
[#5238](https://github.com/Kong/kubernetes-ingress-controller/pull/5238)

## [3.0.1]

Expand Down
1 change: 1 addition & 0 deletions docs/cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
| `--gateway-discovery-dns-strategy` | `dns-strategy` | DNS strategy to use when creating Gateway's Admin API addresses. One of: ip, service, pod. | `"ip"` |
| `--health-probe-bind-address` | `string` | The address the probe endpoint binds to. | `:10254` |
| `--ingress-class` | `string` | Name of the ingress class to route through this controller. | `kong` |
| `--init-cache-sync-duration` | `duration` | The initial delay to wait for Kubernetes object caches to be synced before the initial configuration. | `5s` |
| `--kong-admin-ca-cert` | `string` | PEM-encoded CA certificate to verify Kong's Admin TLS certificate. Mutually exclusive with --kong-admin-ca-cert-file. | |
| `--kong-admin-ca-cert-file` | `string` | Path to PEM-encoded CA certificate file to verify Kong's Admin TLS certificate. Mutually exclusive with --kong-admin-ca-cert. | |
| `--kong-admin-concurrency` | `int` | Max number of concurrent requests sent to Kong's Admin API. | `10` |
Expand Down
1 change: 1 addition & 0 deletions internal/manager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func (c *Config) FlagSet() *pflag.FlagSet {
flagSet.StringVar(&c.ProbeAddr, "health-probe-bind-address", fmt.Sprintf(":%v", HealthzPort), "The address the probe endpoint binds to.")
flagSet.Float32Var(&c.ProxySyncSeconds, "proxy-sync-seconds", dataplane.DefaultSyncSeconds,
"Define the rate (in seconds) in which configuration updates will be applied to the Kong Admin API.")
flagSet.DurationVar(&c.InitCacheSyncDuration, "init-cache-sync-duration", dataplane.DefaultCacheSyncWaitDuration, `The initial delay to wait for Kubernetes object caches to be synced before the initial configuration.`)
flagSet.Float32Var(&c.ProxyTimeoutSeconds, "proxy-timeout-seconds", dataplane.DefaultTimeoutSeconds,
"Sets the timeout (in seconds) for all requests to Kong's Admin API.")

Expand Down

1 comment on commit 7ac256a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 7ac256a Previous: ceae5b1 Ratio
BenchmarkDeckgenGenerateSHA - ns/op 78636 ns/op 29838 ns/op 2.64

This comment was automatically generated by workflow using github-action-benchmark.

CC: @Kong/k8s-maintainers

Please sign in to comment.