Skip to content

Commit

Permalink
Add k8s client tuning settings to Provider (#1748)
Browse files Browse the repository at this point in the history
- Provide options to configure burst and QPS
- Configure the provider client to use these settings
  • Loading branch information
lblackstone authored Oct 4, 2021
1 parent ed5f437 commit f229421
Show file tree
Hide file tree
Showing 22 changed files with 1,263 additions and 647 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## HEAD (Unreleased)

- Always override namespace for helm release operations (https://github.com/pulumi/pulumi-kubernetes/pull/1747)
- Add k8s client tuning settings to Provider (https://github.com/pulumi/pulumi-kubernetes/pull/1748)

## 3.7.3 (September 30, 2021)
- Use helm release's namespace on templates where namespace is left unspecified (https://github.com/pulumi/pulumi-kubernetes/pull/1733)
Expand Down
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-gen-kubernetes/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func writeGoClient(pkg *schema.Package, outdir string, templateDir string) {
deprecatedProviderFile = strings.ReplaceAll(deprecatedProviderFile, "\ntype", fmt.Sprintf("\n%s\ntype", deprecatedComment))
files["kubernetes/providers/provider.go"] = []byte(deprecatedProviderFile)

files["kubernetes/pulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "pulumiTypes.go"))
files["kubernetes/customPulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "customPulumiTypes.go"))
files["kubernetes/apiextensions/customResource.go"] = mustLoadGoFile(filepath.Join(templateDir, "apiextensions", "customResource.go"))
files["kubernetes/helm/v2/chart.go"] = mustLoadGoFile(filepath.Join(templateDir, "helm", "v2", "chart.go"))
files["kubernetes/helm/v2/pulumiTypes.go"] = mustLoadGoFile(filepath.Join(templateDir, "helm", "v2", "pulumiTypes.go"))
Expand Down
29 changes: 29 additions & 0 deletions provider/cmd/pulumi-resource-kubernetes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23085,6 +23085,30 @@
}
}
},
"kubernetes:index:KubeClientSettings": {
"description": "Options for tuning the Kubernetes client used by a Provider.",
"properties": {
"burst": {
"type": "integer",
"description": "Maximum burst for throttle. Default value is 10.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_CLIENT_BURST"
]
}
},
"qps": {
"type": "number",
"description": "Maximum queries per second (QPS) to the API server from this client. Default value is 5.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_CLIENT_QPS"
]
}
}
},
"type": "object"
},
"kubernetes:meta/v1:APIGroup": {
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
"properties": {
Expand Down Expand Up @@ -29956,6 +29980,10 @@
]
}
},
"kubeClientSettings": {
"$ref": "#/types/kubernetes:index:KubeClientSettings",
"description": "Options for tuning the Kubernetes client used by a Provider."
},
"kubeconfig": {
"type": "string",
"description": "The contents of a kubeconfig file or the path to a kubeconfig file.",
Expand Down Expand Up @@ -45333,6 +45361,7 @@
"compatibility": "kubernetes20",
"dictionaryConstructors": true,
"namespaces": {
"": "Provider",
"admissionregistration.k8s.io/v1": "AdmissionRegistration.V1",
"admissionregistration.k8s.io/v1beta1": "AdmissionRegistration.V1Beta1",
"apiextensions.k8s.io/v1": "ApiExtensions.V1",
Expand Down
Loading

0 comments on commit f229421

Please sign in to comment.