Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nest Helm Release settings #1751

Merged
merged 7 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
## HEAD (Unreleased)

Breaking change note:

#1751 moved the Helm Release (beta) Provider options into a complex type called `helmReleaseSettings`. Following this
change, you can set these options in the following ways:

1. As arguments to a first-class Provider
```typescript
new k8s.Provider("test", { helmReleaseSettings: { driver: "secret" } });
```

1. Stack configuration for the default Provider
```
pulumi config set --path kubernetes:helmReleaseSettings.driver "secret"
```

1. As environment variables
```
EXPORT PULUMI_K8S_HELM_DRIVER="secret"
```

- [sdk/dotnet] Fix creation of CustomResources (https://github.com/pulumi/pulumi-kubernetes/pull/1741)
- 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)
- Nest helm.Release Provider settings (https://github.com/pulumi/pulumi-kubernetes/pull/1751)
lblackstone marked this conversation as resolved.
Show resolved Hide resolved
- Change await logic client to use target apiVersion on updates (https://github.com/pulumi/pulumi-kubernetes/pull/1758)

## 3.7.3 (September 30, 2021)
Expand Down
140 changes: 63 additions & 77 deletions provider/cmd/pulumi-resource-kubernetes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,6 @@
"type": "boolean",
"description": "BETA FEATURE - If present and set to true, enable server-side diff calculations.\nThis feature is in developer preview, and is disabled by default.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `enableDryRun` parameter.\n2. The `PULUMI_K8S_ENABLE_DRY_RUN` environment variable."
},
"helmDriver": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The backend storage driver for Helm. Values are: configmap, secret, memory, sql."
},
"helmPluginsPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the helm plugins directory."
},
"helmRegistryConfigPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the registry config file."
},
"helmRepositoryCache": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing cached repository indexes."
},
"helmRepositoryConfigPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing repository names and URLs."
},
"kubeconfig": {
"type": "string",
"description": "The contents of a kubeconfig file or the path to a kubeconfig file. If this is set, this config will be used instead of $KUBECONFIG.",
Expand All @@ -66,10 +46,6 @@
"suppressHelmHookWarnings": {
"type": "boolean",
"description": "If present and set to true, suppress unsupported Helm hook warnings from the CLI.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `suppressHelmHookWarnings` parameter.\n2. The `PULUMI_K8S_SUPPRESS_HELM_HOOK_WARNINGS` environment variable."
},
"suppressHelmReleaseBetaWarning": {
"type": "boolean",
"description": "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to true, this warning is omitted."
}
}
},
Expand Down Expand Up @@ -23085,6 +23061,66 @@
}
}
},
"kubernetes:index:HelmReleaseSettings": {
"description": "BETA FEATURE - Options to configure the Helm Release resource.",
"properties": {
"driver": {
"type": "string",
"description": "The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_DRIVER"
]
}
},
"pluginsPath": {
"type": "string",
"description": "The path to the helm plugins directory.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_PLUGINS_PATH"
]
}
},
"registryConfigPath": {
"type": "string",
"description": "The path to the registry config file.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_REGISTRY_CONFIG_PATH"
]
}
},
"repositoryCache": {
"type": "string",
"description": "The path to the file containing cached repository indexes.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_REPOSITORY_CACHE"
]
}
},
"repositoryConfigPath": {
"type": "string",
"description": "The path to the file containing repository names and URLs.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_REPOSITORY_CONFIG_PATH"
]
}
},
"suppressBetaWarning": {
"type": "boolean",
"description": "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to \"true\", this warning is omitted.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_SUPPRESS_HELM_RELEASE_BETA_WARNING"
]
}
}
},
"type": "object"
},
"kubernetes:index:KubeClientSettings": {
"description": "Options for tuning the Kubernetes client used by a Provider.",
"properties": {
Expand Down Expand Up @@ -29935,50 +29971,9 @@
]
}
},
"helmDriver": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_DRIVER"
]
}
},
"helmPluginsPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the helm plugins directory.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_PLUGINS_PATH"
]
}
},
"helmRegistryConfigPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the registry config file.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_REGISTRY_CONFIG_PATH"
]
}
},
"helmRepositoryCache": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing cached repository indexes.",
"defaultInfo": {
"environment": [
"PULUMI_K8s_HELM_REPOSITORY_CACHE"
]
}
},
"helmRepositoryConfigPath": {
"type": "string",
"description": "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing repository names and URLs.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_HELM_REPOSITORY_CONFIG_PATH"
]
}
"helmReleaseSettings": {
"$ref": "#/types/kubernetes:index:HelmReleaseSettings",
"description": "BETA FEATURE - Options to configure the Helm Release resource."
},
"kubeClientSettings": {
"$ref": "#/types/kubernetes:index:KubeClientSettings",
Expand Down Expand Up @@ -30023,15 +30018,6 @@
"PULUMI_K8S_SUPPRESS_HELM_HOOK_WARNINGS"
]
}
},
"suppressHelmReleaseBetaWarning": {
"type": "boolean",
"description": "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to \"true\", this warning is omitted.",
"defaultInfo": {
"environment": [
"PULUMI_K8S_SUPPRESS_HELM_RELEASE_BETA_WARNING"
]
}
}
}
},
Expand Down
64 changes: 64 additions & 0 deletions provider/pkg/gen/overlays.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,69 @@ var kubeClientSettings = pschema.ComplexTypeSpec{
},
}

var helmReleaseSettings = pschema.ComplexTypeSpec{
ObjectTypeSpec: pschema.ObjectTypeSpec{
Description: "BETA FEATURE - Options to configure the Helm Release resource.",
Properties: map[string]pschema.PropertySpec{
"driver": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_DRIVER",
},
},
Description: "The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"pluginsPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_PLUGINS_PATH",
},
},
Description: "The path to the helm plugins directory.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"registryConfigPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_REGISTRY_CONFIG_PATH",
},
},
Description: "The path to the registry config file.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"repositoryConfigPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_REPOSITORY_CONFIG_PATH",
},
},
Description: "The path to the file containing repository names and URLs.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"repositoryCache": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_REPOSITORY_CACHE",
},
},
Description: "The path to the file containing cached repository indexes.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"suppressBetaWarning": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_SUPPRESS_HELM_RELEASE_BETA_WARNING",
},
},
Description: "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to \"true\", this warning is omitted.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
},
Type: "object",
},
}

var helmV3ReleaseResource = pschema.ResourceSpec{
ObjectTypeSpec: pschema.ObjectTypeSpec{
Description: "A Release is an instance of a chart running in a Kubernetes cluster.\n\nA Chart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster.",
Expand Down Expand Up @@ -974,6 +1037,7 @@ func init() {
typeOverlays["kubernetes:helm.sh/v3:RepositoryOpts"] = helmV3RepoOpts
typeOverlays["kubernetes:helm.sh/v3:ReleaseStatus"] = helmV3ReleaseStatus
typeOverlays["kubernetes:index:KubeClientSettings"] = kubeClientSettings
typeOverlays["kubernetes:index:HelmReleaseSettings"] = helmReleaseSettings
Copy link
Member

@mikhailshilkov mikhailshilkov Oct 6, 2021

Choose a reason for hiding this comment

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

Should these be in helm.sh/v3 module?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this type is for the Provider, so it needs to be at the top level.


resourceOverlays["kubernetes:helm.sh/v3:Release"] = helmV3ReleaseResource
}
82 changes: 4 additions & 78 deletions provider/pkg/gen/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,30 +76,6 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
Description: "If present and set to true, suppress apiVersion deprecation warnings from the CLI.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `suppressDeprecationWarnings` parameter.\n2. The `PULUMI_K8S_SUPPRESS_DEPRECATION_WARNINGS` environment variable.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"suppressHelmReleaseBetaWarning": {
Description: "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to true, this warning is omitted.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"helmDriver": {
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmPluginsPath": {
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the helm plugins directory.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRegistryConfigPath": {
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the registry config file.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRepositoryConfigPath": {
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing repository names and URLs.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRepositoryCache": {
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing cached repository indexes.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"suppressHelmHookWarnings": {
Description: "If present and set to true, suppress unsupported Helm hook warnings from the CLI.\n\nThis config can be specified in the following ways, using this precedence:\n1. This `suppressHelmHookWarnings` parameter.\n2. The `PULUMI_K8S_SUPPRESS_HELM_HOOK_WARNINGS` environment variable.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
Expand Down Expand Up @@ -161,64 +137,14 @@ func PulumiSchema(swagger map[string]interface{}) pschema.PackageSpec {
Description: "If present and set to true, suppress apiVersion deprecation warnings from the CLI.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"suppressHelmReleaseBetaWarning": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_SUPPRESS_HELM_RELEASE_BETA_WARNING",
},
},
Description: "While Helm Release provider is in beta, by default 'pulumi up' will log a warning if the resource is used. If present and set to \"true\", this warning is omitted.",
TypeSpec: pschema.TypeSpec{Type: "boolean"},
},
"helmDriver": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_DRIVER",
},
},
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The backend storage driver for Helm. Values are: configmap, secret, memory, sql.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmPluginsPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_PLUGINS_PATH",
},
},
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the helm plugins directory.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRegistryConfigPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_REGISTRY_CONFIG_PATH",
},
},
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the registry config file.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRepositoryConfigPath": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8S_HELM_REPOSITORY_CONFIG_PATH",
},
},
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing repository names and URLs.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"helmRepositoryCache": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
"PULUMI_K8s_HELM_REPOSITORY_CACHE",
},
},
Description: "BETA FEATURE - Used for supporting Helm Release resource (Beta). The path to the file containing cached repository indexes.",
TypeSpec: pschema.TypeSpec{Type: "string"},
},
"kubeClientSettings": {
Description: "Options for tuning the Kubernetes client used by a Provider.",
TypeSpec: pschema.TypeSpec{Ref: "#/types/kubernetes:index:KubeClientSettings"},
},
"helmReleaseSettings": {
Description: "BETA FEATURE - Options to configure the Helm Release resource.",
TypeSpec: pschema.TypeSpec{Ref: "#/types/kubernetes:index:HelmReleaseSettings"},
},
"suppressHelmHookWarnings": {
DefaultInfo: &pschema.DefaultSpec{
Environment: []string{
Expand Down
Loading