Skip to content

Commit

Permalink
Reduce provider-kubernetes' API load
Browse files Browse the repository at this point in the history
we've observed if many instances are created at the same time, the
objects might need manual intervention due to the `create-pending`
annotation.

This change will reduce the API load on the apiservers to reduce the
chances of this actually happening.
  • Loading branch information
Kidswiss committed Nov 25, 2024
1 parent dbbd196 commit d904359
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 9 deletions.
12 changes: 12 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,18 @@ parameters:
serviceAccountName: provider-kubernetes
defaultProviderConfig: {}
additionalProviderConfigs: []
additionalRuntimeConfigSpec:
deploymentTemplate:
spec:
selector: {}
template:
spec:
securityContext: {}
containers:
- name: package-runtime
securityContext: {}
args:
- --max-reconcile-rate=10

helm:
enabled: false
Expand Down
8 changes: 7 additions & 1 deletion component/provider.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,13 @@ local provider(name, provider) =
},
};

local runtimeConf = common.DefaultRuntimeConfigWithSaName(sa.metadata.name);
local runtimeConf = common.DefaultRuntimeConfigWithSaName(sa.metadata.name) +
{
spec+: if std.objectHas(provider, 'additionalRuntimeConfigSpec') &&
provider.additionalRuntimeConfigSpec != null then
provider.additionalRuntimeConfigSpec else {},
};


local providerManifest = crossplane.Provider('provider-' + name) {
spec+: escapePackage(provider.spec) + runtimeConfigRef(sa.metadata.name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ spec:
template:
spec:
containers:
- name: package-runtime
- args:
- --max-reconcile-rate=10
name: package-runtime
securityContext: {}
securityContext: {}
serviceAccountName: provider-kubernetes
---
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
Expand Down
5 changes: 3 additions & 2 deletions tests/golden/dev/appcat/appcat/10_provider_kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ spec:
template:
spec:
containers:
- name: package-runtime
- args:
- --max-reconcile-rate=10
name: package-runtime
securityContext: {}
securityContext: {}
serviceAccountName: provider-kubernetes
---
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ spec:
template:
spec:
containers:
- name: package-runtime
- args:
- --max-reconcile-rate=10
name: package-runtime
securityContext: {}
securityContext: {}
serviceAccountName: provider-kubernetes
---
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ spec:
template:
spec:
containers:
- name: package-runtime
- args:
- --max-reconcile-rate=10
name: package-runtime
securityContext: {}
securityContext: {}
serviceAccountName: provider-kubernetes
---
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: ProviderConfig
Expand Down

0 comments on commit d904359

Please sign in to comment.