diff --git a/CHANGELOG.md b/CHANGELOG.md index a46f3fa5fa..d2221a095d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,8 @@ Adding a new version? You'll need three changes: [#5220](https://github.com/Kong/kubernetes-ingress-controller/pull/5220) - Added support for GRPC over HTTP (without TLS) in Gateway API. [#5128](https://github.com/Kong/kubernetes-ingress-controller/pull/5128) +- 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) ### Fixed diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md index 2afbe910ef..e12e4ad819 100644 --- a/docs/cli-arguments.md +++ b/docs/cli-arguments.md @@ -38,6 +38,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` | diff --git a/internal/manager/config.go b/internal/manager/config.go index 44addb9a91..58936449ca 100644 --- a/internal/manager/config.go +++ b/internal/manager/config.go @@ -196,6 +196,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.")