├── sdk ├── .gitignore ├── dotnet │ ├── version.txt │ ├── Config │ │ ├── README.md │ │ └── Config.cs │ ├── logo.png │ ├── pulumi-plugin.json │ ├── Outputs │ │ ├── K0sMetadata.cs │ │ ├── ClusterMetadata.cs │ │ ├── K0sKine.cs │ │ ├── K0sTelemetry.cs │ │ ├── ClusterLocalhost.cs │ │ ├── K0sInstallConfig.cs │ │ ├── K0sPodSecurityPolicy.cs │ │ ├── K0sScheduler.cs │ │ ├── K0sControllerManager.cs │ │ ├── K0sImage.cs │ │ ├── K0sKonnectivity.cs │ │ ├── ClusterHook.cs │ │ ├── K0sWorkerProfile.cs │ │ ├── ClusterSpec.cs │ │ ├── K0sKubeRouterImage.cs │ │ ├── K0sStorage.cs │ │ ├── K0sFeatureGate.cs │ │ ├── ClusterHooks.cs │ │ ├── K0sDualStack.cs │ │ ├── K0sNodeLocalLoadBalancing.cs │ │ ├── K0s.cs │ │ ├── K0sEtcd.cs │ │ ├── ClusterK0s.cs │ │ ├── K0sKubeProxyIPTables.cs │ │ ├── K0sCalicoImage.cs │ │ ├── K0sEnvoyProxy.cs │ │ ├── K0sEtcdExternalCluster.cs │ │ ├── ClusterSSH.cs │ │ ├── K0sKubeProxy.cs │ │ ├── K0sInstallConfigUser.cs │ │ ├── K0sKubeRouter.cs │ │ ├── K0sAPI.cs │ │ ├── ClusterFile.cs │ │ ├── ClusterOpenSSH.cs │ │ ├── K0sKubeProxyIPVS.cs │ │ ├── K0sCalico.cs │ │ ├── K0sImages.cs │ │ ├── K0sNetwork.cs │ │ ├── ClusterWinRM.cs │ │ ├── K0sSpec.cs │ │ └── ClusterHost.cs │ ├── Inputs │ │ ├── K0sTelemetryArgs.cs │ │ ├── K0sMetadataArgs.cs │ │ ├── ClusterLocalhostArgs.cs │ │ ├── ClusterMetadataArgs.cs │ │ ├── K0sInstallConfigArgs.cs │ │ ├── K0sPodSecurityPolicyArgs.cs │ │ ├── K0sImageArgs.cs │ │ ├── K0sKonnectivityArgs.cs │ │ ├── K0sKubeRouterImageArgs.cs │ │ ├── K0sStorageArgs.cs │ │ ├── K0sSchedulerArgs.cs │ │ ├── K0sDualStackArgs.cs │ │ ├── ClusterHooksArgs.cs │ │ ├── K0sControllerManagerArgs.cs │ │ ├── K0sArgs.cs │ │ ├── K0sNodeLocalLoadBalancingArgs.cs │ │ ├── ClusterK0sArgs.cs │ │ ├── K0sWorkerProfileArgs.cs │ │ ├── K0sKineArgs.cs │ │ ├── ClusterSpecArgs.cs │ │ ├── K0sCalicoImageArgs.cs │ │ ├── K0sEnvoyProxyArgs.cs │ │ ├── K0sKubeProxyIPTablesArgs.cs │ │ ├── K0sEtcdArgs.cs │ │ ├── K0sFeatureGateArgs.cs │ │ ├── K0sKubeProxyArgs.cs │ │ ├── ClusterHookArgs.cs │ │ ├── K0sInstallConfigUserArgs.cs │ │ ├── ClusterFileArgs.cs │ │ ├── K0sKubeRouterArgs.cs │ │ ├── K0sKubeProxyIPVSArgs.cs │ │ ├── ClusterSSHArgs.cs │ │ ├── K0sAPIArgs.cs │ │ ├── K0sImagesArgs.cs │ │ ├── K0sNetworkArgs.cs │ │ ├── K0sCalicoArgs.cs │ │ ├── ClusterOpenSSHArgs.cs │ │ ├── K0sEtcdExternalClusterArgs.cs │ │ ├── K0sSpecArgs.cs │ │ ├── ClusterHostArgs.cs │ │ └── ClusterWinRMArgs.cs │ ├── README.md │ ├── Pulumi.K0s.csproj │ ├── Utilities.cs │ ├── Provider.cs │ └── Cluster.cs ├── python │ ├── pulumi_k0s │ │ ├── py.typed │ │ ├── README.md │ │ ├── pulumi-plugin.json │ │ ├── config │ │ │ ├── __init__.py │ │ │ ├── __init__.pyi │ │ │ └── vars.py │ │ └── __init__.py │ ├── setup.py │ └── README.md ├── nodejs │ ├── README.md │ ├── config │ │ ├── index.ts │ │ └── vars.ts │ ├── types │ │ └── index.ts │ ├── package.json │ ├── tsconfig.json │ ├── index.ts │ ├── provider.ts │ ├── utilities.ts │ └── cluster.ts ├── go │ └── k0s │ │ ├── doc.go │ │ ├── pulumi-plugin.json │ │ ├── internal │ │ ├── pulumiVersion.go │ │ └── pulumiUtilities.go │ │ ├── init.go │ │ ├── config │ │ └── config.go │ │ ├── provider.go │ │ └── cluster.go └── go.mod ├── examples ├── python │ ├── .gitignore │ ├── requirements.txt │ ├── Pulumi.yaml │ └── __main__.py ├── nodejs │ ├── .gitignore │ ├── Pulumi.yaml │ ├── package.json │ ├── tsconfig.json │ └── index.ts ├── go │ ├── go.mod │ ├── Pulumi.yaml │ └── main.go ├── dotnet │ ├── Pulumi.yaml │ ├── provider-k0s.csproj │ └── Program.cs └── yaml │ ├── Pulumi.yaml │ └── README.md ├── go.work ├── .gitignore ├── provider ├── cmd │ └── pulumi-resource-k0s │ │ └── main.go ├── provider.go ├── helpers.go ├── internal │ └── introspect │ │ ├── propertiesMap_test.go │ │ └── propertiesMap.go ├── config.go └── k0sctl.go ├── tests ├── provider_test.go ├── common.go └── cluster_test.go ├── .goreleaser.yml ├── .github └── workflows │ ├── makefile.yaml │ └── release.yml ├── README.md ├── .devcontainer.json └── Makefile /sdk/.gitignore: -------------------------------------------------------------------------------- 1 | schema/ 2 | -------------------------------------------------------------------------------- /sdk/dotnet/version.txt: -------------------------------------------------------------------------------- 1 | 0.3.0 2 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/python/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | venv/ -------------------------------------------------------------------------------- /examples/nodejs/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /node_modules/ -------------------------------------------------------------------------------- /examples/python/requirements.txt: -------------------------------------------------------------------------------- 1 | pulumi>=3.0.0,<4.0.0 2 | pulumi-k0s==0.3.0 3 | -------------------------------------------------------------------------------- /sdk/nodejs/README.md: -------------------------------------------------------------------------------- 1 | A Pulumi package for creating and managing k0s clusters. 2 | -------------------------------------------------------------------------------- /sdk/dotnet/Config/README.md: -------------------------------------------------------------------------------- 1 | A Pulumi package for creating and managing k0s clusters. 2 | -------------------------------------------------------------------------------- /sdk/dotnet/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ydkn/pulumi-k0s/HEAD/sdk/dotnet/logo.png -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/README.md: -------------------------------------------------------------------------------- 1 | A Pulumi package for creating and managing k0s clusters. 2 | -------------------------------------------------------------------------------- /sdk/go/k0s/doc.go: -------------------------------------------------------------------------------- 1 | // A Pulumi package for creating and managing k0s clusters. 2 | package k0s 3 | -------------------------------------------------------------------------------- /go.work: -------------------------------------------------------------------------------- 1 | go 1.23.3 2 | 3 | toolchain go1.23.3 4 | 5 | use ( 6 | ./provider 7 | ./sdk 8 | ./tests 9 | ) 10 | -------------------------------------------------------------------------------- /examples/go/go.mod: -------------------------------------------------------------------------------- 1 | module provider-k0s 2 | 3 | go 1.20 4 | 5 | require ( 6 | github.com/pulumi/pulumi/sdk/v3 v3.30.0 7 | ) -------------------------------------------------------------------------------- /examples/go/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: provider-k0s 2 | runtime: go 3 | plugins: 4 | providers: 5 | - name: k0s 6 | path: ../../bin 7 | -------------------------------------------------------------------------------- /sdk/dotnet/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "k0s", 4 | "server": "https://repo.ydkn.io/pulumi-k0s" 5 | } 6 | -------------------------------------------------------------------------------- /sdk/go/k0s/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "k0s", 4 | "server": "https://repo.ydkn.io/pulumi-k0s" 5 | } 6 | -------------------------------------------------------------------------------- /examples/dotnet/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: provider-k0s 2 | runtime: dotnet 3 | plugins: 4 | providers: 5 | - name: k0s 6 | path: ../../bin 7 | -------------------------------------------------------------------------------- /examples/nodejs/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: provider-k0s 2 | runtime: nodejs 3 | plugins: 4 | providers: 5 | - name: k0s 6 | path: ../../bin 7 | -------------------------------------------------------------------------------- /examples/python/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: provider-k0s 2 | runtime: python 3 | plugins: 4 | providers: 5 | - name: k0s 6 | path: ../../bin 7 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/pulumi-plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "resource": true, 3 | "name": "k0s", 4 | "server": "https://repo.ydkn.io/pulumi-k0s" 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | **/bin/ 3 | **/obj/ 4 | **/node_modules/ 5 | **/.vs 6 | **/.idea 7 | **/.ionide 8 | .pulumi 9 | Pulumi.*.yaml 10 | yarn.lock 11 | ci-scripts 12 | /nuget/ 13 | provider/**/schema-embed.json 14 | go.work.sum 15 | -------------------------------------------------------------------------------- /sdk/nodejs/config/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | // Export members: 5 | export * from "./vars"; 6 | -------------------------------------------------------------------------------- /examples/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "provider-k0s", 3 | "devDependencies": { 4 | "@types/node": "^14" 5 | }, 6 | "dependencies": { 7 | "typescript": "^4.0.0", 8 | "@pulumi/pulumi": "^3.0.0", 9 | "@pulumi/k0s": "0.3.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/config/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by pulumi-language-python. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import sys 6 | from .vars import _ExportableConfig 7 | 8 | sys.modules[__name__].__class__ = _ExportableConfig 9 | -------------------------------------------------------------------------------- /sdk/go/k0s/internal/pulumiVersion.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package internal 5 | 6 | import ( 7 | "github.com/blang/semver" 8 | ) 9 | 10 | var SdkVersion semver.Version = semver.Version{} 11 | var pluginDownloadURL string = "" 12 | -------------------------------------------------------------------------------- /sdk/nodejs/types/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as utilities from "../utilities"; 5 | 6 | // Export sub-modules: 7 | import * as input from "./input"; 8 | import * as output from "./output"; 9 | 10 | export { 11 | input, 12 | output, 13 | }; 14 | -------------------------------------------------------------------------------- /examples/dotnet/provider-k0s.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net6.0 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "outDir": "bin", 5 | "target": "es2016", 6 | "module": "commonjs", 7 | "moduleResolution": "node", 8 | "sourceMap": true, 9 | "experimentalDecorators": true, 10 | "pretty": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "noImplicitReturns": true, 13 | "forceConsistentCasingInFileNames": true 14 | }, 15 | "files": [ 16 | "index.ts", 17 | ] 18 | } -------------------------------------------------------------------------------- /provider/cmd/pulumi-resource-k0s/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | p "github.com/pulumi/pulumi-go-provider" 8 | k0s "github.com/ydkn/pulumi-k0s/provider" 9 | ) 10 | 11 | // Serve the provider against Pulumi's Provider protocol. 12 | func main() { 13 | if err := p.RunProvider(k0s.Name, k0s.Version, k0s.Provider()); err != nil { 14 | fmt.Fprintf(os.Stderr, "Error: %s", err.Error()) 15 | 16 | os.Exit(1) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/nodejs/index.ts: -------------------------------------------------------------------------------- 1 | import * as pulumi from "@pulumi/pulumi"; 2 | import * as k0s from "@pulumi/k0s"; 3 | 4 | const myProvider = new k0s.Provider("myProvider", {noDrain: true}); 5 | const myCluster = new k0s.Cluster("myCluster", {spec: { 6 | hosts: [{ 7 | role: "controller+worker", 8 | localhost: { 9 | enabled: true, 10 | }, 11 | }], 12 | }}, { 13 | provider: myProvider, 14 | }); 15 | export const output = { 16 | value: myCluster.kubeconfig, 17 | }; 18 | -------------------------------------------------------------------------------- /examples/python/__main__.py: -------------------------------------------------------------------------------- 1 | import pulumi 2 | import pulumi_k0s as k0s 3 | 4 | my_provider = k0s.Provider("myProvider", no_drain=True) 5 | my_cluster = k0s.Cluster("myCluster", spec=k0s.ClusterSpecArgs( 6 | hosts=[k0s.ClusterHostArgs( 7 | role="controller+worker", 8 | localhost=k0s.ClusterLocalhostArgs( 9 | enabled=True, 10 | ), 11 | )], 12 | ), 13 | opts=pulumi.ResourceOptions(provider=my_provider)) 14 | pulumi.export("output", { 15 | "value": my_cluster.kubeconfig, 16 | }) 17 | -------------------------------------------------------------------------------- /tests/provider_test.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "testing" 5 | 6 | p "github.com/pulumi/pulumi-go-provider" 7 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestProviderConfigure(t *testing.T) { 12 | prov := integrationServer() 13 | 14 | err := prov.Configure(p.ConfigureRequest{ 15 | Args: resource.PropertyMap{ 16 | "noDrain": resource.NewBoolProperty(true), 17 | "skipDowngradeCheck": resource.NewBoolProperty(true), 18 | }, 19 | }) 20 | require.NoError(t, err) 21 | } 22 | -------------------------------------------------------------------------------- /examples/yaml/Pulumi.yaml: -------------------------------------------------------------------------------- 1 | name: provider-k0s 2 | runtime: yaml 3 | plugins: 4 | providers: 5 | - name: k0s 6 | path: ../../bin 7 | 8 | resources: 9 | myProvider: 10 | type: pulumi:providers:k0s 11 | properties: 12 | noDrain: true 13 | myCluster: 14 | type: k0s:Cluster 15 | properties: 16 | spec: 17 | hosts: 18 | - role: controller+worker 19 | localhost: 20 | enabled: true 21 | options: 22 | provider: ${myProvider} 23 | 24 | outputs: 25 | output: 26 | value: ${myCluster.kubeconfig} 27 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sMetadata.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sMetadata 15 | { 16 | public readonly string Name; 17 | 18 | [OutputConstructor] 19 | private K0sMetadata(string name) 20 | { 21 | Name = name; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterMetadata.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterMetadata 15 | { 16 | public readonly string Name; 17 | 18 | [OutputConstructor] 19 | private ClusterMetadata(string name) 20 | { 21 | Name = name; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKine.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKine 15 | { 16 | public readonly string DataSource; 17 | 18 | [OutputConstructor] 19 | private K0sKine(string dataSource) 20 | { 21 | DataSource = dataSource; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sTelemetry.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sTelemetry 15 | { 16 | public readonly bool? Enabled; 17 | 18 | [OutputConstructor] 19 | private K0sTelemetry(bool? enabled) 20 | { 21 | Enabled = enabled; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterLocalhost.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterLocalhost 15 | { 16 | public readonly bool? Enabled; 17 | 18 | [OutputConstructor] 19 | private ClusterLocalhost(bool? enabled) 20 | { 21 | Enabled = enabled; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/common.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "github.com/blang/semver" 5 | p "github.com/pulumi/pulumi-go-provider" 6 | "github.com/pulumi/pulumi-go-provider/integration" 7 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 8 | "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" 9 | 10 | k0s "github.com/ydkn/pulumi-k0s/provider" 11 | ) 12 | 13 | func urn(typ, name string) resource.URN { 14 | return resource.NewURN("stack", "project", "", tokens.Type("test:index:"+typ), name) 15 | } 16 | 17 | func provider() p.Provider { 18 | return k0s.Provider() 19 | } 20 | 21 | func integrationServer() integration.Server { 22 | return integration.NewServer(k0s.Name, semver.MustParse("1.0.0"), provider()) 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sInstallConfig.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sInstallConfig 15 | { 16 | public readonly Outputs.K0sInstallConfigUser? Users; 17 | 18 | [OutputConstructor] 19 | private K0sInstallConfig(Outputs.K0sInstallConfigUser? users) 20 | { 21 | Users = users; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sPodSecurityPolicy.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sPodSecurityPolicy 15 | { 16 | public readonly string? DefaultPolicy; 17 | 18 | [OutputConstructor] 19 | private K0sPodSecurityPolicy(string? defaultPolicy) 20 | { 21 | DefaultPolicy = defaultPolicy; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sTelemetryArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sTelemetryArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("enabled")] 16 | public Input? Enabled { get; set; } 17 | 18 | public K0sTelemetryArgs() 19 | { 20 | } 21 | public static new K0sTelemetryArgs Empty => new K0sTelemetryArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sMetadataArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sMetadataArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("name", required: true)] 16 | public Input Name { get; set; } = null!; 17 | 18 | public K0sMetadataArgs() 19 | { 20 | } 21 | public static new K0sMetadataArgs Empty => new K0sMetadataArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sScheduler.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sScheduler 15 | { 16 | public readonly ImmutableDictionary? ExtraArgs; 17 | 18 | [OutputConstructor] 19 | private K0sScheduler(ImmutableDictionary? extraArgs) 20 | { 21 | ExtraArgs = extraArgs; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/nodejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@ydkn/pulumi-k0s", 3 | "version": "${VERSION}", 4 | "keywords": [ 5 | "pulumi", 6 | "kubernetes", 7 | "k0s" 8 | ], 9 | "homepage": "https://github.com/ydkn/pulumi-k0s", 10 | "repository": "https://github.com/ydkn/pulumi-k0s", 11 | "license": "Apache-2.0", 12 | "scripts": { 13 | "build": "tsc" 14 | }, 15 | "dependencies": { 16 | "@pulumi/pulumi": "^3.136.0" 17 | }, 18 | "devDependencies": { 19 | "@types/node": "^14", 20 | "typescript": "^4.3.5" 21 | }, 22 | "pulumi": { 23 | "resource": true, 24 | "name": "k0s", 25 | "server": "https://repo.ydkn.io/pulumi-k0s" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterLocalhostArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterLocalhostArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("enabled")] 16 | public Input? Enabled { get; set; } 17 | 18 | public ClusterLocalhostArgs() 19 | { 20 | } 21 | public static new ClusterLocalhostArgs Empty => new ClusterLocalhostArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterMetadataArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterMetadataArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("name", required: true)] 16 | public Input Name { get; set; } = null!; 17 | 18 | public ClusterMetadataArgs() 19 | { 20 | } 21 | public static new ClusterMetadataArgs Empty => new ClusterMetadataArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sControllerManager.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sControllerManager 15 | { 16 | public readonly ImmutableDictionary? ExtraArgs; 17 | 18 | [OutputConstructor] 19 | private K0sControllerManager(ImmutableDictionary? extraArgs) 20 | { 21 | ExtraArgs = extraArgs; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sdk/nodejs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "bin", 4 | "target": "es2016", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "declaration": true, 8 | "sourceMap": true, 9 | "stripInternal": true, 10 | "experimentalDecorators": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "forceConsistentCasingInFileNames": true, 13 | "strict": true 14 | }, 15 | "files": [ 16 | "cluster.ts", 17 | "config/index.ts", 18 | "config/vars.ts", 19 | "index.ts", 20 | "provider.ts", 21 | "types/index.ts", 22 | "types/input.ts", 23 | "types/output.ts", 24 | "utilities.ts" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sInstallConfigArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sInstallConfigArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("users")] 16 | public Input? Users { get; set; } 17 | 18 | public K0sInstallConfigArgs() 19 | { 20 | } 21 | public static new K0sInstallConfigArgs Empty => new K0sInstallConfigArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | archives: 3 | - id: archive 4 | name_template: "{{ .Binary }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}" 5 | before: 6 | hooks: 7 | - make provider 8 | builds: 9 | - binary: pulumi-resource-k0s 10 | dir: provider 11 | env: 12 | - CGO_ENABLED=0 13 | goarch: 14 | - amd64 15 | - arm64 16 | goos: 17 | - darwin 18 | - windows 19 | - linux 20 | ldflags: 21 | # The line below MUST align with the module in current provider/go.mod 22 | - -X github.com/ydkn/pulumi-k0s/provider.Version={{ .Tag }} 23 | main: ./cmd/pulumi-resource-k0s/ 24 | changelog: 25 | disable: false 26 | release: 27 | disable: false 28 | prerelease: auto 29 | snapshot: 30 | version_template: "{{ .Tag }}-SNAPSHOT" 31 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sPodSecurityPolicyArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sPodSecurityPolicyArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("defaultPolicy")] 16 | public Input? DefaultPolicy { get; set; } 17 | 18 | public K0sPodSecurityPolicyArgs() 19 | { 20 | } 21 | public static new K0sPodSecurityPolicyArgs Empty => new K0sPodSecurityPolicyArgs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sImage.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sImage 15 | { 16 | public readonly string? Image; 17 | public readonly string? Version; 18 | 19 | [OutputConstructor] 20 | private K0sImage( 21 | string? image, 22 | 23 | string? version) 24 | { 25 | Image = image; 26 | Version = version; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sImageArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sImageArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("image")] 16 | public Input? Image { get; set; } 17 | 18 | [Input("version")] 19 | public Input? Version { get; set; } 20 | 21 | public K0sImageArgs() 22 | { 23 | } 24 | public static new K0sImageArgs Empty => new K0sImageArgs(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKonnectivity.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKonnectivity 15 | { 16 | public readonly int? AdminPort; 17 | public readonly int? AgentPort; 18 | 19 | [OutputConstructor] 20 | private K0sKonnectivity( 21 | int? adminPort, 22 | 23 | int? agentPort) 24 | { 25 | AdminPort = adminPort; 26 | AgentPort = agentPort; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKonnectivityArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKonnectivityArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("adminPort")] 16 | public Input? AdminPort { get; set; } 17 | 18 | [Input("agentPort")] 19 | public Input? AgentPort { get; set; } 20 | 21 | public K0sKonnectivityArgs() 22 | { 23 | } 24 | public static new K0sKonnectivityArgs Empty => new K0sKonnectivityArgs(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterHook.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterHook 15 | { 16 | public readonly ImmutableArray After; 17 | public readonly ImmutableArray Before; 18 | 19 | [OutputConstructor] 20 | private ClusterHook( 21 | ImmutableArray after, 22 | 23 | ImmutableArray before) 24 | { 25 | After = after; 26 | Before = before; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/yaml/README.md: -------------------------------------------------------------------------------- 1 | # YAML Example Program 2 | 3 | Test Pulumi program written in YAML for testing this provider locally. 4 | 5 | Edit this yaml program to test features of your provider locally. You can run this program using the following command: 6 | 7 | ```bash 8 | pulumi login 9 | pulumi stack init local 10 | pulumi up 11 | ``` 12 | 13 | Note that unlike the rest of the auto-generated examples in the ./examples directory, this example is not automatically generated. It is intended to be a place for you to test your provider locally. 14 | 15 | The remaining examples are language specific examples derived from the `make gen_examples` command supported in this provider's Makefile. These examples are automatically generated and should not be edited directly. To regenerate these examples, run `make gen_examples` in the root of this provider's repository. 16 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sWorkerProfile.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sWorkerProfile 15 | { 16 | public readonly string Name; 17 | public readonly ImmutableDictionary Values; 18 | 19 | [OutputConstructor] 20 | private K0sWorkerProfile( 21 | string name, 22 | 23 | ImmutableDictionary values) 24 | { 25 | Name = name; 26 | Values = values; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterSpec.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterSpec 15 | { 16 | public readonly ImmutableArray Hosts; 17 | public readonly Outputs.ClusterK0s? K0s; 18 | 19 | [OutputConstructor] 20 | private ClusterSpec( 21 | ImmutableArray hosts, 22 | 23 | Outputs.ClusterK0s? k0s) 24 | { 25 | Hosts = hosts; 26 | K0s = k0s; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKubeRouterImage.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKubeRouterImage 15 | { 16 | public readonly Outputs.K0sImage? Cni; 17 | public readonly Outputs.K0sImage? CniInstaller; 18 | 19 | [OutputConstructor] 20 | private K0sKubeRouterImage( 21 | Outputs.K0sImage? cni, 22 | 23 | Outputs.K0sImage? cniInstaller) 24 | { 25 | Cni = cni; 26 | CniInstaller = cniInstaller; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKubeRouterImageArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKubeRouterImageArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("cni")] 16 | public Input? Cni { get; set; } 17 | 18 | [Input("cniInstaller")] 19 | public Input? CniInstaller { get; set; } 20 | 21 | public K0sKubeRouterImageArgs() 22 | { 23 | } 24 | public static new K0sKubeRouterImageArgs Empty => new K0sKubeRouterImageArgs(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sStorageArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sStorageArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("etcd")] 16 | public Input? Etcd { get; set; } 17 | 18 | [Input("kine")] 19 | public Input? Kine { get; set; } 20 | 21 | [Input("type")] 22 | public Input? Type { get; set; } 23 | 24 | public K0sStorageArgs() 25 | { 26 | } 27 | public static new K0sStorageArgs Empty => new K0sStorageArgs(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sSchedulerArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sSchedulerArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("extraArgs")] 16 | private InputMap? _extraArgs; 17 | public InputMap ExtraArgs 18 | { 19 | get => _extraArgs ?? (_extraArgs = new InputMap()); 20 | set => _extraArgs = value; 21 | } 22 | 23 | public K0sSchedulerArgs() 24 | { 25 | } 26 | public static new K0sSchedulerArgs Empty => new K0sSchedulerArgs(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sStorage.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sStorage 15 | { 16 | public readonly Outputs.K0sEtcd? Etcd; 17 | public readonly Outputs.K0sKine? Kine; 18 | public readonly string? Type; 19 | 20 | [OutputConstructor] 21 | private K0sStorage( 22 | Outputs.K0sEtcd? etcd, 23 | 24 | Outputs.K0sKine? kine, 25 | 26 | string? type) 27 | { 28 | Etcd = etcd; 29 | Kine = kine; 30 | Type = type; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/go/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/pulumi/pulumi-k0s/sdk/go/k0s" 5 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 6 | ) 7 | 8 | func main() { 9 | pulumi.Run(func(ctx *pulumi.Context) error { 10 | myProvider, err := k0s.NewProvider(ctx, "myProvider", &k0s.ProviderArgs{ 11 | NoDrain: pulumi.Bool(true), 12 | }) 13 | if err != nil { 14 | return err 15 | } 16 | myCluster, err := k0s.NewCluster(ctx, "myCluster", &k0s.ClusterArgs{ 17 | Spec: &k0s.ClusterSpecArgs{ 18 | Hosts: []k0s.ClusterHostArgs{ 19 | { 20 | Role: pulumi.String("controller+worker"), 21 | Localhost: { 22 | Enabled: pulumi.Bool(true), 23 | }, 24 | }, 25 | }, 26 | }, 27 | }, pulumi.Provider(myProvider)) 28 | if err != nil { 29 | return err 30 | } 31 | ctx.Export("output", map[string]interface{}{ 32 | "value": myCluster.Kubeconfig, 33 | }) 34 | return nil 35 | }) 36 | } 37 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sDualStackArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sDualStackArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("IPv6podCIDR")] 16 | public Input? IPv6podCIDR { get; set; } 17 | 18 | [Input("IPv6serviceCIDR")] 19 | public Input? IPv6serviceCIDR { get; set; } 20 | 21 | [Input("enabled")] 22 | public Input? Enabled { get; set; } 23 | 24 | public K0sDualStackArgs() 25 | { 26 | } 27 | public static new K0sDualStackArgs Empty => new K0sDualStackArgs(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterHooksArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterHooksArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("apply")] 16 | public Input? Apply { get; set; } 17 | 18 | [Input("backup")] 19 | public Input? Backup { get; set; } 20 | 21 | [Input("reset")] 22 | public Input? Reset { get; set; } 23 | 24 | public ClusterHooksArgs() 25 | { 26 | } 27 | public static new ClusterHooksArgs Empty => new ClusterHooksArgs(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sControllerManagerArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sControllerManagerArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("extraArgs")] 16 | private InputMap? _extraArgs; 17 | public InputMap ExtraArgs 18 | { 19 | get => _extraArgs ?? (_extraArgs = new InputMap()); 20 | set => _extraArgs = value; 21 | } 22 | 23 | public K0sControllerManagerArgs() 24 | { 25 | } 26 | public static new K0sControllerManagerArgs Empty => new K0sControllerManagerArgs(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sFeatureGate.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sFeatureGate 15 | { 16 | public readonly ImmutableArray Components; 17 | public readonly bool? Enabled; 18 | public readonly string Name; 19 | 20 | [OutputConstructor] 21 | private K0sFeatureGate( 22 | ImmutableArray components, 23 | 24 | bool? enabled, 25 | 26 | string name) 27 | { 28 | Components = components; 29 | Enabled = enabled; 30 | Name = name; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterHooks.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterHooks 15 | { 16 | public readonly Outputs.ClusterHook? Apply; 17 | public readonly Outputs.ClusterHook? Backup; 18 | public readonly Outputs.ClusterHook? Reset; 19 | 20 | [OutputConstructor] 21 | private ClusterHooks( 22 | Outputs.ClusterHook? apply, 23 | 24 | Outputs.ClusterHook? backup, 25 | 26 | Outputs.ClusterHook? reset) 27 | { 28 | Apply = apply; 29 | Backup = backup; 30 | Reset = reset; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sDualStack.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sDualStack 15 | { 16 | public readonly string? IPv6podCIDR; 17 | public readonly string? IPv6serviceCIDR; 18 | public readonly bool? Enabled; 19 | 20 | [OutputConstructor] 21 | private K0sDualStack( 22 | string? IPv6podCIDR, 23 | 24 | string? IPv6serviceCIDR, 25 | 26 | bool? enabled) 27 | { 28 | this.IPv6podCIDR = IPv6podCIDR; 29 | this.IPv6serviceCIDR = IPv6serviceCIDR; 30 | Enabled = enabled; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("apiVersion")] 16 | public Input? ApiVersion { get; set; } 17 | 18 | [Input("kind")] 19 | public Input? Kind { get; set; } 20 | 21 | [Input("metadata")] 22 | public Input? Metadata { get; set; } 23 | 24 | [Input("spec")] 25 | public Input? Spec { get; set; } 26 | 27 | public K0sArgs() 28 | { 29 | } 30 | public static new K0sArgs Empty => new K0sArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sNodeLocalLoadBalancingArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sNodeLocalLoadBalancingArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("enabled")] 16 | public Input? Enabled { get; set; } 17 | 18 | [Input("envoyProxy")] 19 | public Input? EnvoyProxy { get; set; } 20 | 21 | [Input("type")] 22 | public Input? Type { get; set; } 23 | 24 | public K0sNodeLocalLoadBalancingArgs() 25 | { 26 | } 27 | public static new K0sNodeLocalLoadBalancingArgs Empty => new K0sNodeLocalLoadBalancingArgs(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sNodeLocalLoadBalancing.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sNodeLocalLoadBalancing 15 | { 16 | public readonly bool? Enabled; 17 | public readonly Outputs.K0sEnvoyProxy? EnvoyProxy; 18 | public readonly string? Type; 19 | 20 | [OutputConstructor] 21 | private K0sNodeLocalLoadBalancing( 22 | bool? enabled, 23 | 24 | Outputs.K0sEnvoyProxy? envoyProxy, 25 | 26 | string? type) 27 | { 28 | Enabled = enabled; 29 | EnvoyProxy = envoyProxy; 30 | Type = type; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/cluster_test.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | import ( 4 | "testing" 5 | 6 | p "github.com/pulumi/pulumi-go-provider" 7 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 8 | "github.com/stretchr/testify/assert" 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestClusterCreatePreview(t *testing.T) { 13 | prov := integrationServer() 14 | name := "test-cluster" 15 | validPropertyKeys := []resource.PropertyKey{"apiVersion", "kind", "metadata", "spec", "kubeconfig"} 16 | 17 | response, err := prov.Create(p.CreateRequest{ 18 | Urn: urn("Cluster", name), 19 | Properties: resource.PropertyMap{}, 20 | Preview: true, 21 | }) 22 | require.NoError(t, err) 23 | assert.Equal(t, name, response.ID) 24 | 25 | for k := range response.Properties { 26 | found := false 27 | 28 | for _, pKey := range validPropertyKeys { 29 | if k == pKey { 30 | found = true 31 | } 32 | } 33 | 34 | if !found { 35 | t.Errorf("unexpected property key: %s", k) 36 | t.Fail() 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterK0sArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterK0sArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("config")] 16 | public Input? Config { get; set; } 17 | 18 | [Input("dynamicConfig")] 19 | public Input? DynamicConfig { get; set; } 20 | 21 | [Input("version")] 22 | public Input? Version { get; set; } 23 | 24 | [Input("versionChannel")] 25 | public Input? VersionChannel { get; set; } 26 | 27 | public ClusterK0sArgs() 28 | { 29 | } 30 | public static new ClusterK0sArgs Empty => new ClusterK0sArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by pulumi-language-python. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | from . import _utilities 6 | import typing 7 | # Export this package's modules as members: 8 | from .cluster import * 9 | from .provider import * 10 | from ._inputs import * 11 | from . import outputs 12 | 13 | # Make subpackages available: 14 | if typing.TYPE_CHECKING: 15 | import pulumi_k0s.config as __config 16 | config = __config 17 | else: 18 | config = _utilities.lazy_import('pulumi_k0s.config') 19 | 20 | _utilities.register( 21 | resource_modules=""" 22 | [ 23 | { 24 | "pkg": "k0s", 25 | "mod": "index", 26 | "fqn": "pulumi_k0s", 27 | "classes": { 28 | "k0s:index:Cluster": "Cluster" 29 | } 30 | } 31 | ] 32 | """, 33 | resource_packages=""" 34 | [ 35 | { 36 | "pkg": "k0s", 37 | "token": "pulumi:providers:k0s", 38 | "fqn": "pulumi_k0s", 39 | "class": "Provider" 40 | } 41 | ] 42 | """ 43 | ) 44 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sWorkerProfileArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sWorkerProfileArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("name", required: true)] 16 | public Input Name { get; set; } = null!; 17 | 18 | [Input("values", required: true)] 19 | private InputMap? _values; 20 | public InputMap Values 21 | { 22 | get => _values ?? (_values = new InputMap()); 23 | set => _values = value; 24 | } 25 | 26 | public K0sWorkerProfileArgs() 27 | { 28 | } 29 | public static new K0sWorkerProfileArgs Empty => new K0sWorkerProfileArgs(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKineArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKineArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("dataSource", required: true)] 16 | private Input? _dataSource; 17 | public Input? DataSource 18 | { 19 | get => _dataSource; 20 | set 21 | { 22 | var emptySecret = Output.CreateSecret(0); 23 | _dataSource = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 24 | } 25 | } 26 | 27 | public K0sKineArgs() 28 | { 29 | } 30 | public static new K0sKineArgs Empty => new K0sKineArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterSpecArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterSpecArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("hosts", required: true)] 16 | private InputList? _hosts; 17 | public InputList Hosts 18 | { 19 | get => _hosts ?? (_hosts = new InputList()); 20 | set => _hosts = value; 21 | } 22 | 23 | [Input("k0s")] 24 | public Input? K0s { get; set; } 25 | 26 | public ClusterSpecArgs() 27 | { 28 | } 29 | public static new ClusterSpecArgs Empty => new ClusterSpecArgs(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0s.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0s 15 | { 16 | public readonly string? ApiVersion; 17 | public readonly string? Kind; 18 | public readonly Outputs.K0sMetadata? Metadata; 19 | public readonly Outputs.K0sSpec? Spec; 20 | 21 | [OutputConstructor] 22 | private K0s( 23 | string? apiVersion, 24 | 25 | string? kind, 26 | 27 | Outputs.K0sMetadata? metadata, 28 | 29 | Outputs.K0sSpec? spec) 30 | { 31 | ApiVersion = apiVersion; 32 | Kind = kind; 33 | Metadata = metadata; 34 | Spec = spec; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sEtcd.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sEtcd 15 | { 16 | public readonly Outputs.K0sEtcdExternalCluster? ExternalCluster; 17 | public readonly ImmutableDictionary? ExtraArgs; 18 | public readonly string? PeerAddress; 19 | 20 | [OutputConstructor] 21 | private K0sEtcd( 22 | Outputs.K0sEtcdExternalCluster? externalCluster, 23 | 24 | ImmutableDictionary? extraArgs, 25 | 26 | string? peerAddress) 27 | { 28 | ExternalCluster = externalCluster; 29 | ExtraArgs = extraArgs; 30 | PeerAddress = peerAddress; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sCalicoImageArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sCalicoImageArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("cni")] 16 | public Input? Cni { get; set; } 17 | 18 | [Input("flexvolume")] 19 | public Input? Flexvolume { get; set; } 20 | 21 | [Input("kubecontrollers")] 22 | public Input? Kubecontrollers { get; set; } 23 | 24 | [Input("node")] 25 | public Input? Node { get; set; } 26 | 27 | public K0sCalicoImageArgs() 28 | { 29 | } 30 | public static new K0sCalicoImageArgs Empty => new K0sCalicoImageArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sEnvoyProxyArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sEnvoyProxyArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("apiServerBindPort")] 16 | public Input? ApiServerBindPort { get; set; } 17 | 18 | [Input("image")] 19 | public Input? Image { get; set; } 20 | 21 | [Input("imagePullPolicy")] 22 | public Input? ImagePullPolicy { get; set; } 23 | 24 | [Input("konnectivityServerBindPort")] 25 | public Input? KonnectivityServerBindPort { get; set; } 26 | 27 | public K0sEnvoyProxyArgs() 28 | { 29 | } 30 | public static new K0sEnvoyProxyArgs Empty => new K0sEnvoyProxyArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKubeProxyIPTablesArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKubeProxyIPTablesArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("masqueradeAll")] 16 | public Input? MasqueradeAll { get; set; } 17 | 18 | [Input("masqueradeBit")] 19 | public Input? MasqueradeBit { get; set; } 20 | 21 | [Input("minSyncPeriod")] 22 | public Input? MinSyncPeriod { get; set; } 23 | 24 | [Input("syncPeriod")] 25 | public Input? SyncPeriod { get; set; } 26 | 27 | public K0sKubeProxyIPTablesArgs() 28 | { 29 | } 30 | public static new K0sKubeProxyIPTablesArgs Empty => new K0sKubeProxyIPTablesArgs(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/config/__init__.pyi: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by pulumi-language-python. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import copy 6 | import warnings 7 | import sys 8 | import pulumi 9 | import pulumi.runtime 10 | from typing import Any, Mapping, Optional, Sequence, Union, overload 11 | if sys.version_info >= (3, 11): 12 | from typing import NotRequired, TypedDict, TypeAlias 13 | else: 14 | from typing_extensions import NotRequired, TypedDict, TypeAlias 15 | from .. import _utilities 16 | 17 | concurrency: int 18 | """ 19 | Maximum number of hosts to configure in parallel, set to 0 for unlimited 20 | """ 21 | 22 | concurrentUploads: int 23 | """ 24 | Maximum number of files to upload in parallel, set to 0 for unlimited 25 | """ 26 | 27 | noDrain: bool 28 | """ 29 | Do not drain worker nodes when upgrading 30 | """ 31 | 32 | noWait: bool 33 | """ 34 | Do not wait for worker nodes to join 35 | """ 36 | 37 | skipDowngradeCheck: bool 38 | """ 39 | Skip downgrade check 40 | """ 41 | 42 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterK0s.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterK0s 15 | { 16 | public readonly Outputs.K0s? Config; 17 | public readonly bool? DynamicConfig; 18 | public readonly string? Version; 19 | public readonly string? VersionChannel; 20 | 21 | [OutputConstructor] 22 | private ClusterK0s( 23 | Outputs.K0s? config, 24 | 25 | bool? dynamicConfig, 26 | 27 | string? version, 28 | 29 | string? versionChannel) 30 | { 31 | Config = config; 32 | DynamicConfig = dynamicConfig; 33 | Version = version; 34 | VersionChannel = versionChannel; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /examples/dotnet/Program.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Pulumi; 4 | using K0s = Pulumi.K0s; 5 | 6 | return await Deployment.RunAsync(() => 7 | { 8 | var myProvider = new K0s.Provider("myProvider", new() 9 | { 10 | NoDrain = true, 11 | }); 12 | 13 | var myCluster = new K0s.Cluster("myCluster", new() 14 | { 15 | Spec = new K0s.Inputs.ClusterSpecArgs 16 | { 17 | Hosts = new[] 18 | { 19 | new K0s.Inputs.ClusterHostArgs 20 | { 21 | Role = "controller+worker", 22 | Localhost = new K0s.Inputs.ClusterLocalhostArgs 23 | { 24 | Enabled = true, 25 | }, 26 | }, 27 | }, 28 | }, 29 | }, new CustomResourceOptions 30 | { 31 | Provider = myProvider, 32 | }); 33 | 34 | return new Dictionary 35 | { 36 | ["output"] = 37 | { 38 | { "value", myCluster.Kubeconfig }, 39 | }, 40 | }; 41 | }); 42 | 43 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sEtcdArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sEtcdArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("externalCluster")] 16 | public Input? ExternalCluster { get; set; } 17 | 18 | [Input("extraArgs")] 19 | private InputMap? _extraArgs; 20 | public InputMap ExtraArgs 21 | { 22 | get => _extraArgs ?? (_extraArgs = new InputMap()); 23 | set => _extraArgs = value; 24 | } 25 | 26 | [Input("peerAddress")] 27 | public Input? PeerAddress { get; set; } 28 | 29 | public K0sEtcdArgs() 30 | { 31 | } 32 | public static new K0sEtcdArgs Empty => new K0sEtcdArgs(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sFeatureGateArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sFeatureGateArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("components")] 16 | private InputList? _components; 17 | public InputList Components 18 | { 19 | get => _components ?? (_components = new InputList()); 20 | set => _components = value; 21 | } 22 | 23 | [Input("enabled")] 24 | public Input? Enabled { get; set; } 25 | 26 | [Input("name", required: true)] 27 | public Input Name { get; set; } = null!; 28 | 29 | public K0sFeatureGateArgs() 30 | { 31 | } 32 | public static new K0sFeatureGateArgs Empty => new K0sFeatureGateArgs(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKubeProxyIPTables.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKubeProxyIPTables 15 | { 16 | public readonly bool? MasqueradeAll; 17 | public readonly int? MasqueradeBit; 18 | public readonly string? MinSyncPeriod; 19 | public readonly string? SyncPeriod; 20 | 21 | [OutputConstructor] 22 | private K0sKubeProxyIPTables( 23 | bool? masqueradeAll, 24 | 25 | int? masqueradeBit, 26 | 27 | string? minSyncPeriod, 28 | 29 | string? syncPeriod) 30 | { 31 | MasqueradeAll = masqueradeAll; 32 | MasqueradeBit = masqueradeBit; 33 | MinSyncPeriod = minSyncPeriod; 34 | SyncPeriod = syncPeriod; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sCalicoImage.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sCalicoImage 15 | { 16 | public readonly Outputs.K0sImage? Cni; 17 | public readonly Outputs.K0sImage? Flexvolume; 18 | public readonly Outputs.K0sImage? Kubecontrollers; 19 | public readonly Outputs.K0sImage? Node; 20 | 21 | [OutputConstructor] 22 | private K0sCalicoImage( 23 | Outputs.K0sImage? cni, 24 | 25 | Outputs.K0sImage? flexvolume, 26 | 27 | Outputs.K0sImage? kubecontrollers, 28 | 29 | Outputs.K0sImage? node) 30 | { 31 | Cni = cni; 32 | Flexvolume = flexvolume; 33 | Kubecontrollers = kubecontrollers; 34 | Node = node; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKubeProxyArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKubeProxyArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("disabled")] 16 | public Input? Disabled { get; set; } 17 | 18 | [Input("iptables")] 19 | public Input? Iptables { get; set; } 20 | 21 | [Input("ipvs")] 22 | public Input? Ipvs { get; set; } 23 | 24 | [Input("mode")] 25 | public Input? Mode { get; set; } 26 | 27 | [Input("nodePortAddresses")] 28 | public Input? NodePortAddresses { get; set; } 29 | 30 | public K0sKubeProxyArgs() 31 | { 32 | } 33 | public static new K0sKubeProxyArgs Empty => new K0sKubeProxyArgs(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterHookArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterHookArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("after")] 16 | private InputList? _after; 17 | public InputList After 18 | { 19 | get => _after ?? (_after = new InputList()); 20 | set => _after = value; 21 | } 22 | 23 | [Input("before")] 24 | private InputList? _before; 25 | public InputList Before 26 | { 27 | get => _before ?? (_before = new InputList()); 28 | set => _before = value; 29 | } 30 | 31 | public ClusterHookArgs() 32 | { 33 | } 34 | public static new ClusterHookArgs Empty => new ClusterHookArgs(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sEnvoyProxy.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sEnvoyProxy 15 | { 16 | public readonly int? ApiServerBindPort; 17 | public readonly string? Image; 18 | public readonly string? ImagePullPolicy; 19 | public readonly int? KonnectivityServerBindPort; 20 | 21 | [OutputConstructor] 22 | private K0sEnvoyProxy( 23 | int? apiServerBindPort, 24 | 25 | string? image, 26 | 27 | string? imagePullPolicy, 28 | 29 | int? konnectivityServerBindPort) 30 | { 31 | ApiServerBindPort = apiServerBindPort; 32 | Image = image; 33 | ImagePullPolicy = imagePullPolicy; 34 | KonnectivityServerBindPort = konnectivityServerBindPort; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sInstallConfigUserArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sInstallConfigUserArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("etcdUser")] 16 | public Input? EtcdUser { get; set; } 17 | 18 | [Input("kineUser")] 19 | public Input? KineUser { get; set; } 20 | 21 | [Input("konnectivityUser")] 22 | public Input? KonnectivityUser { get; set; } 23 | 24 | [Input("kubeAPIserverUser")] 25 | public Input? KubeAPIserverUser { get; set; } 26 | 27 | [Input("kubeSchedulerUser")] 28 | public Input? KubeSchedulerUser { get; set; } 29 | 30 | public K0sInstallConfigUserArgs() 31 | { 32 | } 33 | public static new K0sInstallConfigUserArgs Empty => new K0sInstallConfigUserArgs(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sEtcdExternalCluster.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sEtcdExternalCluster 15 | { 16 | public readonly string? Ca; 17 | public readonly string? ClientCert; 18 | public readonly string? ClientKey; 19 | public readonly ImmutableArray Endpoints; 20 | public readonly string? EtcdPrefix; 21 | 22 | [OutputConstructor] 23 | private K0sEtcdExternalCluster( 24 | string? ca, 25 | 26 | string? clientCert, 27 | 28 | string? clientKey, 29 | 30 | ImmutableArray endpoints, 31 | 32 | string? etcdPrefix) 33 | { 34 | Ca = ca; 35 | ClientCert = clientCert; 36 | ClientKey = clientKey; 37 | Endpoints = endpoints; 38 | EtcdPrefix = etcdPrefix; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterSSH.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterSSH 15 | { 16 | public readonly string Address; 17 | public readonly Outputs.ClusterSSH? Bastion; 18 | public readonly string? HostKey; 19 | public readonly string? Key; 20 | public readonly int? Port; 21 | public readonly string? User; 22 | 23 | [OutputConstructor] 24 | private ClusterSSH( 25 | string address, 26 | 27 | Outputs.ClusterSSH? bastion, 28 | 29 | string? hostKey, 30 | 31 | string? key, 32 | 33 | int? port, 34 | 35 | string? user) 36 | { 37 | Address = address; 38 | Bastion = bastion; 39 | HostKey = hostKey; 40 | Key = key; 41 | Port = port; 42 | User = user; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKubeProxy.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKubeProxy 15 | { 16 | public readonly bool? Disabled; 17 | public readonly Outputs.K0sKubeProxyIPTables? Iptables; 18 | public readonly Outputs.K0sKubeProxyIPVS? Ipvs; 19 | public readonly string? Mode; 20 | public readonly string? NodePortAddresses; 21 | 22 | [OutputConstructor] 23 | private K0sKubeProxy( 24 | bool? disabled, 25 | 26 | Outputs.K0sKubeProxyIPTables? iptables, 27 | 28 | Outputs.K0sKubeProxyIPVS? ipvs, 29 | 30 | string? mode, 31 | 32 | string? nodePortAddresses) 33 | { 34 | Disabled = disabled; 35 | Iptables = iptables; 36 | Ipvs = ipvs; 37 | Mode = mode; 38 | NodePortAddresses = nodePortAddresses; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sInstallConfigUser.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sInstallConfigUser 15 | { 16 | public readonly string? EtcdUser; 17 | public readonly string? KineUser; 18 | public readonly string? KonnectivityUser; 19 | public readonly string? KubeAPIserverUser; 20 | public readonly string? KubeSchedulerUser; 21 | 22 | [OutputConstructor] 23 | private K0sInstallConfigUser( 24 | string? etcdUser, 25 | 26 | string? kineUser, 27 | 28 | string? konnectivityUser, 29 | 30 | string? kubeAPIserverUser, 31 | 32 | string? kubeSchedulerUser) 33 | { 34 | EtcdUser = etcdUser; 35 | KineUser = kineUser; 36 | KonnectivityUser = konnectivityUser; 37 | KubeAPIserverUser = kubeAPIserverUser; 38 | KubeSchedulerUser = kubeSchedulerUser; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKubeRouter.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKubeRouter 15 | { 16 | public readonly bool? AutoMTU; 17 | public readonly ImmutableDictionary? ExtraArgs; 18 | public readonly string? Hairpin; 19 | public readonly bool? IpMasq; 20 | public readonly int? MetricsPort; 21 | public readonly int? Mtu; 22 | 23 | [OutputConstructor] 24 | private K0sKubeRouter( 25 | bool? autoMTU, 26 | 27 | ImmutableDictionary? extraArgs, 28 | 29 | string? hairpin, 30 | 31 | bool? ipMasq, 32 | 33 | int? metricsPort, 34 | 35 | int? mtu) 36 | { 37 | AutoMTU = autoMTU; 38 | ExtraArgs = extraArgs; 39 | Hairpin = hairpin; 40 | IpMasq = ipMasq; 41 | MetricsPort = metricsPort; 42 | Mtu = mtu; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterFileArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterFileArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("dirPerm")] 16 | public Input? DirPerm { get; set; } 17 | 18 | [Input("dst")] 19 | public Input? Dst { get; set; } 20 | 21 | [Input("dstDir")] 22 | public Input? DstDir { get; set; } 23 | 24 | [Input("group")] 25 | public Input? Group { get; set; } 26 | 27 | [Input("name")] 28 | public Input? Name { get; set; } 29 | 30 | [Input("perm")] 31 | public Input? Perm { get; set; } 32 | 33 | [Input("src")] 34 | public Input? Src { get; set; } 35 | 36 | [Input("user")] 37 | public Input? User { get; set; } 38 | 39 | public ClusterFileArgs() 40 | { 41 | } 42 | public static new ClusterFileArgs Empty => new ClusterFileArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sAPI.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sAPI 15 | { 16 | public readonly string? Address; 17 | public readonly string? ExternalAddress; 18 | public readonly ImmutableDictionary? ExtraArgs; 19 | public readonly int? K0sApiPort; 20 | public readonly int? Port; 21 | public readonly ImmutableArray Sans; 22 | 23 | [OutputConstructor] 24 | private K0sAPI( 25 | string? address, 26 | 27 | string? externalAddress, 28 | 29 | ImmutableDictionary? extraArgs, 30 | 31 | int? k0sApiPort, 32 | 33 | int? port, 34 | 35 | ImmutableArray sans) 36 | { 37 | Address = address; 38 | ExternalAddress = externalAddress; 39 | ExtraArgs = extraArgs; 40 | K0sApiPort = k0sApiPort; 41 | Port = port; 42 | Sans = sans; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKubeRouterArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKubeRouterArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("autoMTU")] 16 | public Input? AutoMTU { get; set; } 17 | 18 | [Input("extraArgs")] 19 | private InputMap? _extraArgs; 20 | public InputMap ExtraArgs 21 | { 22 | get => _extraArgs ?? (_extraArgs = new InputMap()); 23 | set => _extraArgs = value; 24 | } 25 | 26 | [Input("hairpin")] 27 | public Input? Hairpin { get; set; } 28 | 29 | [Input("ipMasq")] 30 | public Input? IpMasq { get; set; } 31 | 32 | [Input("metricsPort")] 33 | public Input? MetricsPort { get; set; } 34 | 35 | [Input("mtu")] 36 | public Input? Mtu { get; set; } 37 | 38 | public K0sKubeRouterArgs() 39 | { 40 | } 41 | public static new K0sKubeRouterArgs Empty => new K0sKubeRouterArgs(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterFile.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterFile 15 | { 16 | public readonly string? DirPerm; 17 | public readonly string? Dst; 18 | public readonly string? DstDir; 19 | public readonly string? Group; 20 | public readonly string? Name; 21 | public readonly string? Perm; 22 | public readonly string? Src; 23 | public readonly string? User; 24 | 25 | [OutputConstructor] 26 | private ClusterFile( 27 | string? dirPerm, 28 | 29 | string? dst, 30 | 31 | string? dstDir, 32 | 33 | string? group, 34 | 35 | string? name, 36 | 37 | string? perm, 38 | 39 | string? src, 40 | 41 | string? user) 42 | { 43 | DirPerm = dirPerm; 44 | Dst = dst; 45 | DstDir = dstDir; 46 | Group = group; 47 | Name = name; 48 | Perm = perm; 49 | Src = src; 50 | User = user; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sKubeProxyIPVSArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sKubeProxyIPVSArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("excludeCIDRs")] 16 | public Input? ExcludeCIDRs { get; set; } 17 | 18 | [Input("minSyncPeriod")] 19 | public Input? MinSyncPeriod { get; set; } 20 | 21 | [Input("scheduler")] 22 | public Input? Scheduler { get; set; } 23 | 24 | [Input("strictARP")] 25 | public Input? StrictARP { get; set; } 26 | 27 | [Input("syncPeriod")] 28 | public Input? SyncPeriod { get; set; } 29 | 30 | [Input("tcpFinTimeout")] 31 | public Input? TcpFinTimeout { get; set; } 32 | 33 | [Input("tcpTimeout")] 34 | public Input? TcpTimeout { get; set; } 35 | 36 | [Input("udpTimeout")] 37 | public Input? UdpTimeout { get; set; } 38 | 39 | public K0sKubeProxyIPVSArgs() 40 | { 41 | } 42 | public static new K0sKubeProxyIPVSArgs Empty => new K0sKubeProxyIPVSArgs(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterOpenSSH.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterOpenSSH 15 | { 16 | public readonly string Address; 17 | public readonly string? ConfigPath; 18 | public readonly bool? DisableMultiplexing; 19 | public readonly string? Key; 20 | public readonly ImmutableDictionary? Options; 21 | public readonly int? Port; 22 | public readonly string? User; 23 | 24 | [OutputConstructor] 25 | private ClusterOpenSSH( 26 | string address, 27 | 28 | string? configPath, 29 | 30 | bool? disableMultiplexing, 31 | 32 | string? key, 33 | 34 | ImmutableDictionary? options, 35 | 36 | int? port, 37 | 38 | string? user) 39 | { 40 | Address = address; 41 | ConfigPath = configPath; 42 | DisableMultiplexing = disableMultiplexing; 43 | Key = key; 44 | Options = options; 45 | Port = port; 46 | User = user; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/makefile.yaml: -------------------------------------------------------------------------------- 1 | name: Makefile 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - main 8 | pull_request: 9 | branches: 10 | - main 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | container: 16 | image: docker://ghcr.io/pulumi/devcontainer:base 17 | options: --user root 18 | permissions: 19 | contents: read 20 | packages: read 21 | actions: read 22 | steps: 23 | - name: Checkout repository 24 | uses: actions/checkout@v4 25 | id: git 26 | with: 27 | submodules: "recursive" 28 | - name: Unshallow clone for tags 29 | id: tags 30 | run: | 31 | sudo chown -R $(whoami) /__w/pulumi-k0s/pulumi-k0s 32 | git config --global --add safe.directory /__w/pulumi-k0s/pulumi-k0s 33 | git fetch --prune --unshallow --tags 34 | - name: Build 35 | id: build 36 | run: | 37 | make build 38 | - name: Install 39 | id: install 40 | run: | 41 | set -ex 42 | make install 43 | # - name: PulumiUp 44 | # id: up 45 | # run: | 46 | # make up 47 | # - name: PulumiDown 48 | # id: down 49 | # run: | 50 | # make down 51 | - name: Generate multi-language examples from yaml IaC program 52 | id: examples 53 | run: | 54 | set -ex 55 | make gen_examples 56 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterSSHArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterSSHArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("address", required: true)] 16 | public Input Address { get; set; } = null!; 17 | 18 | [Input("bastion")] 19 | public Input? Bastion { get; set; } 20 | 21 | [Input("hostKey")] 22 | public Input? HostKey { get; set; } 23 | 24 | [Input("key")] 25 | private Input? _key; 26 | public Input? Key 27 | { 28 | get => _key; 29 | set 30 | { 31 | var emptySecret = Output.CreateSecret(0); 32 | _key = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 33 | } 34 | } 35 | 36 | [Input("port")] 37 | public Input? Port { get; set; } 38 | 39 | [Input("user")] 40 | public Input? User { get; set; } 41 | 42 | public ClusterSSHArgs() 43 | { 44 | } 45 | public static new ClusterSSHArgs Empty => new ClusterSSHArgs(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sAPIArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sAPIArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("address")] 16 | public Input? Address { get; set; } 17 | 18 | [Input("externalAddress")] 19 | public Input? ExternalAddress { get; set; } 20 | 21 | [Input("extraArgs")] 22 | private InputMap? _extraArgs; 23 | public InputMap ExtraArgs 24 | { 25 | get => _extraArgs ?? (_extraArgs = new InputMap()); 26 | set => _extraArgs = value; 27 | } 28 | 29 | [Input("k0sApiPort")] 30 | public Input? K0sApiPort { get; set; } 31 | 32 | [Input("port")] 33 | public Input? Port { get; set; } 34 | 35 | [Input("sans")] 36 | private InputList? _sans; 37 | public InputList Sans 38 | { 39 | get => _sans ?? (_sans = new InputList()); 40 | set => _sans = value; 41 | } 42 | 43 | public K0sAPIArgs() 44 | { 45 | } 46 | public static new K0sAPIArgs Empty => new K0sAPIArgs(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /provider/provider.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/k0sproject/rig" 7 | p "github.com/pulumi/pulumi-go-provider" 8 | "github.com/pulumi/pulumi-go-provider/infer" 9 | "github.com/pulumi/pulumi-go-provider/middleware/schema" 10 | "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" 11 | "github.com/sirupsen/logrus" 12 | ) 13 | 14 | // Version is initialized by the Go linker to contain the semver of this build. 15 | var Version string 16 | 17 | const Name string = "k0s" 18 | 19 | func Provider() p.Provider { 20 | // Disable output of k0sctl 21 | logrus.SetOutput(io.Discard) 22 | rig.SetLogger(logrus.StandardLogger()) 23 | 24 | return infer.Provider(infer.Options{ 25 | Config: infer.Config[Config](), 26 | Resources: []infer.InferredResource{ 27 | infer.Resource[Cluster, ClusterInputs, ClusterOutputs](), 28 | }, 29 | ModuleMap: map[tokens.ModuleName]tokens.ModuleName{ 30 | "provider": "index", 31 | }, 32 | Metadata: schema.Metadata{ 33 | DisplayName: "k0s", 34 | Description: "A Pulumi package for creating and managing k0s clusters.", 35 | Keywords: []string{"pulumi", "kubernetes", "k0s"}, 36 | Homepage: "https://github.com/ydkn/pulumi-k0s", 37 | Repository: "https://github.com/ydkn/pulumi-k0s", 38 | Publisher: "Florian Schwab", 39 | LogoURL: "https://k0sproject.io/images/k0s-logo.png", 40 | License: "Apache-2.0", 41 | PluginDownloadURL: "https://repo.ydkn.io/pulumi-k0s", 42 | }, 43 | }) 44 | } 45 | -------------------------------------------------------------------------------- /sdk/python/setup.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by pulumi-language-python. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import errno 6 | from setuptools import setup, find_packages 7 | from setuptools.command.install import install 8 | from subprocess import check_call 9 | 10 | 11 | VERSION = "0.0.0" 12 | def readme(): 13 | try: 14 | with open('README.md', encoding='utf-8') as f: 15 | return f.read() 16 | except FileNotFoundError: 17 | return "k0s Pulumi Package - Development Version" 18 | 19 | 20 | setup(name='pulumi_k0s', 21 | python_requires='>=3.8', 22 | version=VERSION, 23 | description="A Pulumi package for creating and managing k0s clusters.", 24 | long_description=readme(), 25 | long_description_content_type='text/markdown', 26 | keywords='pulumi kubernetes k0s', 27 | url='https://github.com/ydkn/pulumi-k0s', 28 | project_urls={ 29 | 'Repository': 'https://github.com/ydkn/pulumi-k0s' 30 | }, 31 | license='Apache-2.0', 32 | packages=find_packages(), 33 | package_data={ 34 | 'pulumi_k0s': [ 35 | 'py.typed', 36 | 'pulumi-plugin.json', 37 | ] 38 | }, 39 | install_requires=[ 40 | 'parver>=0.2.1', 41 | 'pulumi>=3.136.0,<4.0.0', 42 | 'semver>=2.8.1', 43 | 'typing-extensions>=4.11,<5; python_version < "3.11"' 44 | ], 45 | zip_safe=False) 46 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sImagesArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sImagesArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("calico")] 16 | public Input? Calico { get; set; } 17 | 18 | [Input("coredns")] 19 | public Input? Coredns { get; set; } 20 | 21 | [Input("default_pull_policy")] 22 | public Input? Default_pull_policy { get; set; } 23 | 24 | [Input("konnectivity")] 25 | public Input? Konnectivity { get; set; } 26 | 27 | [Input("kubeproxy")] 28 | public Input? Kubeproxy { get; set; } 29 | 30 | [Input("kuberouter")] 31 | public Input? Kuberouter { get; set; } 32 | 33 | [Input("metricsserver")] 34 | public Input? Metricsserver { get; set; } 35 | 36 | [Input("pause")] 37 | public Input? Pause { get; set; } 38 | 39 | [Input("repository")] 40 | public Input? Repository { get; set; } 41 | 42 | public K0sImagesArgs() 43 | { 44 | } 45 | public static new K0sImagesArgs Empty => new K0sImagesArgs(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sNetworkArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sNetworkArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("calico")] 16 | public Input? Calico { get; set; } 17 | 18 | [Input("clusterDomain")] 19 | public Input? ClusterDomain { get; set; } 20 | 21 | [Input("dualStack")] 22 | public Input? DualStack { get; set; } 23 | 24 | [Input("kubeProxy")] 25 | public Input? KubeProxy { get; set; } 26 | 27 | [Input("kuberouter")] 28 | public Input? Kuberouter { get; set; } 29 | 30 | [Input("nodeLocalLoadBalancing")] 31 | public Input? NodeLocalLoadBalancing { get; set; } 32 | 33 | [Input("podCIDR")] 34 | public Input? PodCIDR { get; set; } 35 | 36 | [Input("provider")] 37 | public Input? Provider { get; set; } 38 | 39 | [Input("serviceCIDR")] 40 | public Input? ServiceCIDR { get; set; } 41 | 42 | public K0sNetworkArgs() 43 | { 44 | } 45 | public static new K0sNetworkArgs Empty => new K0sNetworkArgs(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sKubeProxyIPVS.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sKubeProxyIPVS 15 | { 16 | public readonly string? ExcludeCIDRs; 17 | public readonly string? MinSyncPeriod; 18 | public readonly string? Scheduler; 19 | public readonly bool? StrictARP; 20 | public readonly string? SyncPeriod; 21 | public readonly string? TcpFinTimeout; 22 | public readonly string? TcpTimeout; 23 | public readonly string? UdpTimeout; 24 | 25 | [OutputConstructor] 26 | private K0sKubeProxyIPVS( 27 | string? excludeCIDRs, 28 | 29 | string? minSyncPeriod, 30 | 31 | string? scheduler, 32 | 33 | bool? strictARP, 34 | 35 | string? syncPeriod, 36 | 37 | string? tcpFinTimeout, 38 | 39 | string? tcpTimeout, 40 | 41 | string? udpTimeout) 42 | { 43 | ExcludeCIDRs = excludeCIDRs; 44 | MinSyncPeriod = minSyncPeriod; 45 | Scheduler = scheduler; 46 | StrictARP = strictARP; 47 | SyncPeriod = syncPeriod; 48 | TcpFinTimeout = tcpFinTimeout; 49 | TcpTimeout = tcpTimeout; 50 | UdpTimeout = udpTimeout; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sCalicoArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sCalicoArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("envVars")] 16 | private InputMap? _envVars; 17 | public InputMap EnvVars 18 | { 19 | get => _envVars ?? (_envVars = new InputMap()); 20 | set => _envVars = value; 21 | } 22 | 23 | [Input("flexVolumeDriverPath")] 24 | public Input? FlexVolumeDriverPath { get; set; } 25 | 26 | [Input("ipAutodetectionMethod")] 27 | public Input? IpAutodetectionMethod { get; set; } 28 | 29 | [Input("mode")] 30 | public Input? Mode { get; set; } 31 | 32 | [Input("mtu")] 33 | public Input? Mtu { get; set; } 34 | 35 | [Input("overlay")] 36 | public Input? Overlay { get; set; } 37 | 38 | [Input("vxlanPort")] 39 | public Input? VxlanPort { get; set; } 40 | 41 | [Input("vxlanVNI")] 42 | public Input? VxlanVNI { get; set; } 43 | 44 | [Input("wireguard")] 45 | public Input? Wireguard { get; set; } 46 | 47 | public K0sCalicoArgs() 48 | { 49 | } 50 | public static new K0sCalicoArgs Empty => new K0sCalicoArgs(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /sdk/go/k0s/init.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package k0s 5 | 6 | import ( 7 | "fmt" 8 | 9 | "github.com/blang/semver" 10 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 | "github.com/ydkn/pulumi-k0s/sdk/go/k0s/internal" 12 | ) 13 | 14 | type module struct { 15 | version semver.Version 16 | } 17 | 18 | func (m *module) Version() semver.Version { 19 | return m.version 20 | } 21 | 22 | func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { 23 | switch typ { 24 | case "k0s:index:Cluster": 25 | r = &Cluster{} 26 | default: 27 | return nil, fmt.Errorf("unknown resource type: %s", typ) 28 | } 29 | 30 | err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 31 | return 32 | } 33 | 34 | type pkg struct { 35 | version semver.Version 36 | } 37 | 38 | func (p *pkg) Version() semver.Version { 39 | return p.version 40 | } 41 | 42 | func (p *pkg) ConstructProvider(ctx *pulumi.Context, name, typ, urn string) (pulumi.ProviderResource, error) { 43 | if typ != "pulumi:providers:k0s" { 44 | return nil, fmt.Errorf("unknown provider type: %s", typ) 45 | } 46 | 47 | r := &Provider{} 48 | err := ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) 49 | return r, err 50 | } 51 | 52 | func init() { 53 | version, err := internal.PkgVersion() 54 | if err != nil { 55 | version = semver.Version{Major: 1} 56 | } 57 | pulumi.RegisterResourceModule( 58 | "k0s", 59 | "index", 60 | &module{version}, 61 | ) 62 | pulumi.RegisterResourcePackage( 63 | "k0s", 64 | &pkg{version}, 65 | ) 66 | } 67 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sCalico.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sCalico 15 | { 16 | public readonly ImmutableDictionary? EnvVars; 17 | public readonly string? FlexVolumeDriverPath; 18 | public readonly string? IpAutodetectionMethod; 19 | public readonly string? Mode; 20 | public readonly int? Mtu; 21 | public readonly string? Overlay; 22 | public readonly int? VxlanPort; 23 | public readonly int? VxlanVNI; 24 | public readonly bool? Wireguard; 25 | 26 | [OutputConstructor] 27 | private K0sCalico( 28 | ImmutableDictionary? envVars, 29 | 30 | string? flexVolumeDriverPath, 31 | 32 | string? ipAutodetectionMethod, 33 | 34 | string? mode, 35 | 36 | int? mtu, 37 | 38 | string? overlay, 39 | 40 | int? vxlanPort, 41 | 42 | int? vxlanVNI, 43 | 44 | bool? wireguard) 45 | { 46 | EnvVars = envVars; 47 | FlexVolumeDriverPath = flexVolumeDriverPath; 48 | IpAutodetectionMethod = ipAutodetectionMethod; 49 | Mode = mode; 50 | Mtu = mtu; 51 | Overlay = overlay; 52 | VxlanPort = vxlanPort; 53 | VxlanVNI = vxlanVNI; 54 | Wireguard = wireguard; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterOpenSSHArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterOpenSSHArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("address", required: true)] 16 | public Input Address { get; set; } = null!; 17 | 18 | [Input("configPath")] 19 | public Input? ConfigPath { get; set; } 20 | 21 | [Input("disableMultiplexing")] 22 | public Input? DisableMultiplexing { get; set; } 23 | 24 | [Input("key")] 25 | private Input? _key; 26 | public Input? Key 27 | { 28 | get => _key; 29 | set 30 | { 31 | var emptySecret = Output.CreateSecret(0); 32 | _key = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 33 | } 34 | } 35 | 36 | [Input("options")] 37 | private InputMap? _options; 38 | public InputMap Options 39 | { 40 | get => _options ?? (_options = new InputMap()); 41 | set => _options = value; 42 | } 43 | 44 | [Input("port")] 45 | public Input? Port { get; set; } 46 | 47 | [Input("user")] 48 | public Input? User { get; set; } 49 | 50 | public ClusterOpenSSHArgs() 51 | { 52 | } 53 | public static new ClusterOpenSSHArgs Empty => new ClusterOpenSSHArgs(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /sdk/nodejs/index.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "./utilities"; 6 | 7 | // Export members: 8 | export { ClusterArgs } from "./cluster"; 9 | export type Cluster = import("./cluster").Cluster; 10 | export const Cluster: typeof import("./cluster").Cluster = null as any; 11 | utilities.lazyLoad(exports, ["Cluster"], () => require("./cluster")); 12 | 13 | export { ProviderArgs } from "./provider"; 14 | export type Provider = import("./provider").Provider; 15 | export const Provider: typeof import("./provider").Provider = null as any; 16 | utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); 17 | 18 | 19 | // Export sub-modules: 20 | import * as config from "./config"; 21 | import * as types from "./types"; 22 | 23 | export { 24 | config, 25 | types, 26 | }; 27 | 28 | const _module = { 29 | version: utilities.getVersion(), 30 | construct: (name: string, type: string, urn: string): pulumi.Resource => { 31 | switch (type) { 32 | case "k0s:index:Cluster": 33 | return new Cluster(name, undefined, { urn }) 34 | default: 35 | throw new Error(`unknown resource type ${type}`); 36 | } 37 | }, 38 | }; 39 | pulumi.runtime.registerResourceModule("k0s", "index", _module) 40 | pulumi.runtime.registerResourcePackage("k0s", { 41 | version: utilities.getVersion(), 42 | constructProvider: (name: string, type: string, urn: string): pulumi.ProviderResource => { 43 | if (type !== "pulumi:providers:k0s") { 44 | throw new Error(`unknown provider type ${type}`); 45 | } 46 | return new Provider(name, undefined, { urn }); 47 | }, 48 | }); 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Actions Status](https://github.com/ydkn/pulumi-k0s/actions/workflows/makefile.yaml/badge.svg)](https://github.com/ydkn/pulumi-k0s/actions) 2 | [![NPM version](https://badge.fury.io/js/%40ydkn%2Fpulumi-k0s.svg)](https://www.npmjs.com/package/@ydkn/pulumi-k0s) 3 | [![Python version](https://badge.fury.io/py/pulumi-k0s.svg)](https://pypi.org/project/pulumi-k0s) 4 | [![NuGet version](https://badge.fury.io/nu/pulumi.k0s.svg)](https://badge.fury.io/nu/pulumi.k0s) 5 | [![PkgGoDev](https://pkg.go.dev/badge/github.com/ydkn/pulumi-k0s/sdk/go)](https://pkg.go.dev/github.com/ydkn/pulumi-k0s/sdk/go) 6 | 7 | # k0s Pulumi Provider 8 | 9 | Pulumi provider for [k0s](https://k0sproject.io) based on [k0sctl](https://github.com/k0sproject/k0sctl). 10 | 11 | ## Installing 12 | 13 | This package is available in many languages in the standard packaging formats. 14 | 15 | ### Node.js (Java/TypeScript) 16 | 17 | To use from JavaScript or TypeScript in Node.js, install using either `npm`: 18 | 19 | $ npm install @ydkn/pulumi-k0s 20 | 21 | or `yarn`: 22 | 23 | $ yarn add @ydkn/pulumi-k0s 24 | 25 | ### Python 26 | 27 | To use from Python, install using `pip`: 28 | 29 | $ pip install pulumi_k0s 30 | 31 | ### Go 32 | 33 | To use from Go, use `go get` to grab the latest version of the library 34 | 35 | $ go get github.com/ydkn/pulumi-k0s/sdk 36 | 37 | ### .NET 38 | 39 | To use from .NET, install using `dotnet add package`: 40 | 41 | $ dotnet add package Pulumi.K0s 42 | 43 | ## Configuration 44 | 45 | The following provider configuration options are available: 46 | 47 | - `skipDowngradeCheck` - Do not check if a downgrade would be performed. 48 | - `noDrain` - Do not drain nodes before upgrades/updates. 49 | 50 | ## Deploying 51 | 52 | 1. Push a tag to your repo in the format "v0.0.0" to initiate a release 53 | 54 | IMPORTANT: also add a tag in the format "sdk/v0.0.0" for the Go SDK 55 | -------------------------------------------------------------------------------- /sdk/dotnet/README.md: -------------------------------------------------------------------------------- 1 | [![Actions Status](https://github.com/ydkn/pulumi-k0s/actions/workflows/makefile.yaml/badge.svg)](https://github.com/ydkn/pulumi-k0s/actions) 2 | [![NPM version](https://badge.fury.io/js/%40ydkn%2Fpulumi-k0s.svg)](https://www.npmjs.com/package/@ydkn/pulumi-k0s) 3 | [![Python version](https://badge.fury.io/py/pulumi-k0s.svg)](https://pypi.org/project/pulumi-k0s) 4 | [![NuGet version](https://badge.fury.io/nu/pulumi.k0s.svg)](https://badge.fury.io/nu/pulumi.k0s) 5 | [![PkgGoDev](https://pkg.go.dev/badge/github.com/ydkn/pulumi-k0s/sdk/go)](https://pkg.go.dev/github.com/ydkn/pulumi-k0s/sdk/go) 6 | 7 | # k0s Pulumi Provider 8 | 9 | Pulumi provider for [k0s](https://k0sproject.io) based on [k0sctl](https://github.com/k0sproject/k0sctl). 10 | 11 | ## Installing 12 | 13 | This package is available in many languages in the standard packaging formats. 14 | 15 | ### Node.js (Java/TypeScript) 16 | 17 | To use from JavaScript or TypeScript in Node.js, install using either `npm`: 18 | 19 | $ npm install @ydkn/pulumi-k0s 20 | 21 | or `yarn`: 22 | 23 | $ yarn add @ydkn/pulumi-k0s 24 | 25 | ### Python 26 | 27 | To use from Python, install using `pip`: 28 | 29 | $ pip install pulumi_k0s 30 | 31 | ### Go 32 | 33 | To use from Go, use `go get` to grab the latest version of the library 34 | 35 | $ go get github.com/ydkn/pulumi-k0s/sdk 36 | 37 | ### .NET 38 | 39 | To use from .NET, install using `dotnet add package`: 40 | 41 | $ dotnet add package Pulumi.K0s 42 | 43 | ## Configuration 44 | 45 | The following provider configuration options are available: 46 | 47 | - `skipDowngradeCheck` - Do not check if a downgrade would be performed. 48 | - `noDrain` - Do not drain nodes before upgrades/updates. 49 | 50 | ## Deploying 51 | 52 | 1. Push a tag to your repo in the format "v0.0.0" to initiate a release 53 | 54 | IMPORTANT: also add a tag in the format "sdk/v0.0.0" for the Go SDK 55 | -------------------------------------------------------------------------------- /sdk/python/README.md: -------------------------------------------------------------------------------- 1 | [![Actions Status](https://github.com/ydkn/pulumi-k0s/actions/workflows/makefile.yaml/badge.svg)](https://github.com/ydkn/pulumi-k0s/actions) 2 | [![NPM version](https://badge.fury.io/js/%40ydkn%2Fpulumi-k0s.svg)](https://www.npmjs.com/package/@ydkn/pulumi-k0s) 3 | [![Python version](https://badge.fury.io/py/pulumi-k0s.svg)](https://pypi.org/project/pulumi-k0s) 4 | [![NuGet version](https://badge.fury.io/nu/pulumi.k0s.svg)](https://badge.fury.io/nu/pulumi.k0s) 5 | [![PkgGoDev](https://pkg.go.dev/badge/github.com/ydkn/pulumi-k0s/sdk/go)](https://pkg.go.dev/github.com/ydkn/pulumi-k0s/sdk/go) 6 | 7 | # k0s Pulumi Provider 8 | 9 | Pulumi provider for [k0s](https://k0sproject.io) based on [k0sctl](https://github.com/k0sproject/k0sctl). 10 | 11 | ## Installing 12 | 13 | This package is available in many languages in the standard packaging formats. 14 | 15 | ### Node.js (Java/TypeScript) 16 | 17 | To use from JavaScript or TypeScript in Node.js, install using either `npm`: 18 | 19 | $ npm install @ydkn/pulumi-k0s 20 | 21 | or `yarn`: 22 | 23 | $ yarn add @ydkn/pulumi-k0s 24 | 25 | ### Python 26 | 27 | To use from Python, install using `pip`: 28 | 29 | $ pip install pulumi_k0s 30 | 31 | ### Go 32 | 33 | To use from Go, use `go get` to grab the latest version of the library 34 | 35 | $ go get github.com/ydkn/pulumi-k0s/sdk 36 | 37 | ### .NET 38 | 39 | To use from .NET, install using `dotnet add package`: 40 | 41 | $ dotnet add package Pulumi.K0s 42 | 43 | ## Configuration 44 | 45 | The following provider configuration options are available: 46 | 47 | - `skipDowngradeCheck` - Do not check if a downgrade would be performed. 48 | - `noDrain` - Do not drain nodes before upgrades/updates. 49 | 50 | ## Deploying 51 | 52 | 1. Push a tag to your repo in the format "v0.0.0" to initiate a release 53 | 54 | IMPORTANT: also add a tag in the format "sdk/v0.0.0" for the Go SDK 55 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sImages.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sImages 15 | { 16 | public readonly Outputs.K0sCalicoImage? Calico; 17 | public readonly Outputs.K0sImage? Coredns; 18 | public readonly string? Default_pull_policy; 19 | public readonly Outputs.K0sImage? Konnectivity; 20 | public readonly Outputs.K0sImage? Kubeproxy; 21 | public readonly Outputs.K0sKubeRouterImage? Kuberouter; 22 | public readonly Outputs.K0sImage? Metricsserver; 23 | public readonly Outputs.K0sImage? Pause; 24 | public readonly string? Repository; 25 | 26 | [OutputConstructor] 27 | private K0sImages( 28 | Outputs.K0sCalicoImage? calico, 29 | 30 | Outputs.K0sImage? coredns, 31 | 32 | string? default_pull_policy, 33 | 34 | Outputs.K0sImage? konnectivity, 35 | 36 | Outputs.K0sImage? kubeproxy, 37 | 38 | Outputs.K0sKubeRouterImage? kuberouter, 39 | 40 | Outputs.K0sImage? metricsserver, 41 | 42 | Outputs.K0sImage? pause, 43 | 44 | string? repository) 45 | { 46 | Calico = calico; 47 | Coredns = coredns; 48 | Default_pull_policy = default_pull_policy; 49 | Konnectivity = konnectivity; 50 | Kubeproxy = kubeproxy; 51 | Kuberouter = kuberouter; 52 | Metricsserver = metricsserver; 53 | Pause = pause; 54 | Repository = repository; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sNetwork.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sNetwork 15 | { 16 | public readonly Outputs.K0sCalico? Calico; 17 | public readonly string? ClusterDomain; 18 | public readonly Outputs.K0sDualStack? DualStack; 19 | public readonly Outputs.K0sKubeProxy? KubeProxy; 20 | public readonly Outputs.K0sKubeRouter? Kuberouter; 21 | public readonly Outputs.K0sNodeLocalLoadBalancing? NodeLocalLoadBalancing; 22 | public readonly string? PodCIDR; 23 | public readonly string? Provider; 24 | public readonly string? ServiceCIDR; 25 | 26 | [OutputConstructor] 27 | private K0sNetwork( 28 | Outputs.K0sCalico? calico, 29 | 30 | string? clusterDomain, 31 | 32 | Outputs.K0sDualStack? dualStack, 33 | 34 | Outputs.K0sKubeProxy? kubeProxy, 35 | 36 | Outputs.K0sKubeRouter? kuberouter, 37 | 38 | Outputs.K0sNodeLocalLoadBalancing? nodeLocalLoadBalancing, 39 | 40 | string? podCIDR, 41 | 42 | string? provider, 43 | 44 | string? serviceCIDR) 45 | { 46 | Calico = calico; 47 | ClusterDomain = clusterDomain; 48 | DualStack = dualStack; 49 | KubeProxy = kubeProxy; 50 | Kuberouter = kuberouter; 51 | NodeLocalLoadBalancing = nodeLocalLoadBalancing; 52 | PodCIDR = podCIDR; 53 | Provider = provider; 54 | ServiceCIDR = serviceCIDR; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterWinRM.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterWinRM 15 | { 16 | public readonly string Address; 17 | public readonly Outputs.ClusterSSH? Bastion; 18 | public readonly string? CaCert; 19 | public readonly string? Cert; 20 | public readonly bool? Insecure; 21 | public readonly string? Key; 22 | public readonly string? Password; 23 | public readonly int? Port; 24 | public readonly string? TlsServerName; 25 | public readonly bool? UseHTTPS; 26 | public readonly bool? UseNTLM; 27 | public readonly string? User; 28 | 29 | [OutputConstructor] 30 | private ClusterWinRM( 31 | string address, 32 | 33 | Outputs.ClusterSSH? bastion, 34 | 35 | string? caCert, 36 | 37 | string? cert, 38 | 39 | bool? insecure, 40 | 41 | string? key, 42 | 43 | string? password, 44 | 45 | int? port, 46 | 47 | string? tlsServerName, 48 | 49 | bool? useHTTPS, 50 | 51 | bool? useNTLM, 52 | 53 | string? user) 54 | { 55 | Address = address; 56 | Bastion = bastion; 57 | CaCert = caCert; 58 | Cert = cert; 59 | Insecure = insecure; 60 | Key = key; 61 | Password = password; 62 | Port = port; 63 | TlsServerName = tlsServerName; 64 | UseHTTPS = useHTTPS; 65 | UseNTLM = useNTLM; 66 | User = user; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /provider/helpers.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "crypto/sha512" 5 | "fmt" 6 | "io/fs" 7 | "os" 8 | "path/filepath" 9 | "strings" 10 | 11 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 12 | ) 13 | 14 | func contentToTempFile(prefix, content string, ensureNewline bool) (string, error) { 15 | hash := sha512.New() 16 | 17 | _, err := hash.Write([]byte(content)) 18 | if err != nil { 19 | return "", err 20 | } 21 | 22 | hashString := fmt.Sprintf("%x", hash.Sum(nil)) 23 | 24 | filename := filepath.Join(os.TempDir(), fmt.Sprintf("pulumi-%s-%s-%s", Name, prefix, hashString)) 25 | 26 | fileContent := content 27 | if ensureNewline && !strings.HasSuffix(content, "\n") { 28 | fileContent += "\n" 29 | } 30 | 31 | if err := os.WriteFile(filename, []byte(fileContent), 0600); err != nil { 32 | return "", err 33 | } 34 | 35 | if err := os.Chmod(filename, 0o600); err != nil { 36 | return "", err 37 | } 38 | 39 | return filename, nil 40 | } 41 | 42 | func cleanupTempFiles(prefix string) error { 43 | return filepath.WalkDir(os.TempDir(), func(path string, d fs.DirEntry, err error) error { 44 | if d.IsDir() { 45 | return nil 46 | } 47 | 48 | if strings.HasPrefix(d.Name(), fmt.Sprintf("pulumi-%s-%s-", Name, prefix)) { 49 | if err := os.Remove(path); err != nil { 50 | return err 51 | } 52 | } 53 | 54 | return nil 55 | }) 56 | } 57 | 58 | func propertyMapDiff(a, b resource.PropertyMap, ignoreKeys []resource.PropertyKey) resource.PropertyMap { 59 | changedProperties := resource.PropertyMap{} 60 | 61 | ignoreKeysMap := map[resource.PropertyKey]bool{} 62 | for _, k := range ignoreKeys { 63 | ignoreKeysMap[k] = true 64 | } 65 | 66 | for k, v := range a { 67 | if _, ok := ignoreKeysMap[k]; ok { 68 | continue 69 | } 70 | 71 | if b[k] != v { 72 | changedProperties[k] = v 73 | } 74 | } 75 | 76 | for k, v := range b { 77 | if _, ok := ignoreKeysMap[k]; ok { 78 | continue 79 | } 80 | 81 | if a[k] != v { 82 | changedProperties[k] = a[k] 83 | } 84 | } 85 | 86 | return changedProperties 87 | } 88 | -------------------------------------------------------------------------------- /sdk/python/pulumi_k0s/config/vars.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # *** WARNING: this file was generated by pulumi-language-python. *** 3 | # *** Do not edit by hand unless you're certain you know what you are doing! *** 4 | 5 | import copy 6 | import warnings 7 | import sys 8 | import pulumi 9 | import pulumi.runtime 10 | from typing import Any, Mapping, Optional, Sequence, Union, overload 11 | if sys.version_info >= (3, 11): 12 | from typing import NotRequired, TypedDict, TypeAlias 13 | else: 14 | from typing_extensions import NotRequired, TypedDict, TypeAlias 15 | from .. import _utilities 16 | 17 | import types 18 | 19 | __config__ = pulumi.Config('k0s') 20 | 21 | 22 | class _ExportableConfig(types.ModuleType): 23 | @property 24 | def concurrency(self) -> int: 25 | """ 26 | Maximum number of hosts to configure in parallel, set to 0 for unlimited 27 | """ 28 | return __config__.get_int('concurrency') or (_utilities.get_env_int('PULUMI_K0S_CONCURRENCY') or 30) 29 | 30 | @property 31 | def concurrent_uploads(self) -> int: 32 | """ 33 | Maximum number of files to upload in parallel, set to 0 for unlimited 34 | """ 35 | return __config__.get_int('concurrentUploads') or (_utilities.get_env_int('PULUMI_K0S_CONCURRENT_UPLOADS') or 5) 36 | 37 | @property 38 | def no_drain(self) -> bool: 39 | """ 40 | Do not drain worker nodes when upgrading 41 | """ 42 | return __config__.get_bool('noDrain') or (_utilities.get_env_bool('PULUMI_K0S_NO_DRAIN') or False) 43 | 44 | @property 45 | def no_wait(self) -> bool: 46 | """ 47 | Do not wait for worker nodes to join 48 | """ 49 | return __config__.get_bool('noWait') or (_utilities.get_env_bool('PULUMI_K0S_NO_WAIT') or False) 50 | 51 | @property 52 | def skip_downgrade_check(self) -> bool: 53 | """ 54 | Skip downgrade check 55 | """ 56 | return __config__.get_bool('skipDowngradeCheck') or (_utilities.get_env_bool('PULUMI_K0S_SKIP_DOWNGRADE_CHECK') or False) 57 | 58 | -------------------------------------------------------------------------------- /sdk/nodejs/config/vars.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "../utilities"; 6 | 7 | declare var exports: any; 8 | const __config = new pulumi.Config("k0s"); 9 | 10 | /** 11 | * Maximum number of hosts to configure in parallel, set to 0 for unlimited 12 | */ 13 | export declare const concurrency: number; 14 | Object.defineProperty(exports, "concurrency", { 15 | get() { 16 | return __config.getObject("concurrency") ?? (utilities.getEnvNumber("PULUMI_K0S_CONCURRENCY") || 30); 17 | }, 18 | enumerable: true, 19 | }); 20 | 21 | /** 22 | * Maximum number of files to upload in parallel, set to 0 for unlimited 23 | */ 24 | export declare const concurrentUploads: number; 25 | Object.defineProperty(exports, "concurrentUploads", { 26 | get() { 27 | return __config.getObject("concurrentUploads") ?? (utilities.getEnvNumber("PULUMI_K0S_CONCURRENT_UPLOADS") || 5); 28 | }, 29 | enumerable: true, 30 | }); 31 | 32 | /** 33 | * Do not drain worker nodes when upgrading 34 | */ 35 | export declare const noDrain: boolean; 36 | Object.defineProperty(exports, "noDrain", { 37 | get() { 38 | return __config.getObject("noDrain") ?? (utilities.getEnvBoolean("PULUMI_K0S_NO_DRAIN") || false); 39 | }, 40 | enumerable: true, 41 | }); 42 | 43 | /** 44 | * Do not wait for worker nodes to join 45 | */ 46 | export declare const noWait: boolean; 47 | Object.defineProperty(exports, "noWait", { 48 | get() { 49 | return __config.getObject("noWait") ?? (utilities.getEnvBoolean("PULUMI_K0S_NO_WAIT") || false); 50 | }, 51 | enumerable: true, 52 | }); 53 | 54 | /** 55 | * Skip downgrade check 56 | */ 57 | export declare const skipDowngradeCheck: boolean; 58 | Object.defineProperty(exports, "skipDowngradeCheck", { 59 | get() { 60 | return __config.getObject("skipDowngradeCheck") ?? (utilities.getEnvBoolean("PULUMI_K0S_SKIP_DOWNGRADE_CHECK") || false); 61 | }, 62 | enumerable: true, 63 | }); 64 | 65 | -------------------------------------------------------------------------------- /sdk/dotnet/Pulumi.K0s.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | Florian Schwab 6 | Florian Schwab 7 | A Pulumi package for creating and managing k0s clusters. 8 | Apache-2.0 9 | https://github.com/ydkn/pulumi-k0s 10 | https://github.com/ydkn/pulumi-k0s 11 | logo.png 12 | 13 | net6.0 14 | enable 15 | 16 | 17 | 18 | true 19 | 1701;1702;1591 20 | 21 | 22 | 23 | $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb 24 | true 25 | true 26 | 27 | 28 | 29 | true 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | True 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sEtcdExternalClusterArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sEtcdExternalClusterArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("ca")] 16 | private Input? _ca; 17 | public Input? Ca 18 | { 19 | get => _ca; 20 | set 21 | { 22 | var emptySecret = Output.CreateSecret(0); 23 | _ca = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 24 | } 25 | } 26 | 27 | [Input("clientCert")] 28 | private Input? _clientCert; 29 | public Input? ClientCert 30 | { 31 | get => _clientCert; 32 | set 33 | { 34 | var emptySecret = Output.CreateSecret(0); 35 | _clientCert = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 36 | } 37 | } 38 | 39 | [Input("clientKey")] 40 | private Input? _clientKey; 41 | public Input? ClientKey 42 | { 43 | get => _clientKey; 44 | set 45 | { 46 | var emptySecret = Output.CreateSecret(0); 47 | _clientKey = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 48 | } 49 | } 50 | 51 | [Input("endpoints", required: true)] 52 | private InputList? _endpoints; 53 | public InputList Endpoints 54 | { 55 | get => _endpoints ?? (_endpoints = new InputList()); 56 | set => _endpoints = value; 57 | } 58 | 59 | [Input("etcdPrefix")] 60 | public Input? EtcdPrefix { get; set; } 61 | 62 | public K0sEtcdExternalClusterArgs() 63 | { 64 | } 65 | public static new K0sEtcdExternalClusterArgs Empty => new K0sEtcdExternalClusterArgs(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /sdk/go/k0s/config/config.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package config 5 | 6 | import ( 7 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 8 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config" 9 | "github.com/ydkn/pulumi-k0s/sdk/go/k0s/internal" 10 | ) 11 | 12 | var _ = internal.GetEnvOrDefault 13 | 14 | // Maximum number of hosts to configure in parallel, set to 0 for unlimited 15 | func GetConcurrency(ctx *pulumi.Context) int { 16 | v, err := config.TryInt(ctx, "k0s:concurrency") 17 | if err == nil { 18 | return v 19 | } 20 | var value int 21 | if d := internal.GetEnvOrDefault(30, internal.ParseEnvInt, "PULUMI_K0S_CONCURRENCY"); d != nil { 22 | value = d.(int) 23 | } 24 | return value 25 | } 26 | 27 | // Maximum number of files to upload in parallel, set to 0 for unlimited 28 | func GetConcurrentUploads(ctx *pulumi.Context) int { 29 | v, err := config.TryInt(ctx, "k0s:concurrentUploads") 30 | if err == nil { 31 | return v 32 | } 33 | var value int 34 | if d := internal.GetEnvOrDefault(5, internal.ParseEnvInt, "PULUMI_K0S_CONCURRENT_UPLOADS"); d != nil { 35 | value = d.(int) 36 | } 37 | return value 38 | } 39 | 40 | // Do not drain worker nodes when upgrading 41 | func GetNoDrain(ctx *pulumi.Context) bool { 42 | v, err := config.TryBool(ctx, "k0s:noDrain") 43 | if err == nil { 44 | return v 45 | } 46 | var value bool 47 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_NO_DRAIN"); d != nil { 48 | value = d.(bool) 49 | } 50 | return value 51 | } 52 | 53 | // Do not wait for worker nodes to join 54 | func GetNoWait(ctx *pulumi.Context) bool { 55 | v, err := config.TryBool(ctx, "k0s:noWait") 56 | if err == nil { 57 | return v 58 | } 59 | var value bool 60 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_NO_WAIT"); d != nil { 61 | value = d.(bool) 62 | } 63 | return value 64 | } 65 | 66 | // Skip downgrade check 67 | func GetSkipDowngradeCheck(ctx *pulumi.Context) bool { 68 | v, err := config.TryBool(ctx, "k0s:skipDowngradeCheck") 69 | if err == nil { 70 | return v 71 | } 72 | var value bool 73 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_SKIP_DOWNGRADE_CHECK"); d != nil { 74 | value = d.(bool) 75 | } 76 | return value 77 | } 78 | -------------------------------------------------------------------------------- /.devcontainer.json: -------------------------------------------------------------------------------- 1 | // Reference: 2 | // - https://containers.dev/features 3 | // - https://containers.dev/implementors/features 4 | // - https://code.visualstudio.com/docs/getstarted/settings 5 | { 6 | "name": "pulumi", 7 | "image": "ghcr.io/pulumi/devcontainer:extra", 8 | "customizations": { 9 | "vscode": { 10 | "settings": [ 11 | "go.testTags", "all", 12 | "go.buildTags", "all", 13 | "editor.minimap.enabled", false, 14 | "explorer.openEditors.visible", 1, 15 | "editor.quickSuggestionsDelay", 0, 16 | "editor.suggestSelection", "first", 17 | "editor.snippetSuggestions", "top", 18 | "editor.gotoLocation.multipleReferences", "goto", 19 | "editor.gotoLocation.multipleDefinitions", "goto", 20 | "editor.gotoLocation.multipleDeclarations", "goto", 21 | "editor.gotoLocation.multipleImplementations", "goto", 22 | "editor.gotoLocation.multipleTypeDefinitions", "goto", 23 | "editor.terminal.integrated.shell.linux", "/usr/bin/zsh", 24 | "files.trimTrailingWhitespace", true, 25 | "files.trimFinalNewlines", true 26 | ], 27 | "extensions": [ 28 | "golang.go", 29 | "vscodevim.vim", 30 | "github.copilot", 31 | "ms-python.python", 32 | "jetpack-io.devbox", 33 | "redhat.vscode-yaml", 34 | "esbenp.prettier-vscode", 35 | "ms-vscode.makefile-tools", 36 | "ms-azuretools.vscode-docker", 37 | "github.vscode-pull-request-github", 38 | "ms-vscode-remote.remote-containers", 39 | "visualstudioexptteam.vscodeintellicode", 40 | "bierner.markdown-preview-github-styles" 41 | ] 42 | } 43 | }, 44 | "features": { 45 | "ghcr.io/devcontainers/features/common-utils:2": { 46 | "installZsh": true, 47 | "configureZshAsDefaultShell": true, 48 | "installOhMyZsh": true, 49 | "installOhMyZshConfig": true, 50 | "upgradePackages": true, 51 | "nonFreePackages": true, 52 | "username": "vscode", 53 | "userUid": "automatic", 54 | "userGid": "automatic" 55 | }, 56 | "ghcr.io/devcontainers/features/docker-outside-of-docker:1": { 57 | "moby": false, 58 | "installDockerBuildx": true, 59 | "version": "latest", 60 | "dockerDashComposeVersion": "v2" 61 | } 62 | }, 63 | "remoteUser": "vscode", 64 | "forwardPorts": [1313], 65 | "runArgs": ["--network=host"] 66 | } 67 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/K0sSpecArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class K0sSpecArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("api")] 16 | public Input? Api { get; set; } 17 | 18 | [Input("controllerManager")] 19 | public Input? ControllerManager { get; set; } 20 | 21 | [Input("featureGates")] 22 | private InputList? _featureGates; 23 | public InputList FeatureGates 24 | { 25 | get => _featureGates ?? (_featureGates = new InputList()); 26 | set => _featureGates = value; 27 | } 28 | 29 | [Input("images")] 30 | public Input? Images { get; set; } 31 | 32 | [Input("installConfig")] 33 | public Input? InstallConfig { get; set; } 34 | 35 | [Input("konnectivity")] 36 | public Input? Konnectivity { get; set; } 37 | 38 | [Input("network")] 39 | public Input? Network { get; set; } 40 | 41 | [Input("podSecurityPolicy")] 42 | public Input? PodSecurityPolicy { get; set; } 43 | 44 | [Input("scheduler")] 45 | public Input? Scheduler { get; set; } 46 | 47 | [Input("storage")] 48 | public Input? Storage { get; set; } 49 | 50 | [Input("telemetry")] 51 | public Input? Telemetry { get; set; } 52 | 53 | [Input("workerProfiles")] 54 | private InputList? _workerProfiles; 55 | public InputList WorkerProfiles 56 | { 57 | get => _workerProfiles ?? (_workerProfiles = new InputList()); 58 | set => _workerProfiles = value; 59 | } 60 | 61 | public K0sSpecArgs() 62 | { 63 | } 64 | public static new K0sSpecArgs Empty => new K0sSpecArgs(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/K0sSpec.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class K0sSpec 15 | { 16 | public readonly Outputs.K0sAPI? Api; 17 | public readonly Outputs.K0sControllerManager? ControllerManager; 18 | public readonly ImmutableArray FeatureGates; 19 | public readonly Outputs.K0sImages? Images; 20 | public readonly Outputs.K0sInstallConfig? InstallConfig; 21 | public readonly Outputs.K0sKonnectivity? Konnectivity; 22 | public readonly Outputs.K0sNetwork? Network; 23 | public readonly Outputs.K0sPodSecurityPolicy? PodSecurityPolicy; 24 | public readonly Outputs.K0sScheduler? Scheduler; 25 | public readonly Outputs.K0sStorage? Storage; 26 | public readonly Outputs.K0sTelemetry? Telemetry; 27 | public readonly ImmutableArray WorkerProfiles; 28 | 29 | [OutputConstructor] 30 | private K0sSpec( 31 | Outputs.K0sAPI? api, 32 | 33 | Outputs.K0sControllerManager? controllerManager, 34 | 35 | ImmutableArray featureGates, 36 | 37 | Outputs.K0sImages? images, 38 | 39 | Outputs.K0sInstallConfig? installConfig, 40 | 41 | Outputs.K0sKonnectivity? konnectivity, 42 | 43 | Outputs.K0sNetwork? network, 44 | 45 | Outputs.K0sPodSecurityPolicy? podSecurityPolicy, 46 | 47 | Outputs.K0sScheduler? scheduler, 48 | 49 | Outputs.K0sStorage? storage, 50 | 51 | Outputs.K0sTelemetry? telemetry, 52 | 53 | ImmutableArray workerProfiles) 54 | { 55 | Api = api; 56 | ControllerManager = controllerManager; 57 | FeatureGates = featureGates; 58 | Images = images; 59 | InstallConfig = installConfig; 60 | Konnectivity = konnectivity; 61 | Network = network; 62 | PodSecurityPolicy = podSecurityPolicy; 63 | Scheduler = scheduler; 64 | Storage = storage; 65 | Telemetry = telemetry; 66 | WorkerProfiles = workerProfiles; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /provider/internal/introspect/propertiesMap_test.go: -------------------------------------------------------------------------------- 1 | package introspect 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 7 | ) 8 | 9 | func TestGetPlainPropertiesMap(t *testing.T) { 10 | stringPtr := "string" 11 | boolPtr := true 12 | int64Ptr := int64(42) 13 | 14 | myStruct := struct { 15 | String string `pulumi:"string"` 16 | StringPtr *string `pulumi:"stringPtr"` 17 | Bool bool `pulumi:"bool"` 18 | BoolPtr *bool `pulumi:"boolPtr"` 19 | Int64 int64 `pulumi:"int64"` 20 | Int64Ptr *int64 `pulumi:"int64Ptr"` 21 | NilPtr *string `pulumi:"nilPtr"` 22 | Struct struct { 23 | Foo string `pulumi:"foo"` 24 | } `pulumi:"struct"` 25 | StructPtr struct { 26 | Bar *string `pulumi:"bar"` 27 | } `pulumi:"structPtr"` 28 | Slice []string `pulumi:"slice"` 29 | SlicePtr []*string `pulumi:"slicePtr"` 30 | SliceStructPtr []struct { 31 | Foo string `pulumi:"foo"` 32 | Bar string `pulumi:"bar"` 33 | } `pulumi:"sliceStructPtr"` 34 | Map map[string]string `pulumi:"map"` 35 | MapPtr map[string]*string `pulumi:"mapPtr"` 36 | }{ 37 | String: "string", 38 | StringPtr: &stringPtr, 39 | Bool: true, 40 | BoolPtr: &boolPtr, 41 | Int64: 42, 42 | Int64Ptr: &int64Ptr, 43 | Struct: struct { 44 | Foo string `pulumi:"foo"` 45 | }{Foo: "foo"}, 46 | StructPtr: struct { 47 | Bar *string `pulumi:"bar"` 48 | }{Bar: &stringPtr}, 49 | Slice: []string{"a", "b", "c"}, 50 | SlicePtr: []*string{&stringPtr}, 51 | SliceStructPtr: []struct { 52 | Foo string `pulumi:"foo"` 53 | Bar string `pulumi:"bar"` 54 | }{{Foo: "foo", Bar: "bar"}}, 55 | Map: map[string]string{"a": "b"}, 56 | MapPtr: map[string]*string{"b": &stringPtr}, 57 | } 58 | 59 | props, err := NewPropertiesMap(myStruct) 60 | if err != nil { 61 | t.Errorf("getPlainPropertiesMap error: %s", err.Error()) 62 | 63 | return 64 | } 65 | 66 | keys := []string{ 67 | "string", "stringPtr", 68 | "bool", "boolPtr", 69 | "int64", "int64Ptr", 70 | "struct.foo", "structPtr.bar", 71 | "slice[0]", "slice[1]", "slice[2]", "slicePtr[0]", "sliceStructPtr[0].foo", "sliceStructPtr[0].bar", 72 | "nilPtr", 73 | "map.a", "mapPtr.b", 74 | } 75 | 76 | keysMap := map[string]any{} 77 | for _, k := range keys { 78 | keysMap[k] = nil 79 | } 80 | 81 | for k := range props { 82 | if _, ok := keysMap[string(k)]; !ok { 83 | t.Errorf("unexpected key: %s", k) 84 | } 85 | } 86 | 87 | for _, k := range keys { 88 | if _, ok := props[resource.PropertyKey(k)]; !ok { 89 | t.Errorf("missing key: %s", k) 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /sdk/dotnet/Outputs/ClusterHost.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Outputs 11 | { 12 | 13 | [OutputType] 14 | public sealed class ClusterHost 15 | { 16 | public readonly ImmutableDictionary? Environment; 17 | public readonly ImmutableArray Files; 18 | public readonly Outputs.ClusterHooks? Hooks; 19 | public readonly string? Hostname; 20 | public readonly ImmutableArray InstallFlags; 21 | public readonly string? K0sBinaryPath; 22 | public readonly Outputs.ClusterLocalhost? Localhost; 23 | public readonly bool? NoTaints; 24 | public readonly Outputs.ClusterOpenSSH? OpenSSH; 25 | public readonly string? Os; 26 | public readonly string? PrivateAddress; 27 | public readonly string? PrivateInterface; 28 | public readonly string Role; 29 | public readonly Outputs.ClusterSSH? Ssh; 30 | public readonly bool? UploadBinary; 31 | public readonly Outputs.ClusterWinRM? WinRM; 32 | 33 | [OutputConstructor] 34 | private ClusterHost( 35 | ImmutableDictionary? environment, 36 | 37 | ImmutableArray files, 38 | 39 | Outputs.ClusterHooks? hooks, 40 | 41 | string? hostname, 42 | 43 | ImmutableArray installFlags, 44 | 45 | string? k0sBinaryPath, 46 | 47 | Outputs.ClusterLocalhost? localhost, 48 | 49 | bool? noTaints, 50 | 51 | Outputs.ClusterOpenSSH? openSSH, 52 | 53 | string? os, 54 | 55 | string? privateAddress, 56 | 57 | string? privateInterface, 58 | 59 | string role, 60 | 61 | Outputs.ClusterSSH? ssh, 62 | 63 | bool? uploadBinary, 64 | 65 | Outputs.ClusterWinRM? winRM) 66 | { 67 | Environment = environment; 68 | Files = files; 69 | Hooks = hooks; 70 | Hostname = hostname; 71 | InstallFlags = installFlags; 72 | K0sBinaryPath = k0sBinaryPath; 73 | Localhost = localhost; 74 | NoTaints = noTaints; 75 | OpenSSH = openSSH; 76 | Os = os; 77 | PrivateAddress = privateAddress; 78 | PrivateInterface = privateInterface; 79 | Role = role; 80 | Ssh = ssh; 81 | UploadBinary = uploadBinary; 82 | WinRM = winRM; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterHostArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterHostArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("environment")] 16 | private InputMap? _environment; 17 | public InputMap Environment 18 | { 19 | get => _environment ?? (_environment = new InputMap()); 20 | set => _environment = value; 21 | } 22 | 23 | [Input("files")] 24 | private InputList? _files; 25 | public InputList Files 26 | { 27 | get => _files ?? (_files = new InputList()); 28 | set => _files = value; 29 | } 30 | 31 | [Input("hooks")] 32 | public Input? Hooks { get; set; } 33 | 34 | [Input("hostname")] 35 | public Input? Hostname { get; set; } 36 | 37 | [Input("installFlags")] 38 | private InputList? _installFlags; 39 | public InputList InstallFlags 40 | { 41 | get => _installFlags ?? (_installFlags = new InputList()); 42 | set => _installFlags = value; 43 | } 44 | 45 | [Input("k0sBinaryPath")] 46 | public Input? K0sBinaryPath { get; set; } 47 | 48 | [Input("localhost")] 49 | public Input? Localhost { get; set; } 50 | 51 | [Input("noTaints")] 52 | public Input? NoTaints { get; set; } 53 | 54 | [Input("openSSH")] 55 | public Input? OpenSSH { get; set; } 56 | 57 | [Input("os")] 58 | public Input? Os { get; set; } 59 | 60 | [Input("privateAddress")] 61 | public Input? PrivateAddress { get; set; } 62 | 63 | [Input("privateInterface")] 64 | public Input? PrivateInterface { get; set; } 65 | 66 | [Input("role", required: true)] 67 | public Input Role { get; set; } = null!; 68 | 69 | [Input("ssh")] 70 | public Input? Ssh { get; set; } 71 | 72 | [Input("uploadBinary")] 73 | public Input? UploadBinary { get; set; } 74 | 75 | [Input("winRM")] 76 | public Input? WinRM { get; set; } 77 | 78 | public ClusterHostArgs() 79 | { 80 | } 81 | public static new ClusterHostArgs Empty => new ClusterHostArgs(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /sdk/dotnet/Inputs/ClusterWinRMArgs.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s.Inputs 11 | { 12 | 13 | public sealed class ClusterWinRMArgs : global::Pulumi.ResourceArgs 14 | { 15 | [Input("address", required: true)] 16 | public Input Address { get; set; } = null!; 17 | 18 | [Input("bastion")] 19 | public Input? Bastion { get; set; } 20 | 21 | [Input("caCert")] 22 | private Input? _caCert; 23 | public Input? CaCert 24 | { 25 | get => _caCert; 26 | set 27 | { 28 | var emptySecret = Output.CreateSecret(0); 29 | _caCert = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 30 | } 31 | } 32 | 33 | [Input("cert")] 34 | private Input? _cert; 35 | public Input? Cert 36 | { 37 | get => _cert; 38 | set 39 | { 40 | var emptySecret = Output.CreateSecret(0); 41 | _cert = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 42 | } 43 | } 44 | 45 | [Input("insecure")] 46 | public Input? Insecure { get; set; } 47 | 48 | [Input("key")] 49 | private Input? _key; 50 | public Input? Key 51 | { 52 | get => _key; 53 | set 54 | { 55 | var emptySecret = Output.CreateSecret(0); 56 | _key = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 57 | } 58 | } 59 | 60 | [Input("password")] 61 | private Input? _password; 62 | public Input? Password 63 | { 64 | get => _password; 65 | set 66 | { 67 | var emptySecret = Output.CreateSecret(0); 68 | _password = Output.Tuple?, int>(value, emptySecret).Apply(t => t.Item1); 69 | } 70 | } 71 | 72 | [Input("port")] 73 | public Input? Port { get; set; } 74 | 75 | [Input("tlsServerName")] 76 | public Input? TlsServerName { get; set; } 77 | 78 | [Input("useHTTPS")] 79 | public Input? UseHTTPS { get; set; } 80 | 81 | [Input("useNTLM")] 82 | public Input? UseNTLM { get; set; } 83 | 84 | [Input("user")] 85 | public Input? User { get; set; } 86 | 87 | public ClusterWinRMArgs() 88 | { 89 | } 90 | public static new ClusterWinRMArgs Empty => new ClusterWinRMArgs(); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /provider/config.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "context" 5 | "strings" 6 | 7 | p "github.com/pulumi/pulumi-go-provider" 8 | "github.com/pulumi/pulumi-go-provider/infer" 9 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 10 | "github.com/ydkn/pulumi-k0s/provider/internal/introspect" 11 | ) 12 | 13 | type Config struct { 14 | SkipDowngradeCheck *bool `pulumi:"skipDowngradeCheck,optional"` 15 | NoDrain *bool `pulumi:"noDrain,optional"` 16 | NoWait *bool `pulumi:"noWait,optional"` 17 | Concurrency *int `pulumi:"concurrency,optional"` 18 | ConcurrentUploads *int `pulumi:"concurrentUploads,optional"` 19 | } 20 | 21 | func (c *Config) Annotate(a infer.Annotator) { 22 | skipDowngradeCheckValue := false 23 | a.Describe(&c.SkipDowngradeCheck, "Skip downgrade check") 24 | a.SetDefault(&c.SkipDowngradeCheck, &skipDowngradeCheckValue, "PULUMI_K0S_SKIP_DOWNGRADE_CHECK") 25 | 26 | noDrainValue := false 27 | a.Describe(&c.NoDrain, "Do not drain worker nodes when upgrading") 28 | a.SetDefault(&c.NoDrain, &noDrainValue, "PULUMI_K0S_NO_DRAIN") 29 | 30 | noWaitValue := false 31 | a.Describe(&c.NoWait, "Do not wait for worker nodes to join") 32 | a.SetDefault(&c.NoWait, &noWaitValue, "PULUMI_K0S_NO_WAIT") 33 | 34 | concurrencyValue := 30 35 | a.Describe(&c.Concurrency, "Maximum number of hosts to configure in parallel, set to 0 for unlimited") 36 | a.SetDefault(&c.Concurrency, &concurrencyValue, "PULUMI_K0S_CONCURRENCY") 37 | 38 | concurrentUploadsValue := 5 39 | a.Describe(&c.ConcurrentUploads, "Maximum number of files to upload in parallel, set to 0 for unlimited") 40 | a.SetDefault(&c.ConcurrentUploads, &concurrentUploadsValue, "PULUMI_K0S_CONCURRENT_UPLOADS") 41 | } 42 | 43 | func (c *Config) Diff(ctx context.Context, name string, olds Config, news Config) (p.DiffResponse, error) { 44 | diffResponse := p.DiffResponse{ 45 | DeleteBeforeReplace: false, 46 | HasChanges: false, 47 | DetailedDiff: map[string]p.PropertyDiff{}, 48 | } 49 | 50 | oldsProps, err := introspect.NewPropertiesMap(olds) 51 | if err != nil { 52 | return p.DiffResponse{}, err 53 | } 54 | 55 | newsProps, err := introspect.NewPropertiesMap(news) 56 | if err != nil { 57 | return p.DiffResponse{}, err 58 | } 59 | 60 | for key := range propertyMapDiff(oldsProps, newsProps, []resource.PropertyKey{}) { 61 | diffResponse.DetailedDiff[strings.SplitN(string(key), ".", 2)[0]] = p.PropertyDiff{ 62 | Kind: p.Update, 63 | InputDiff: true, 64 | } 65 | } 66 | 67 | if len(diffResponse.DetailedDiff) > 0 { 68 | diffResponse.HasChanges = true 69 | } 70 | 71 | return diffResponse, nil 72 | } 73 | 74 | func (c *Config) Check(ctx context.Context, name string, olds Config, news Config) (Config, []p.CheckFailure, error) { 75 | return Config{ 76 | SkipDowngradeCheck: news.SkipDowngradeCheck, 77 | NoDrain: news.NoDrain, 78 | NoWait: news.NoWait, 79 | Concurrency: news.Concurrency, 80 | ConcurrentUploads: news.ConcurrentUploads, 81 | }, []p.CheckFailure{}, nil 82 | } 83 | -------------------------------------------------------------------------------- /sdk/nodejs/provider.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as utilities from "./utilities"; 6 | 7 | export class Provider extends pulumi.ProviderResource { 8 | /** @internal */ 9 | public static readonly __pulumiType = 'k0s'; 10 | 11 | /** 12 | * Returns true if the given object is an instance of Provider. This is designed to work even 13 | * when multiple copies of the Pulumi SDK have been loaded into the same process. 14 | */ 15 | public static isInstance(obj: any): obj is Provider { 16 | if (obj === undefined || obj === null) { 17 | return false; 18 | } 19 | return obj['__pulumiType'] === "pulumi:providers:" + Provider.__pulumiType; 20 | } 21 | 22 | 23 | /** 24 | * Create a Provider resource with the given unique name, arguments, and options. 25 | * 26 | * @param name The _unique_ name of the resource. 27 | * @param args The arguments to use to populate this resource's properties. 28 | * @param opts A bag of options that control this resource's behavior. 29 | */ 30 | constructor(name: string, args?: ProviderArgs, opts?: pulumi.ResourceOptions) { 31 | let resourceInputs: pulumi.Inputs = {}; 32 | opts = opts || {}; 33 | { 34 | resourceInputs["concurrency"] = pulumi.output((args ? args.concurrency : undefined) ?? (utilities.getEnvNumber("PULUMI_K0S_CONCURRENCY") || 30)).apply(JSON.stringify); 35 | resourceInputs["concurrentUploads"] = pulumi.output((args ? args.concurrentUploads : undefined) ?? (utilities.getEnvNumber("PULUMI_K0S_CONCURRENT_UPLOADS") || 5)).apply(JSON.stringify); 36 | resourceInputs["noDrain"] = pulumi.output((args ? args.noDrain : undefined) ?? (utilities.getEnvBoolean("PULUMI_K0S_NO_DRAIN") || false)).apply(JSON.stringify); 37 | resourceInputs["noWait"] = pulumi.output((args ? args.noWait : undefined) ?? (utilities.getEnvBoolean("PULUMI_K0S_NO_WAIT") || false)).apply(JSON.stringify); 38 | resourceInputs["skipDowngradeCheck"] = pulumi.output((args ? args.skipDowngradeCheck : undefined) ?? (utilities.getEnvBoolean("PULUMI_K0S_SKIP_DOWNGRADE_CHECK") || false)).apply(JSON.stringify); 39 | } 40 | opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); 41 | super(Provider.__pulumiType, name, resourceInputs, opts); 42 | } 43 | } 44 | 45 | /** 46 | * The set of arguments for constructing a Provider resource. 47 | */ 48 | export interface ProviderArgs { 49 | /** 50 | * Maximum number of hosts to configure in parallel, set to 0 for unlimited 51 | */ 52 | concurrency?: pulumi.Input; 53 | /** 54 | * Maximum number of files to upload in parallel, set to 0 for unlimited 55 | */ 56 | concurrentUploads?: pulumi.Input; 57 | /** 58 | * Do not drain worker nodes when upgrading 59 | */ 60 | noDrain?: pulumi.Input; 61 | /** 62 | * Do not wait for worker nodes to join 63 | */ 64 | noWait?: pulumi.Input; 65 | /** 66 | * Skip downgrade check 67 | */ 68 | skipDowngradeCheck?: pulumi.Input; 69 | } 70 | -------------------------------------------------------------------------------- /sdk/nodejs/utilities.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | 5 | import * as runtime from "@pulumi/pulumi/runtime"; 6 | import * as pulumi from "@pulumi/pulumi"; 7 | 8 | export function getEnv(...vars: string[]): string | undefined { 9 | for (const v of vars) { 10 | const value = process.env[v]; 11 | if (value) { 12 | return value; 13 | } 14 | } 15 | return undefined; 16 | } 17 | 18 | export function getEnvBoolean(...vars: string[]): boolean | undefined { 19 | const s = getEnv(...vars); 20 | if (s !== undefined) { 21 | // NOTE: these values are taken from https://golang.org/src/strconv/atob.go?s=351:391#L1, which is what 22 | // Terraform uses internally when parsing boolean values. 23 | if (["1", "t", "T", "true", "TRUE", "True"].find(v => v === s) !== undefined) { 24 | return true; 25 | } 26 | if (["0", "f", "F", "false", "FALSE", "False"].find(v => v === s) !== undefined) { 27 | return false; 28 | } 29 | } 30 | return undefined; 31 | } 32 | 33 | export function getEnvNumber(...vars: string[]): number | undefined { 34 | const s = getEnv(...vars); 35 | if (s !== undefined) { 36 | const f = parseFloat(s); 37 | if (!isNaN(f)) { 38 | return f; 39 | } 40 | } 41 | return undefined; 42 | } 43 | 44 | export function getVersion(): string { 45 | let version = require('./package.json').version; 46 | // Node allows for the version to be prefixed by a "v", while semver doesn't. 47 | // If there is a v, strip it off. 48 | if (version.indexOf('v') === 0) { 49 | version = version.slice(1); 50 | } 51 | return version; 52 | } 53 | 54 | /** @internal */ 55 | export function resourceOptsDefaults(): any { 56 | return { version: getVersion(), pluginDownloadURL: "https://repo.ydkn.io/pulumi-k0s" }; 57 | } 58 | 59 | /** @internal */ 60 | export function lazyLoad(exports: any, props: string[], loadModule: any) { 61 | for (let property of props) { 62 | Object.defineProperty(exports, property, { 63 | enumerable: true, 64 | get: function() { 65 | return loadModule()[property]; 66 | }, 67 | }); 68 | } 69 | } 70 | 71 | export async function callAsync( 72 | tok: string, 73 | props: pulumi.Inputs, 74 | res?: pulumi.Resource, 75 | opts?: {property?: string}, 76 | ): Promise { 77 | const o: any = runtime.call(tok, props, res); 78 | const value = await o.promise(true /*withUnknowns*/); 79 | const isKnown = await o.isKnown; 80 | const isSecret = await o.isSecret; 81 | const problem: string|undefined = 82 | !isKnown ? "an unknown value" 83 | : isSecret ? "a secret value" 84 | : undefined; 85 | // Ingoring o.resources silently. They are typically non-empty, r.f() calls include r as a dependency. 86 | if (problem) { 87 | throw new Error(`Plain resource method "${tok}" incorrectly returned ${problem}. ` + 88 | "This is an error in the provider, please report this to the provider developer."); 89 | } 90 | // Extract a single property if requested. 91 | if (opts && opts.property) { 92 | return value[opts.property]; 93 | } 94 | return value; 95 | } 96 | -------------------------------------------------------------------------------- /sdk/dotnet/Utilities.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | namespace Pulumi.K0s 5 | { 6 | static class Utilities 7 | { 8 | public static string? GetEnv(params string[] names) 9 | { 10 | foreach (var n in names) 11 | { 12 | var value = global::System.Environment.GetEnvironmentVariable(n); 13 | if (value != null) 14 | { 15 | return value; 16 | } 17 | } 18 | return null; 19 | } 20 | 21 | static string[] trueValues = { "1", "t", "T", "true", "TRUE", "True" }; 22 | static string[] falseValues = { "0", "f", "F", "false", "FALSE", "False" }; 23 | public static bool? GetEnvBoolean(params string[] names) 24 | { 25 | var s = GetEnv(names); 26 | if (s != null) 27 | { 28 | if (global::System.Array.IndexOf(trueValues, s) != -1) 29 | { 30 | return true; 31 | } 32 | if (global::System.Array.IndexOf(falseValues, s) != -1) 33 | { 34 | return false; 35 | } 36 | } 37 | return null; 38 | } 39 | 40 | public static int? GetEnvInt32(params string[] names) => int.TryParse(GetEnv(names), out int v) ? (int?)v : null; 41 | 42 | public static double? GetEnvDouble(params string[] names) => double.TryParse(GetEnv(names), out double v) ? (double?)v : null; 43 | 44 | [global::System.Obsolete("Please use WithDefaults instead")] 45 | public static global::Pulumi.InvokeOptions WithVersion(this global::Pulumi.InvokeOptions? options) 46 | { 47 | var dst = options ?? new global::Pulumi.InvokeOptions{}; 48 | dst.Version = options?.Version ?? Version; 49 | return dst; 50 | } 51 | 52 | public static global::Pulumi.InvokeOptions WithDefaults(this global::Pulumi.InvokeOptions? src) 53 | { 54 | var dst = src ?? new global::Pulumi.InvokeOptions{}; 55 | dst.Version = src?.Version ?? Version; 56 | dst.PluginDownloadURL = src?.PluginDownloadURL ?? "https://repo.ydkn.io/pulumi-k0s"; 57 | return dst; 58 | } 59 | 60 | private readonly static string version; 61 | public static string Version => version; 62 | 63 | static Utilities() 64 | { 65 | var assembly = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(Utilities)).Assembly; 66 | using var stream = assembly.GetManifestResourceStream("Pulumi.K0s.version.txt"); 67 | using var reader = new global::System.IO.StreamReader(stream ?? throw new global::System.NotSupportedException("Missing embedded version.txt file")); 68 | version = reader.ReadToEnd().Trim(); 69 | var parts = version.Split("\n"); 70 | if (parts.Length == 2) 71 | { 72 | // The first part is the provider name. 73 | version = parts[1].Trim(); 74 | } 75 | } 76 | } 77 | 78 | internal sealed class K0sResourceTypeAttribute : global::Pulumi.ResourceTypeAttribute 79 | { 80 | public K0sResourceTypeAttribute(string type) : base(type, Utilities.Version) 81 | { 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /sdk/dotnet/Config/Config.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Immutable; 6 | 7 | namespace Pulumi.K0s 8 | { 9 | public static class Config 10 | { 11 | [global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification = 12 | "Double underscore prefix used to avoid conflicts with variable names.")] 13 | private sealed class __Value 14 | { 15 | private readonly Func _getter; 16 | private T _value = default!; 17 | private bool _set; 18 | 19 | public __Value(Func getter) 20 | { 21 | _getter = getter; 22 | } 23 | 24 | public T Get() => _set ? _value : _getter(); 25 | 26 | public void Set(T value) 27 | { 28 | _value = value; 29 | _set = true; 30 | } 31 | } 32 | 33 | private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("k0s"); 34 | 35 | private static readonly __Value _concurrency = new __Value(() => __config.GetInt32("concurrency") ?? Utilities.GetEnvInt32("PULUMI_K0S_CONCURRENCY") ?? 30); 36 | /// 37 | /// Maximum number of hosts to configure in parallel, set to 0 for unlimited 38 | /// 39 | public static int? Concurrency 40 | { 41 | get => _concurrency.Get(); 42 | set => _concurrency.Set(value); 43 | } 44 | 45 | private static readonly __Value _concurrentUploads = new __Value(() => __config.GetInt32("concurrentUploads") ?? Utilities.GetEnvInt32("PULUMI_K0S_CONCURRENT_UPLOADS") ?? 5); 46 | /// 47 | /// Maximum number of files to upload in parallel, set to 0 for unlimited 48 | /// 49 | public static int? ConcurrentUploads 50 | { 51 | get => _concurrentUploads.Get(); 52 | set => _concurrentUploads.Set(value); 53 | } 54 | 55 | private static readonly __Value _noDrain = new __Value(() => __config.GetBoolean("noDrain") ?? Utilities.GetEnvBoolean("PULUMI_K0S_NO_DRAIN") ?? false); 56 | /// 57 | /// Do not drain worker nodes when upgrading 58 | /// 59 | public static bool? NoDrain 60 | { 61 | get => _noDrain.Get(); 62 | set => _noDrain.Set(value); 63 | } 64 | 65 | private static readonly __Value _noWait = new __Value(() => __config.GetBoolean("noWait") ?? Utilities.GetEnvBoolean("PULUMI_K0S_NO_WAIT") ?? false); 66 | /// 67 | /// Do not wait for worker nodes to join 68 | /// 69 | public static bool? NoWait 70 | { 71 | get => _noWait.Get(); 72 | set => _noWait.Set(value); 73 | } 74 | 75 | private static readonly __Value _skipDowngradeCheck = new __Value(() => __config.GetBoolean("skipDowngradeCheck") ?? Utilities.GetEnvBoolean("PULUMI_K0S_SKIP_DOWNGRADE_CHECK") ?? false); 76 | /// 77 | /// Skip downgrade check 78 | /// 79 | public static bool? SkipDowngradeCheck 80 | { 81 | get => _skipDowngradeCheck.Get(); 82 | set => _skipDowngradeCheck.Set(value); 83 | } 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /sdk/dotnet/Provider.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s 11 | { 12 | [K0sResourceType("pulumi:providers:k0s")] 13 | public partial class Provider : global::Pulumi.ProviderResource 14 | { 15 | /// 16 | /// Create a Provider resource with the given unique name, arguments, and options. 17 | /// 18 | /// 19 | /// The unique name of the resource 20 | /// The arguments used to populate this resource's properties 21 | /// A bag of options that control this resource's behavior 22 | public Provider(string name, ProviderArgs? args = null, CustomResourceOptions? options = null) 23 | : base("k0s", name, args ?? new ProviderArgs(), MakeResourceOptions(options, "")) 24 | { 25 | } 26 | 27 | private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) 28 | { 29 | var defaultOptions = new CustomResourceOptions 30 | { 31 | Version = Utilities.Version, 32 | PluginDownloadURL = "https://repo.ydkn.io/pulumi-k0s", 33 | }; 34 | var merged = CustomResourceOptions.Merge(defaultOptions, options); 35 | // Override the ID if one was specified for consistency with other language SDKs. 36 | merged.Id = id ?? merged.Id; 37 | return merged; 38 | } 39 | } 40 | 41 | public sealed class ProviderArgs : global::Pulumi.ResourceArgs 42 | { 43 | /// 44 | /// Maximum number of hosts to configure in parallel, set to 0 for unlimited 45 | /// 46 | [Input("concurrency", json: true)] 47 | public Input? Concurrency { get; set; } 48 | 49 | /// 50 | /// Maximum number of files to upload in parallel, set to 0 for unlimited 51 | /// 52 | [Input("concurrentUploads", json: true)] 53 | public Input? ConcurrentUploads { get; set; } 54 | 55 | /// 56 | /// Do not drain worker nodes when upgrading 57 | /// 58 | [Input("noDrain", json: true)] 59 | public Input? NoDrain { get; set; } 60 | 61 | /// 62 | /// Do not wait for worker nodes to join 63 | /// 64 | [Input("noWait", json: true)] 65 | public Input? NoWait { get; set; } 66 | 67 | /// 68 | /// Skip downgrade check 69 | /// 70 | [Input("skipDowngradeCheck", json: true)] 71 | public Input? SkipDowngradeCheck { get; set; } 72 | 73 | public ProviderArgs() 74 | { 75 | Concurrency = Utilities.GetEnvInt32("PULUMI_K0S_CONCURRENCY") ?? 30; 76 | ConcurrentUploads = Utilities.GetEnvInt32("PULUMI_K0S_CONCURRENT_UPLOADS") ?? 5; 77 | NoDrain = Utilities.GetEnvBoolean("PULUMI_K0S_NO_DRAIN") ?? false; 78 | NoWait = Utilities.GetEnvBoolean("PULUMI_K0S_NO_WAIT") ?? false; 79 | SkipDowngradeCheck = Utilities.GetEnvBoolean("PULUMI_K0S_SKIP_DOWNGRADE_CHECK") ?? false; 80 | } 81 | public static new ProviderArgs Empty => new ProviderArgs(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /provider/k0sctl.go: -------------------------------------------------------------------------------- 1 | package provider 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | 7 | "github.com/k0sproject/k0sctl/action" 8 | "github.com/k0sproject/k0sctl/phase" 9 | ) 10 | 11 | type K0sctl struct { 12 | news *ClusterInputs 13 | cluster k0sctlCluster 14 | } 15 | 16 | func NewK0sctl(news *ClusterInputs) *K0sctl { 17 | return &K0sctl{news: news, cluster: k0sctlCluster(*news)} 18 | } 19 | 20 | func (k *K0sctl) Validate() error { 21 | return k.validate() 22 | } 23 | 24 | func (k *K0sctl) Apply(config *Config) error { 25 | cluster, cleanup, err := k.cluster.k0sctl() 26 | 27 | defer cleanup() 28 | 29 | if err != nil { 30 | return err 31 | } 32 | 33 | skipDowngradeCheck := false 34 | if config.SkipDowngradeCheck != nil { 35 | skipDowngradeCheck = *config.SkipDowngradeCheck 36 | } 37 | 38 | noDrain := false 39 | if config.NoDrain != nil { 40 | noDrain = *config.NoDrain 41 | } 42 | 43 | noWait := false 44 | if config.NoWait != nil { 45 | noWait = *config.NoWait 46 | } 47 | 48 | concurrency := 30 49 | if config.Concurrency != nil { 50 | concurrency = *config.Concurrency 51 | } 52 | 53 | concurrentUploads := 5 54 | if config.ConcurrentUploads != nil { 55 | concurrentUploads = *config.ConcurrentUploads 56 | } 57 | 58 | manager := phase.Manager{Config: cluster, Concurrency: concurrency, ConcurrentUploads: concurrentUploads} 59 | 60 | var kubeconfigBytes bytes.Buffer 61 | 62 | kubeconfigWriter := bufio.NewWriter(&kubeconfigBytes) 63 | 64 | applyAction := action.Apply{ 65 | ApplyOptions: action.ApplyOptions{ 66 | Force: true, 67 | Manager: &manager, 68 | KubeconfigOut: kubeconfigWriter, 69 | KubeconfigAPIAddress: k.cluster.APIAddress(), 70 | NoWait: noWait, 71 | NoDrain: noDrain, 72 | DisableDowngradeCheck: skipDowngradeCheck, 73 | RestoreFrom: "", 74 | }, 75 | } 76 | 77 | if err := applyAction.Run(); err != nil { 78 | return err 79 | } 80 | 81 | if manager.Config.Metadata != nil && manager.Config.Metadata.Kubeconfig != "" { 82 | kubeconfig := kubeconfigBytes.String() 83 | k.news.Kubeconfig = &kubeconfig 84 | } 85 | 86 | return nil 87 | } 88 | 89 | func (k *K0sctl) Kubeconfig() error { 90 | cluster, cleanup, err := k.cluster.k0sctl() 91 | 92 | defer cleanup() 93 | 94 | if err != nil { 95 | return err 96 | } 97 | 98 | manager := phase.Manager{Config: cluster} 99 | 100 | kubeconfigAction := action.Kubeconfig{ 101 | Manager: &manager, 102 | KubeconfigAPIAddress: k.cluster.APIAddress(), 103 | } 104 | 105 | if err := kubeconfigAction.Run(); err != nil { 106 | return err 107 | } 108 | 109 | if manager.Config.Metadata != nil && manager.Config.Metadata.Kubeconfig != "" { 110 | k.news.Kubeconfig = &manager.Config.Metadata.Kubeconfig 111 | } 112 | 113 | return nil 114 | } 115 | 116 | func (k *K0sctl) Reset() error { 117 | cluster, cleanup, err := k.cluster.k0sctl() 118 | 119 | defer cleanup() 120 | 121 | if err != nil { 122 | return err 123 | } 124 | 125 | manager := phase.Manager{Config: cluster} 126 | 127 | resetAction := action.Reset{ 128 | Manager: &manager, 129 | Force: true, 130 | Stdout: nil, 131 | } 132 | 133 | if err := resetAction.Run(); err != nil { 134 | return err 135 | } 136 | 137 | return nil 138 | } 139 | 140 | func (k *K0sctl) validate() error { 141 | cluster, cleanup, err := k.cluster.k0sctl() 142 | 143 | defer cleanup() 144 | 145 | if err != nil { 146 | return err 147 | } 148 | 149 | return cluster.Validate() 150 | } 151 | -------------------------------------------------------------------------------- /sdk/nodejs/cluster.ts: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi-language-nodejs. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | import * as pulumi from "@pulumi/pulumi"; 5 | import * as inputs from "./types/input"; 6 | import * as outputs from "./types/output"; 7 | import * as utilities from "./utilities"; 8 | 9 | export class Cluster extends pulumi.CustomResource { 10 | /** 11 | * Get an existing Cluster resource's state with the given name, ID, and optional extra 12 | * properties used to qualify the lookup. 13 | * 14 | * @param name The _unique_ name of the resulting resource. 15 | * @param id The _unique_ provider ID of the resource to lookup. 16 | * @param opts Optional settings to control the behavior of the CustomResource. 17 | */ 18 | public static get(name: string, id: pulumi.Input, opts?: pulumi.CustomResourceOptions): Cluster { 19 | return new Cluster(name, undefined as any, { ...opts, id: id }); 20 | } 21 | 22 | /** @internal */ 23 | public static readonly __pulumiType = 'k0s:index:Cluster'; 24 | 25 | /** 26 | * Returns true if the given object is an instance of Cluster. This is designed to work even 27 | * when multiple copies of the Pulumi SDK have been loaded into the same process. 28 | */ 29 | public static isInstance(obj: any): obj is Cluster { 30 | if (obj === undefined || obj === null) { 31 | return false; 32 | } 33 | return obj['__pulumiType'] === Cluster.__pulumiType; 34 | } 35 | 36 | public readonly apiVersion!: pulumi.Output; 37 | public readonly kind!: pulumi.Output; 38 | public /*out*/ readonly kubeconfig!: pulumi.Output; 39 | public readonly metadata!: pulumi.Output; 40 | public readonly spec!: pulumi.Output; 41 | 42 | /** 43 | * Create a Cluster resource with the given unique name, arguments, and options. 44 | * 45 | * @param name The _unique_ name of the resource. 46 | * @param args The arguments to use to populate this resource's properties. 47 | * @param opts A bag of options that control this resource's behavior. 48 | */ 49 | constructor(name: string, args?: ClusterArgs, opts?: pulumi.CustomResourceOptions) { 50 | let resourceInputs: pulumi.Inputs = {}; 51 | opts = opts || {}; 52 | if (!opts.id) { 53 | resourceInputs["apiVersion"] = args ? args.apiVersion : undefined; 54 | resourceInputs["kind"] = args ? args.kind : undefined; 55 | resourceInputs["metadata"] = args ? args.metadata : undefined; 56 | resourceInputs["spec"] = args ? args.spec : undefined; 57 | resourceInputs["kubeconfig"] = undefined /*out*/; 58 | } else { 59 | resourceInputs["apiVersion"] = undefined /*out*/; 60 | resourceInputs["kind"] = undefined /*out*/; 61 | resourceInputs["kubeconfig"] = undefined /*out*/; 62 | resourceInputs["metadata"] = undefined /*out*/; 63 | resourceInputs["spec"] = undefined /*out*/; 64 | } 65 | opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); 66 | const secretOpts = { additionalSecretOutputs: ["kubeconfig"] }; 67 | opts = pulumi.mergeOptions(opts, secretOpts); 68 | super(Cluster.__pulumiType, name, resourceInputs, opts); 69 | } 70 | } 71 | 72 | /** 73 | * The set of arguments for constructing a Cluster resource. 74 | */ 75 | export interface ClusterArgs { 76 | apiVersion?: pulumi.Input; 77 | kind?: pulumi.Input; 78 | metadata?: pulumi.Input; 79 | spec?: pulumi.Input; 80 | } 81 | -------------------------------------------------------------------------------- /sdk/dotnet/Cluster.cs: -------------------------------------------------------------------------------- 1 | // *** WARNING: this file was generated by pulumi. *** 2 | // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Collections.Immutable; 7 | using System.Threading.Tasks; 8 | using Pulumi.Serialization; 9 | 10 | namespace Pulumi.K0s 11 | { 12 | [K0sResourceType("k0s:index:Cluster")] 13 | public partial class Cluster : global::Pulumi.CustomResource 14 | { 15 | [Output("apiVersion")] 16 | public Output ApiVersion { get; private set; } = null!; 17 | 18 | [Output("kind")] 19 | public Output Kind { get; private set; } = null!; 20 | 21 | [Output("kubeconfig")] 22 | public Output Kubeconfig { get; private set; } = null!; 23 | 24 | [Output("metadata")] 25 | public Output Metadata { get; private set; } = null!; 26 | 27 | [Output("spec")] 28 | public Output Spec { get; private set; } = null!; 29 | 30 | 31 | /// 32 | /// Create a Cluster resource with the given unique name, arguments, and options. 33 | /// 34 | /// 35 | /// The unique name of the resource 36 | /// The arguments used to populate this resource's properties 37 | /// A bag of options that control this resource's behavior 38 | public Cluster(string name, ClusterArgs? args = null, CustomResourceOptions? options = null) 39 | : base("k0s:index:Cluster", name, args ?? new ClusterArgs(), MakeResourceOptions(options, "")) 40 | { 41 | } 42 | 43 | private Cluster(string name, Input id, CustomResourceOptions? options = null) 44 | : base("k0s:index:Cluster", name, null, MakeResourceOptions(options, id)) 45 | { 46 | } 47 | 48 | private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) 49 | { 50 | var defaultOptions = new CustomResourceOptions 51 | { 52 | Version = Utilities.Version, 53 | PluginDownloadURL = "https://repo.ydkn.io/pulumi-k0s", 54 | AdditionalSecretOutputs = 55 | { 56 | "kubeconfig", 57 | }, 58 | }; 59 | var merged = CustomResourceOptions.Merge(defaultOptions, options); 60 | // Override the ID if one was specified for consistency with other language SDKs. 61 | merged.Id = id ?? merged.Id; 62 | return merged; 63 | } 64 | /// 65 | /// Get an existing Cluster resource's state with the given name, ID, and optional extra 66 | /// properties used to qualify the lookup. 67 | /// 68 | /// 69 | /// The unique name of the resulting resource. 70 | /// The unique provider ID of the resource to lookup. 71 | /// A bag of options that control this resource's behavior 72 | public static Cluster Get(string name, Input id, CustomResourceOptions? options = null) 73 | { 74 | return new Cluster(name, id, options); 75 | } 76 | } 77 | 78 | public sealed class ClusterArgs : global::Pulumi.ResourceArgs 79 | { 80 | [Input("apiVersion")] 81 | public Input? ApiVersion { get; set; } 82 | 83 | [Input("kind")] 84 | public Input? Kind { get; set; } 85 | 86 | [Input("metadata")] 87 | public Input? Metadata { get; set; } 88 | 89 | [Input("spec")] 90 | public Input? Spec { get; set; } 91 | 92 | public ClusterArgs() 93 | { 94 | } 95 | public static new ClusterArgs Empty => new ClusterArgs(); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /provider/internal/introspect/propertiesMap.go: -------------------------------------------------------------------------------- 1 | package introspect 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | "strings" 7 | 8 | "github.com/pulumi/pulumi/sdk/v3/go/common/resource" 9 | ) 10 | 11 | func NewPropertiesMap(obj any) (resource.PropertyMap, error) { 12 | typ := reflect.TypeOf(obj) 13 | for typ.Kind() == reflect.Pointer { 14 | typ = typ.Elem() 15 | } 16 | 17 | if typ.Kind() != reflect.Struct { 18 | return nil, fmt.Errorf("Expected struct, found %s (%T)", typ.Kind(), obj) 19 | } 20 | 21 | return getPlainPropertiesMapWithPrefix(obj, "") 22 | } 23 | 24 | func getPlainPropertiesMapWithPrefix(obj any, prefix string) (resource.PropertyMap, error) { 25 | if prefix != "" { 26 | prefix += "." 27 | } 28 | 29 | typ := reflect.TypeOf(obj) 30 | for typ.Kind() == reflect.Pointer { 31 | typ = typ.Elem() 32 | } 33 | 34 | if typ.Kind() != reflect.Struct { 35 | return resource.PropertyMap{}, nil 36 | } 37 | 38 | val := reflect.ValueOf(obj) 39 | 40 | properties := resource.PropertyMap{} 41 | for _, f := range reflect.VisibleFields(typ) { 42 | fieldPrefix := prefix 43 | if val.Kind() != reflect.Slice { 44 | pulumiTag, ok := f.Tag.Lookup("pulumi") 45 | if !ok { 46 | continue 47 | } 48 | 49 | fieldPrefix += strings.Split(pulumiTag, ",")[0] 50 | } 51 | 52 | value := reflect.Indirect(val).FieldByName(f.Name) 53 | if value.Kind() == reflect.Ptr { 54 | value = value.Elem() 55 | } 56 | 57 | props, err := getPropertyMapForValue(value, fieldPrefix) 58 | if err != nil { 59 | return nil, err 60 | } 61 | 62 | for k, v := range props { 63 | properties[k] = v 64 | } 65 | } 66 | 67 | return properties, nil 68 | } 69 | 70 | func getPropertyMapForValue(value reflect.Value, prefix string) (resource.PropertyMap, error) { 71 | key := resource.PropertyKey(prefix) 72 | properties := resource.PropertyMap{} 73 | 74 | switch value.Kind() { 75 | case reflect.Struct: 76 | props, err := getPlainPropertiesMapWithPrefix(value.Interface(), prefix) 77 | if err != nil { 78 | return nil, err 79 | } 80 | 81 | for k, v := range props { 82 | properties[k] = v 83 | } 84 | case reflect.Slice: 85 | slice := reflect.ValueOf(value.Interface()) 86 | 87 | for i := 0; i < slice.Len(); i++ { 88 | slicePrefix := fmt.Sprintf("%s[%d]", prefix, i) 89 | 90 | sliceElement := slice.Index(i) 91 | if sliceElement.Kind() == reflect.Ptr { 92 | sliceElement = sliceElement.Elem() 93 | } 94 | 95 | var props resource.PropertyMap 96 | var err error 97 | 98 | if sliceElement.Kind() == reflect.Struct { 99 | props, err = getPlainPropertiesMapWithPrefix(sliceElement.Interface(), slicePrefix) 100 | } else { 101 | props, err = getPropertyMapForValue(sliceElement, slicePrefix) 102 | } 103 | 104 | if err != nil { 105 | return nil, err 106 | } 107 | 108 | for k, v := range props { 109 | properties[k] = v 110 | } 111 | } 112 | case reflect.Map: 113 | mapValue := reflect.ValueOf(value.Interface()) 114 | 115 | for _, e := range mapValue.MapKeys() { 116 | mapElement := mapValue.MapIndex(e) 117 | 118 | mapPrefix := fmt.Sprintf("%s.%s", prefix, e.String()) 119 | 120 | if mapElement.Kind() == reflect.Ptr { 121 | mapElement = mapElement.Elem() 122 | } 123 | 124 | var props resource.PropertyMap 125 | var err error 126 | 127 | if mapElement.Kind() == reflect.Struct { 128 | props, err = getPlainPropertiesMapWithPrefix(mapElement, mapPrefix) 129 | } else { 130 | props, err = getPropertyMapForValue(mapElement, mapPrefix) 131 | } 132 | 133 | if err != nil { 134 | return nil, err 135 | } 136 | 137 | for k, v := range props { 138 | properties[k] = v 139 | } 140 | } 141 | case reflect.Bool: 142 | properties[key] = resource.NewBoolProperty(value.Bool()) 143 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 144 | properties[key] = resource.NewNumberProperty(float64(value.Int())) 145 | case reflect.Float32, reflect.Float64: 146 | properties[key] = resource.NewNumberProperty(float64(value.Float())) 147 | case reflect.String: 148 | properties[key] = resource.NewStringProperty(value.String()) 149 | case reflect.Invalid: // nil 150 | properties[key] = resource.NewNullProperty() 151 | default: 152 | return nil, fmt.Errorf("Unsupported data type: %s", value.Kind()) 153 | } 154 | 155 | return properties, nil 156 | } 157 | -------------------------------------------------------------------------------- /sdk/go/k0s/provider.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package k0s 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 | "github.com/ydkn/pulumi-k0s/sdk/go/k0s/internal" 12 | ) 13 | 14 | type Provider struct { 15 | pulumi.ProviderResourceState 16 | } 17 | 18 | // NewProvider registers a new resource with the given unique name, arguments, and options. 19 | func NewProvider(ctx *pulumi.Context, 20 | name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error) { 21 | if args == nil { 22 | args = &ProviderArgs{} 23 | } 24 | 25 | if args.Concurrency == nil { 26 | if d := internal.GetEnvOrDefault(30, internal.ParseEnvInt, "PULUMI_K0S_CONCURRENCY"); d != nil { 27 | args.Concurrency = pulumi.IntPtr(d.(int)) 28 | } 29 | } 30 | if args.ConcurrentUploads == nil { 31 | if d := internal.GetEnvOrDefault(5, internal.ParseEnvInt, "PULUMI_K0S_CONCURRENT_UPLOADS"); d != nil { 32 | args.ConcurrentUploads = pulumi.IntPtr(d.(int)) 33 | } 34 | } 35 | if args.NoDrain == nil { 36 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_NO_DRAIN"); d != nil { 37 | args.NoDrain = pulumi.BoolPtr(d.(bool)) 38 | } 39 | } 40 | if args.NoWait == nil { 41 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_NO_WAIT"); d != nil { 42 | args.NoWait = pulumi.BoolPtr(d.(bool)) 43 | } 44 | } 45 | if args.SkipDowngradeCheck == nil { 46 | if d := internal.GetEnvOrDefault(false, internal.ParseEnvBool, "PULUMI_K0S_SKIP_DOWNGRADE_CHECK"); d != nil { 47 | args.SkipDowngradeCheck = pulumi.BoolPtr(d.(bool)) 48 | } 49 | } 50 | opts = internal.PkgResourceDefaultOpts(opts) 51 | var resource Provider 52 | err := ctx.RegisterResource("pulumi:providers:k0s", name, args, &resource, opts...) 53 | if err != nil { 54 | return nil, err 55 | } 56 | return &resource, nil 57 | } 58 | 59 | type providerArgs struct { 60 | // Maximum number of hosts to configure in parallel, set to 0 for unlimited 61 | Concurrency *int `pulumi:"concurrency"` 62 | // Maximum number of files to upload in parallel, set to 0 for unlimited 63 | ConcurrentUploads *int `pulumi:"concurrentUploads"` 64 | // Do not drain worker nodes when upgrading 65 | NoDrain *bool `pulumi:"noDrain"` 66 | // Do not wait for worker nodes to join 67 | NoWait *bool `pulumi:"noWait"` 68 | // Skip downgrade check 69 | SkipDowngradeCheck *bool `pulumi:"skipDowngradeCheck"` 70 | } 71 | 72 | // The set of arguments for constructing a Provider resource. 73 | type ProviderArgs struct { 74 | // Maximum number of hosts to configure in parallel, set to 0 for unlimited 75 | Concurrency pulumi.IntPtrInput 76 | // Maximum number of files to upload in parallel, set to 0 for unlimited 77 | ConcurrentUploads pulumi.IntPtrInput 78 | // Do not drain worker nodes when upgrading 79 | NoDrain pulumi.BoolPtrInput 80 | // Do not wait for worker nodes to join 81 | NoWait pulumi.BoolPtrInput 82 | // Skip downgrade check 83 | SkipDowngradeCheck pulumi.BoolPtrInput 84 | } 85 | 86 | func (ProviderArgs) ElementType() reflect.Type { 87 | return reflect.TypeOf((*providerArgs)(nil)).Elem() 88 | } 89 | 90 | type ProviderInput interface { 91 | pulumi.Input 92 | 93 | ToProviderOutput() ProviderOutput 94 | ToProviderOutputWithContext(ctx context.Context) ProviderOutput 95 | } 96 | 97 | func (*Provider) ElementType() reflect.Type { 98 | return reflect.TypeOf((**Provider)(nil)).Elem() 99 | } 100 | 101 | func (i *Provider) ToProviderOutput() ProviderOutput { 102 | return i.ToProviderOutputWithContext(context.Background()) 103 | } 104 | 105 | func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 106 | return pulumi.ToOutputWithContext(ctx, i).(ProviderOutput) 107 | } 108 | 109 | type ProviderOutput struct{ *pulumi.OutputState } 110 | 111 | func (ProviderOutput) ElementType() reflect.Type { 112 | return reflect.TypeOf((**Provider)(nil)).Elem() 113 | } 114 | 115 | func (o ProviderOutput) ToProviderOutput() ProviderOutput { 116 | return o 117 | } 118 | 119 | func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput { 120 | return o 121 | } 122 | 123 | func init() { 124 | pulumi.RegisterInputType(reflect.TypeOf((*ProviderInput)(nil)).Elem(), &Provider{}) 125 | pulumi.RegisterOutputType(ProviderOutput{}) 126 | } 127 | -------------------------------------------------------------------------------- /sdk/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/ydkn/pulumi-k0s/sdk 2 | 3 | go 1.23.3 4 | 5 | require ( 6 | github.com/blang/semver v3.5.1+incompatible 7 | github.com/pulumi/pulumi/sdk/v3 v3.107.0 8 | ) 9 | 10 | require ( 11 | dario.cat/mergo v1.0.0 // indirect 12 | github.com/Microsoft/go-winio v0.6.1 // indirect 13 | github.com/ProtonMail/go-crypto v1.0.0 // indirect 14 | github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect 15 | github.com/agext/levenshtein v1.2.3 // indirect 16 | github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect 17 | github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect 18 | github.com/atotto/clipboard v0.1.4 // indirect 19 | github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect 20 | github.com/charmbracelet/bubbles v0.18.0 // indirect 21 | github.com/charmbracelet/bubbletea v0.25.0 // indirect 22 | github.com/charmbracelet/lipgloss v0.9.1 // indirect 23 | github.com/cheggaaa/pb v1.0.29 // indirect 24 | github.com/cloudflare/circl v1.3.7 // indirect 25 | github.com/containerd/console v1.0.4 // indirect 26 | github.com/cyphar/filepath-securejoin v0.2.4 // indirect 27 | github.com/djherbis/times v1.6.0 // indirect 28 | github.com/emirpasic/gods v1.18.1 // indirect 29 | github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect 30 | github.com/go-git/go-billy/v5 v5.5.0 // indirect 31 | github.com/go-git/go-git/v5 v5.11.0 // indirect 32 | github.com/gogo/protobuf v1.3.2 // indirect 33 | github.com/golang/glog v1.2.0 // indirect 34 | github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect 35 | github.com/golang/protobuf v1.5.3 // indirect 36 | github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect 37 | github.com/hashicorp/errwrap v1.1.0 // indirect 38 | github.com/hashicorp/go-multierror v1.1.1 // indirect 39 | github.com/hashicorp/hcl/v2 v2.19.1 // indirect 40 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 41 | github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect 42 | github.com/kevinburke/ssh_config v1.2.0 // indirect 43 | github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 44 | github.com/mattn/go-isatty v0.0.20 // indirect 45 | github.com/mattn/go-localereader v0.0.1 // indirect 46 | github.com/mattn/go-runewidth v0.0.15 // indirect 47 | github.com/mitchellh/go-ps v1.0.0 // indirect 48 | github.com/mitchellh/go-wordwrap v1.0.1 // indirect 49 | github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect 50 | github.com/muesli/cancelreader v0.2.2 // indirect 51 | github.com/muesli/reflow v0.3.0 // indirect 52 | github.com/muesli/termenv v0.15.2 // indirect 53 | github.com/opentracing/basictracer-go v1.1.0 // indirect 54 | github.com/opentracing/opentracing-go v1.2.0 // indirect 55 | github.com/pgavlin/fx v0.1.6 // indirect 56 | github.com/pjbgf/sha1cd v0.3.0 // indirect 57 | github.com/pkg/errors v0.9.1 // indirect 58 | github.com/pkg/term v1.1.0 // indirect 59 | github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect 60 | github.com/pulumi/esc v0.8.2 // indirect 61 | github.com/rivo/uniseg v0.4.7 // indirect 62 | github.com/rogpeppe/go-internal v1.12.0 // indirect 63 | github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect 64 | github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect 65 | github.com/sergi/go-diff v1.3.1 // indirect 66 | github.com/skeema/knownhosts v1.2.1 // indirect 67 | github.com/spf13/cast v1.6.0 // indirect 68 | github.com/spf13/cobra v1.8.0 // indirect 69 | github.com/spf13/pflag v1.0.5 // indirect 70 | github.com/texttheater/golang-levenshtein v1.0.1 // indirect 71 | github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect 72 | github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect 73 | github.com/uber/jaeger-lib v2.4.1+incompatible // indirect 74 | github.com/xanzy/ssh-agent v0.3.3 // indirect 75 | github.com/zclconf/go-cty v1.14.2 // indirect 76 | go.uber.org/atomic v1.11.0 // indirect 77 | golang.org/x/crypto v0.19.0 // indirect 78 | golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect 79 | golang.org/x/mod v0.15.0 // indirect 80 | golang.org/x/net v0.21.0 // indirect 81 | golang.org/x/sync v0.6.0 // indirect 82 | golang.org/x/sys v0.17.0 // indirect 83 | golang.org/x/term v0.17.0 // indirect 84 | golang.org/x/text v0.14.0 // indirect 85 | golang.org/x/tools v0.18.0 // indirect 86 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect 87 | google.golang.org/grpc v1.62.0 // indirect 88 | google.golang.org/protobuf v1.32.0 // indirect 89 | gopkg.in/warnings.v0 v0.1.2 // indirect 90 | gopkg.in/yaml.v3 v3.0.1 // indirect 91 | lukechampine.com/frand v1.4.2 // indirect 92 | ) 93 | -------------------------------------------------------------------------------- /sdk/go/k0s/cluster.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package k0s 5 | 6 | import ( 7 | "context" 8 | "reflect" 9 | 10 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 11 | "github.com/ydkn/pulumi-k0s/sdk/go/k0s/internal" 12 | ) 13 | 14 | type Cluster struct { 15 | pulumi.CustomResourceState 16 | 17 | ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 18 | Kind pulumi.StringPtrOutput `pulumi:"kind"` 19 | Kubeconfig pulumi.StringOutput `pulumi:"kubeconfig"` 20 | Metadata ClusterMetadataPtrOutput `pulumi:"metadata"` 21 | Spec ClusterSpecPtrOutput `pulumi:"spec"` 22 | } 23 | 24 | // NewCluster registers a new resource with the given unique name, arguments, and options. 25 | func NewCluster(ctx *pulumi.Context, 26 | name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) { 27 | if args == nil { 28 | args = &ClusterArgs{} 29 | } 30 | 31 | secrets := pulumi.AdditionalSecretOutputs([]string{ 32 | "kubeconfig", 33 | }) 34 | opts = append(opts, secrets) 35 | opts = internal.PkgResourceDefaultOpts(opts) 36 | var resource Cluster 37 | err := ctx.RegisterResource("k0s:index:Cluster", name, args, &resource, opts...) 38 | if err != nil { 39 | return nil, err 40 | } 41 | return &resource, nil 42 | } 43 | 44 | // GetCluster gets an existing Cluster resource's state with the given name, ID, and optional 45 | // state properties that are used to uniquely qualify the lookup (nil if not required). 46 | func GetCluster(ctx *pulumi.Context, 47 | name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) { 48 | var resource Cluster 49 | err := ctx.ReadResource("k0s:index:Cluster", name, id, state, &resource, opts...) 50 | if err != nil { 51 | return nil, err 52 | } 53 | return &resource, nil 54 | } 55 | 56 | // Input properties used for looking up and filtering Cluster resources. 57 | type clusterState struct { 58 | } 59 | 60 | type ClusterState struct { 61 | } 62 | 63 | func (ClusterState) ElementType() reflect.Type { 64 | return reflect.TypeOf((*clusterState)(nil)).Elem() 65 | } 66 | 67 | type clusterArgs struct { 68 | ApiVersion *string `pulumi:"apiVersion"` 69 | Kind *string `pulumi:"kind"` 70 | Metadata *ClusterMetadata `pulumi:"metadata"` 71 | Spec *ClusterSpec `pulumi:"spec"` 72 | } 73 | 74 | // The set of arguments for constructing a Cluster resource. 75 | type ClusterArgs struct { 76 | ApiVersion pulumi.StringPtrInput 77 | Kind pulumi.StringPtrInput 78 | Metadata ClusterMetadataPtrInput 79 | Spec ClusterSpecPtrInput 80 | } 81 | 82 | func (ClusterArgs) ElementType() reflect.Type { 83 | return reflect.TypeOf((*clusterArgs)(nil)).Elem() 84 | } 85 | 86 | type ClusterInput interface { 87 | pulumi.Input 88 | 89 | ToClusterOutput() ClusterOutput 90 | ToClusterOutputWithContext(ctx context.Context) ClusterOutput 91 | } 92 | 93 | func (*Cluster) ElementType() reflect.Type { 94 | return reflect.TypeOf((**Cluster)(nil)).Elem() 95 | } 96 | 97 | func (i *Cluster) ToClusterOutput() ClusterOutput { 98 | return i.ToClusterOutputWithContext(context.Background()) 99 | } 100 | 101 | func (i *Cluster) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 102 | return pulumi.ToOutputWithContext(ctx, i).(ClusterOutput) 103 | } 104 | 105 | type ClusterOutput struct{ *pulumi.OutputState } 106 | 107 | func (ClusterOutput) ElementType() reflect.Type { 108 | return reflect.TypeOf((**Cluster)(nil)).Elem() 109 | } 110 | 111 | func (o ClusterOutput) ToClusterOutput() ClusterOutput { 112 | return o 113 | } 114 | 115 | func (o ClusterOutput) ToClusterOutputWithContext(ctx context.Context) ClusterOutput { 116 | return o 117 | } 118 | 119 | func (o ClusterOutput) ApiVersion() pulumi.StringPtrOutput { 120 | return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 121 | } 122 | 123 | func (o ClusterOutput) Kind() pulumi.StringPtrOutput { 124 | return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 125 | } 126 | 127 | func (o ClusterOutput) Kubeconfig() pulumi.StringOutput { 128 | return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Kubeconfig }).(pulumi.StringOutput) 129 | } 130 | 131 | func (o ClusterOutput) Metadata() ClusterMetadataPtrOutput { 132 | return o.ApplyT(func(v *Cluster) ClusterMetadataPtrOutput { return v.Metadata }).(ClusterMetadataPtrOutput) 133 | } 134 | 135 | func (o ClusterOutput) Spec() ClusterSpecPtrOutput { 136 | return o.ApplyT(func(v *Cluster) ClusterSpecPtrOutput { return v.Spec }).(ClusterSpecPtrOutput) 137 | } 138 | 139 | func init() { 140 | pulumi.RegisterInputType(reflect.TypeOf((*ClusterInput)(nil)).Elem(), &Cluster{}) 141 | pulumi.RegisterOutputType(ClusterOutput{}) 142 | } 143 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME := Pulumi k0s Resource Provider 2 | 3 | PACK := k0s 4 | PACKDIR := sdk 5 | PROJECT := github.com/ydkn/pulumi-k0s 6 | NODE_MODULE_NAME := @ydkn/pulumi-k0s 7 | NUGET_PKG_NAME := Pulumi.K0s 8 | 9 | PROVIDER := pulumi-resource-${PACK} 10 | VERSION ?= $(shell pulumictl get version) 11 | PROVIDER_PATH := provider 12 | VERSION_PATH := ${PROVIDER_PATH}.Version 13 | 14 | GOPATH := $(shell go env GOPATH) 15 | 16 | WORKING_DIR := $(shell pwd) 17 | EXAMPLES_DIR := ${WORKING_DIR}/examples/yaml 18 | TESTPARALLELISM := 4 19 | 20 | ensure:: 21 | cd provider && go mod tidy 22 | cd sdk && go mod tidy 23 | cd tests && go mod tidy 24 | 25 | provider:: 26 | (cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) 27 | 28 | provider_debug:: 29 | (cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -gcflags="all=-N -l" -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER)) 30 | 31 | test_provider:: 32 | cd tests && go test -short -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM} ./... 33 | 34 | dotnet_sdk:: DOTNET_VERSION := $(shell pulumictl get version --language dotnet) 35 | dotnet_sdk:: 36 | rm -rf sdk/dotnet 37 | pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language dotnet 38 | cp README.md LICENSE ${PACKDIR}/dotnet/ && \ 39 | cd ${PACKDIR}/dotnet/&& \ 40 | echo "${DOTNET_VERSION}" >version.txt && \ 41 | dotnet build /p:Version=${DOTNET_VERSION} 42 | 43 | go_sdk:: $(WORKING_DIR)/bin/$(PROVIDER) 44 | rm -rf sdk/go 45 | pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language go 46 | 47 | nodejs_sdk:: VERSION := $(shell pulumictl get version --language javascript) 48 | nodejs_sdk:: NODE_PACKAGE_NAME := $(shell echo -n $(NODE_MODULE_NAME) | sed -r 's/\//\\\//g') 49 | nodejs_sdk:: 50 | rm -rf sdk/nodejs 51 | pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language nodejs 52 | cd ${PACKDIR}/nodejs/ && \ 53 | echo $(NODE_PACKAGE_NAME) && \ 54 | sed -i.bak 's/"name": "@pulumi.*"/"name": "$(NODE_PACKAGE_NAME)"/g' package.json && \ 55 | rm ./package.json.bak && \ 56 | yarn install && \ 57 | yarn run tsc && \ 58 | cp ../../README.md ../../LICENSE package.json yarn.lock bin/ && \ 59 | sed -i.bak 's/$${VERSION}/$(VERSION)/g' bin/package.json && \ 60 | rm ./bin/package.json.bak 61 | 62 | python_sdk:: PYPI_VERSION := $(shell pulumictl get version --language python) 63 | python_sdk:: 64 | rm -rf sdk/python 65 | pulumi package gen-sdk $(WORKING_DIR)/bin/$(PROVIDER) --language python 66 | cp README.md LICENSE ${PACKDIR}/python/ && \ 67 | cd ${PACKDIR}/python/ && \ 68 | python3 setup.py clean --all 2>/dev/null && \ 69 | rm -rf ./bin/ ../python.bin/ && cp -R . ../python.bin && mv ../python.bin ./bin && \ 70 | sed -i.bak -e 's/^VERSION = .*/VERSION = "$(PYPI_VERSION)"/g' -e 's/^PLUGIN_VERSION = .*/PLUGIN_VERSION = "$(VERSION)"/g' ./bin/setup.py && \ 71 | rm ./bin/setup.py.bak && \ 72 | cd ./bin && python3 setup.py build sdist 73 | 74 | gen_examples: gen_go_example \ 75 | gen_nodejs_example \ 76 | gen_python_example \ 77 | gen_dotnet_example 78 | 79 | gen_%_example: 80 | rm -rf ${WORKING_DIR}/examples/$* 81 | pulumi convert \ 82 | --cwd ${WORKING_DIR}/examples/yaml \ 83 | --logtostderr \ 84 | --generate-only \ 85 | --non-interactive \ 86 | --language $* \ 87 | --out ${WORKING_DIR}/examples/$* 88 | 89 | define pulumi_login 90 | export PULUMI_CONFIG_PASSPHRASE=asdfqwerty1234; \ 91 | pulumi login --local; 92 | endef 93 | 94 | up:: 95 | $(call pulumi_login) \ 96 | cd ${EXAMPLES_DIR} && \ 97 | pulumi stack init dev && \ 98 | pulumi stack select dev && \ 99 | pulumi config set name dev && \ 100 | pulumi up -y 101 | 102 | down:: 103 | $(call pulumi_login) \ 104 | cd ${EXAMPLES_DIR} && \ 105 | pulumi stack select dev && \ 106 | pulumi destroy -y && \ 107 | pulumi stack rm dev -y 108 | 109 | .PHONY: build 110 | 111 | build:: provider dotnet_sdk go_sdk nodejs_sdk python_sdk 112 | 113 | # Required for the codegen action that runs in pulumi/pulumi 114 | only_build:: build 115 | 116 | lint:: 117 | for DIR in "provider" "sdk" "tests" ; do \ 118 | pushd $$DIR && golangci-lint run -c ../.golangci.yml --timeout 10m && popd ; \ 119 | done 120 | 121 | install:: install_nodejs_sdk install_dotnet_sdk 122 | cp $(WORKING_DIR)/bin/${PROVIDER} ${GOPATH}/bin 123 | 124 | GO_TEST := go test -v -count=1 -cover -timeout 2h -parallel ${TESTPARALLELISM} 125 | 126 | test_all:: test_provider 127 | cd tests/sdk/nodejs && $(GO_TEST) ./... 128 | cd tests/sdk/python && $(GO_TEST) ./... 129 | cd tests/sdk/dotnet && $(GO_TEST) ./... 130 | cd tests/sdk/go && $(GO_TEST) ./... 131 | 132 | install_dotnet_sdk:: 133 | rm -rf $(WORKING_DIR)/nuget/$(NUGET_PKG_NAME).*.nupkg 134 | mkdir -p $(WORKING_DIR)/nuget 135 | find . -name '*.nupkg' -print -exec cp -p {} ${WORKING_DIR}/nuget \; 136 | 137 | install_python_sdk:: 138 | #target intentionally blank 139 | 140 | install_go_sdk:: 141 | #target intentionally blank 142 | 143 | install_nodejs_sdk:: 144 | -yarn unlink --cwd $(WORKING_DIR)/sdk/nodejs/bin 145 | yarn link --cwd $(WORKING_DIR)/sdk/nodejs/bin 146 | -------------------------------------------------------------------------------- /sdk/go/k0s/internal/pulumiUtilities.go: -------------------------------------------------------------------------------- 1 | // Code generated by pulumi-language-go DO NOT EDIT. 2 | // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 | 4 | package internal 5 | 6 | import ( 7 | "fmt" 8 | "os" 9 | "reflect" 10 | "regexp" 11 | "strconv" 12 | "strings" 13 | 14 | "github.com/blang/semver" 15 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 16 | ) 17 | 18 | import ( 19 | "github.com/pulumi/pulumi/sdk/v3/go/pulumi/internals" 20 | ) 21 | 22 | type envParser func(v string) interface{} 23 | 24 | func ParseEnvBool(v string) interface{} { 25 | b, err := strconv.ParseBool(v) 26 | if err != nil { 27 | return nil 28 | } 29 | return b 30 | } 31 | 32 | func ParseEnvInt(v string) interface{} { 33 | i, err := strconv.ParseInt(v, 0, 0) 34 | if err != nil { 35 | return nil 36 | } 37 | return int(i) 38 | } 39 | 40 | func ParseEnvFloat(v string) interface{} { 41 | f, err := strconv.ParseFloat(v, 64) 42 | if err != nil { 43 | return nil 44 | } 45 | return f 46 | } 47 | 48 | func ParseEnvStringArray(v string) interface{} { 49 | var result pulumi.StringArray 50 | for _, item := range strings.Split(v, ";") { 51 | result = append(result, pulumi.String(item)) 52 | } 53 | return result 54 | } 55 | 56 | func GetEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { 57 | for _, v := range vars { 58 | if value, ok := os.LookupEnv(v); ok { 59 | if parser != nil { 60 | return parser(value) 61 | } 62 | return value 63 | } 64 | } 65 | return def 66 | } 67 | 68 | // PkgVersion uses reflection to determine the version of the current package. 69 | // If a version cannot be determined, v1 will be assumed. The second return 70 | // value is always nil. 71 | func PkgVersion() (semver.Version, error) { 72 | // emptyVersion defaults to v0.0.0 73 | if !SdkVersion.Equals(semver.Version{}) { 74 | return SdkVersion, nil 75 | } 76 | type sentinal struct{} 77 | pkgPath := reflect.TypeOf(sentinal{}).PkgPath() 78 | re := regexp.MustCompile("^.*/pulumi-k0s/sdk(/v\\d+)?") 79 | if match := re.FindStringSubmatch(pkgPath); match != nil { 80 | vStr := match[1] 81 | if len(vStr) == 0 { // If the version capture group was empty, default to v1. 82 | return semver.Version{Major: 1}, nil 83 | } 84 | return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil 85 | } 86 | return semver.Version{Major: 1}, nil 87 | } 88 | 89 | // isZero is a null safe check for if a value is it's types zero value. 90 | func IsZero(v interface{}) bool { 91 | if v == nil { 92 | return true 93 | } 94 | return reflect.ValueOf(v).IsZero() 95 | } 96 | 97 | func CallPlain( 98 | ctx *pulumi.Context, 99 | tok string, 100 | args pulumi.Input, 101 | output pulumi.Output, 102 | self pulumi.Resource, 103 | property string, 104 | resultPtr reflect.Value, 105 | errorPtr *error, 106 | opts ...pulumi.InvokeOption, 107 | ) { 108 | res, err := callPlainInner(ctx, tok, args, output, self, opts...) 109 | if err != nil { 110 | *errorPtr = err 111 | return 112 | } 113 | 114 | v := reflect.ValueOf(res) 115 | 116 | // extract res.property field if asked to do so 117 | if property != "" { 118 | v = v.FieldByName("Res") 119 | } 120 | 121 | // return by setting the result pointer; this style of returns shortens the generated code without generics 122 | resultPtr.Elem().Set(v) 123 | } 124 | 125 | func callPlainInner( 126 | ctx *pulumi.Context, 127 | tok string, 128 | args pulumi.Input, 129 | output pulumi.Output, 130 | self pulumi.Resource, 131 | opts ...pulumi.InvokeOption, 132 | ) (any, error) { 133 | o, err := ctx.Call(tok, args, output, self, opts...) 134 | if err != nil { 135 | return nil, err 136 | } 137 | 138 | outputData, err := internals.UnsafeAwaitOutput(ctx.Context(), o) 139 | if err != nil { 140 | return nil, err 141 | } 142 | 143 | // Ingoring deps silently. They are typically non-empty, r.f() calls include r as a dependency. 144 | known := outputData.Known 145 | value := outputData.Value 146 | secret := outputData.Secret 147 | 148 | problem := "" 149 | if !known { 150 | problem = "an unknown value" 151 | } else if secret { 152 | problem = "a secret value" 153 | } 154 | 155 | if problem != "" { 156 | return nil, fmt.Errorf("Plain resource method %q incorrectly returned %s. "+ 157 | "This is an error in the provider, please report this to the provider developer.", 158 | tok, problem) 159 | } 160 | 161 | return value, nil 162 | } 163 | 164 | // PkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. 165 | func PkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { 166 | defaults := []pulumi.ResourceOption{} 167 | defaults = append(defaults, pulumi.PluginDownloadURL("https://repo.ydkn.io/pulumi-k0s")) 168 | version := SdkVersion 169 | if !version.Equals(semver.Version{}) { 170 | defaults = append(defaults, pulumi.Version(version.String())) 171 | } 172 | return append(defaults, opts...) 173 | } 174 | 175 | // PkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. 176 | func PkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { 177 | defaults := []pulumi.InvokeOption{} 178 | defaults = append(defaults, pulumi.PluginDownloadURL("https://repo.ydkn.io/pulumi-k0s")) 179 | version := SdkVersion 180 | if !version.Equals(semver.Version{}) { 181 | defaults = append(defaults, pulumi.Version(version.String())) 182 | } 183 | return append(defaults, opts...) 184 | } 185 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | on: 3 | push: 4 | tags: 5 | - v*.*.* 6 | - "!v*.*.*-**" 7 | env: 8 | PROVIDER: "k0s" 9 | # THIS GITHUB_TOKEN IS A REQUIREMENT TO BE ABLE TO WRITE TO GH RELEASES 10 | GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} 11 | # IF YOU NEED TO PUBLISH A NPM PACKAGE THEN ENSURE A NPM_TOKEN SECRET IS SET 12 | # AND PUBLISH_NPM: TRUE. IF YOU WANT TO PUBLISH TO A PRIVATE NPM REGISTRY 13 | # THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED 14 | NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 15 | NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} 16 | PUBLISH_NPM: true 17 | NPM_REGISTRY_URL: https://registry.npmjs.org 18 | # IF YOU NEED TO PUBLISH A NUGET PACKAGE THEN ENSURE AN NUGET_PUBLISH_KEY 19 | # SECRET IS SET AND PUBLISH_NUGET: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE 20 | # NPM REGISTRY THEN ENSURE THE NPM_REGISTRY_URL IS CHANGED 21 | NUGET_PUBLISH_KEY: ${{ secrets.NUGET_PUBLISH_KEY }} 22 | NUGET_FEED_URL: https://api.nuget.org/v3/index.json 23 | PUBLISH_NUGET: true 24 | # IF YOU NEED TO PUBLISH A PYPI PACKAGE THEN ENSURE AN PYPI_API_TOKEN 25 | # SECRET IS SET AND PUBLISH_PYPI: TRUE. IF YOU WANT TO PUBLISH TO AN ALTERNATIVE 26 | # PYPI REGISTRY THEN ENSURE THE PYPI_REPOSITORY_URL IS SET. IF YOU ARE USING AN API_TOKEN THEN 27 | # YOU DO NOT NEED TO CHANGE THE PYPI_USERNAME (__token__) , IF YOU ARE USING PASSWORD AUTHENTICATION THEN YOU WILL 28 | # NEED TO CHANGE TO USE THE CORRECT PASSWORD 29 | PYPI_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} 30 | PYPI_USERNAME: ${{ secrets.PYPI_AUTH_USERNAME }} 31 | PYPI_REPOSITORY_URL: "" 32 | PUBLISH_PYPI: true 33 | jobs: 34 | publish_binary: 35 | name: publish 36 | runs-on: ubuntu-latest 37 | steps: 38 | - name: Checkout Repo 39 | uses: actions/checkout@v2 40 | - name: Unshallow clone for tags 41 | run: git fetch --prune --unshallow --tags 42 | - name: Install Go 43 | uses: actions/setup-go@v2 44 | with: 45 | go-version: ${{matrix.goversion}} 46 | - name: Install pulumictl 47 | uses: jaxxstorm/action-install-gh-release@v1.5.0 48 | with: 49 | repo: pulumi/pulumictl 50 | - name: Run GoReleaser 51 | uses: goreleaser/goreleaser-action@v2 52 | with: 53 | args: -p 3 release --clean 54 | version: latest 55 | - name: Publish provider packages 56 | uses: imehedi/actions-awscli-v2@latest 57 | with: 58 | args: s3 cp --endpoint-url="${{ secrets.AWS_ENDPOINT_URL }}" dist/ "s3://${{ secrets.AWS_S3_BUCKET }}/pulumi-k0s/" --recursive --exclude="*" --include="pulumi-resource-*.tar.gz" 59 | env: 60 | AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" 61 | AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" 62 | AWS_REGION: "${{ secrets.AWS_REGION }}" 63 | strategy: 64 | fail-fast: true 65 | matrix: 66 | goversion: 67 | - 1.23.x 68 | publish_sdk: 69 | name: Publish SDKs 70 | runs-on: ubuntu-latest 71 | needs: publish_binary 72 | steps: 73 | - name: Checkout Repo 74 | uses: actions/checkout@v2 75 | - name: Unshallow clone for tags 76 | run: git fetch --prune --unshallow --tags 77 | - name: Install Go 78 | uses: actions/setup-go@v2 79 | with: 80 | go-version: ${{ matrix.goversion }} 81 | - name: Install pulumictl 82 | uses: jaxxstorm/action-install-gh-release@v1.13.0 83 | with: 84 | repo: pulumi/pulumictl 85 | - name: Install Pulumi CLI 86 | uses: pulumi/action-install-pulumi-cli@v2.0.0 87 | - name: Build 88 | id: build 89 | run: | 90 | make provider 91 | - name: Setup Node 92 | uses: actions/setup-node@v1 93 | with: 94 | node-version: ${{matrix.nodeversion}} 95 | registry-url: ${{env.NPM_REGISTRY_URL}} 96 | - name: Setup DotNet 97 | uses: actions/setup-dotnet@v1 98 | with: 99 | dotnet-version: ${{matrix.dotnetversion}} 100 | - name: Setup Python 101 | uses: actions/setup-python@v1 102 | with: 103 | python-version: ${{matrix.pythonversion}} 104 | - name: Generate SDK 105 | run: make ${{ matrix.language }}_sdk 106 | - name: Check worktree clean 107 | run: | 108 | git update-index -q --refresh 109 | if ! git diff-files --quiet; then 110 | >&2 echo "error: working tree is not clean, aborting!" 111 | git status 112 | git diff 113 | exit 1 114 | fi 115 | - name: Compress SDK folder 116 | run: tar -zcf sdk/${{ matrix.language }}.tar.gz -C sdk/${{ matrix.language }} . 117 | - name: Upload artifacts 118 | uses: actions/upload-artifact@v4 119 | with: 120 | name: ${{ matrix.language }}-sdk.tar.gz 121 | path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz 122 | - if: ${{ matrix.language == 'python' && env.PUBLISH_PYPI == 'true' }} 123 | name: Publish package to PyPI 124 | uses: pypa/gh-action-pypi-publish@release/v1 125 | with: 126 | user: ${{ env.PYPI_USERNAME }} 127 | password: ${{ env.PYPI_PASSWORD }} 128 | packages-dir: ${{github.workspace}}/sdk/python/bin/dist 129 | - if: ${{ matrix.language == 'nodejs' && env.PUBLISH_NPM == 'true' }} 130 | uses: JS-DevTools/npm-publish@v3 131 | with: 132 | access: "public" 133 | token: ${{ env.NPM_TOKEN }} 134 | package: ${{github.workspace}}/sdk/nodejs/bin/package.json 135 | - if: ${{ matrix.language == 'dotnet' && env.PUBLISH_NUGET == 'true' }} 136 | name: publish nuget package 137 | run: | 138 | dotnet nuget push ${{github.workspace}}/sdk/dotnet/bin/Debug/*.nupkg -s ${{ env.NUGET_FEED_URL }} -k ${{ env.NUGET_PUBLISH_KEY }} 139 | echo "done publishing packages" 140 | strategy: 141 | fail-fast: true 142 | matrix: 143 | dotnetversion: 144 | - "7.0.116" 145 | goversion: 146 | - 1.23.x 147 | language: 148 | - nodejs 149 | - python 150 | - dotnet 151 | - go 152 | nodeversion: 153 | - 22.x 154 | pythonversion: 155 | - "3.11" 156 | --------------------------------------------------------------------------------