diff --git a/docs/_index.md b/docs/_index.md index 4982f16..5b63352 100644 --- a/docs/_index.md +++ b/docs/_index.md @@ -510,17 +510,15 @@ func main() { } kubernetes, err := threefold.NewKubernetes(ctx, "kubernetes", &threefold.KubernetesArgs{ Master: &threefold.K8sNodeInputArgs{ - VMInput: &threefold.VMInput{ - Name: pulumi.String("kubernetes"), - Network_name: pulumi.String("test"), - NodeID: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) { - return nodes[0], nil - }).(pulumi.IntOutput), - Planetary: pulumi.Bool(true), - Mycelium: pulumi.Bool(true), - Cpu: pulumi.Int(2), - Memory: pulumi.Int(2048), - }, + Name: pulumi.String("kubernetes"), + Network_name: pulumi.String("test"), + NodeID: scheduler.Nodes.ApplyT(func(nodes []int) (int, error) { + return nodes[0], nil + }).(pulumi.IntOutput), + Planetary: pulumi.Bool(true), + Mycelium: pulumi.Bool(true), + Cpu: pulumi.Int(2), + Memory: pulumi.Int(2048), Disk_size: pulumi.Int(2), }, Workers: threefold.K8sNodeInputArray{ diff --git a/go.work.sum b/go.work.sum index a3f3ab8..0a8268a 100644 --- a/go.work.sum +++ b/go.work.sum @@ -751,15 +751,12 @@ github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20240416134707 github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20240416134707-eb36aa90df2d/go.mod h1:dtDKAPiUDxAwIkfHV7xcAFZcOm+xwNIuOI1MLFS+MeQ= github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.11 h1:FmEQplYSZ6pYslmBlUNaUabScOdi6hJialeV/yq0BrY= github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.11/go.mod h1:Obsv0kspgSSwF8jb91Z7CBY2FCQNq6RhiZXIQf26nWY= -github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17 h1:JwjhOz4mSV0qL0/oF+fdLYtE+l0s7fFjObunzTairYA= -github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17/go.mod h1:MwKEEeKN7qApCdabKRBTs18lrJ6JzA2Xx5Hd2/zb4o0= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.10 h1:If91FVqQgd2mZutMMUIrapsqZKDN8/hL5r5Yfr+vFK0= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.10/go.mod h1:yg1BDRR/TSr87mkjxEfsKc0VzMTJcbg87WW7C0GUPXQ= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.11 h1:qsSICIj5cvoVBR4GLWmdu2n3FfJG5isJ2ABnNNWykLU= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.11/go.mod h1:7cKHvKPpfdCpU4a/VCznRDDNMPBPI98cJ0uVJoUGrgg= -github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.17 h1:rI9viGoLdgMX62Y1nFN6Utjbjp3ovZRfzImZBeNB5K4= -github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.17/go.mod h1:2Z7uJYHeilN7bASpmkcDxtl+3AT8tim6iIvqZ08pwCg= -github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.17/go.mod h1:cDTivSsUl4r1jN+H8/W6yDqByOOliY8HEGuVuL3ixV8= +github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.16 h1:Bnt9POje9hc9nv1YwAu13ABnl63DBMH0qL4SeVhNsIQ= +github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.16/go.mod h1:2Z7uJYHeilN7bASpmkcDxtl+3AT8tim6iIvqZ08pwCg= github.com/threefoldtech/zbus v1.0.1/go.mod h1:E/v/xEvG/l6z/Oj0aDkuSUXFm/1RVJkhKBwDTAIdsHo= github.com/threefoldtech/zos v0.5.6-0.20240611092312-66184cdeb953 h1:hzqMY2Ydb+N2TBrTJHpy5n5i5nflfre1dhoNQH/tfhI= github.com/threefoldtech/zos v0.5.6-0.20240611092312-66184cdeb953/go.mod h1:yH6T43SiHvQBBuLgKGElECsIhqzJ6fy/dJyaxtO/X0M= diff --git a/provider/annotations.go b/provider/annotations.go index 66fb6c6..7acf47d 100644 --- a/provider/annotations.go +++ b/provider/annotations.go @@ -2,12 +2,11 @@ package provider import ( "fmt" + "os" "github.com/pulumi/pulumi-go-provider/infer" ) -// TODO: computed - var _ = (infer.Annotated)((*NetworkArgs)(nil)) var _ = (infer.Annotated)((*NetworkState)(nil)) @@ -80,7 +79,7 @@ func (v *VMInput) Annotate(a infer.Annotator) { a.Describe(&v.Description, "The description of the virtual machine workload, optional with no restrictions") a.Describe(&v.NodeID, "The node ID to deploy the virtual machine on, required and should match the requested resources") a.Describe(&v.Flist, "The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist") - a.Describe(&v.Entrypoint, "The entry point for the flist. Example: /sbin/zinit init") + a.Describe(&v.EntryPoint, "The entry point for the flist. Example: /sbin/zinit init") a.Describe(&v.FlistChecksum, "The checksum of the flist which should match the checksum of the given flist, optional") a.Describe(&v.CPU, "The cpu units needed for the virtual machine. Range in [1: 32]") a.Describe(&v.Memory, "The memory capacity for the virtual machine in MB. Min is 250 MB") @@ -183,6 +182,7 @@ var _ = (infer.Annotated)((*K8sNodeInput)(nil)) func (k *KubernetesArgs) Annotate(a infer.Annotator) { a.SetDefault(&k.SolutionType, fmt.Sprintf("kubernetes/%s", k.Master.Name)) + a.SetDefault(&k.SSHKey, os.Getenv("SSH_KEY")) // for testing purposes a.Describe(&k.Master, "Master holds the configuration of master node in the kubernetes cluster") a.Describe(&k.Workers, "Workers is a list holding the workers configuration for the kubernetes cluster") @@ -190,6 +190,9 @@ func (k *KubernetesArgs) Annotate(a infer.Annotator) { a.Describe(&k.SolutionType, "The solution type of the cluster, displayed as project name in contract metadata") a.Describe(&k.SSHKey, "SSH key to access the cluster nodes") a.Describe(&k.Token, "The cluster secret token. Each node has to have this token to be part of the cluster. This token should be an alphanumeric non-empty string") + a.Describe(&k.Flist, "The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist") + a.Describe(&k.EntryPoint, "The entry point for the flist. Example: /sbin/zinit init") + a.Describe(&k.FlistChecksum, "The checksum of the flist which should match the checksum of the given flist, optional") } func (k *KubernetesState) Annotate(a infer.Annotator) { @@ -200,6 +203,23 @@ func (k *KubernetesState) Annotate(a infer.Annotator) { } func (k *K8sNodeInput) Annotate(a infer.Annotator) { + a.SetDefault(&k.Flist, "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist") + a.SetDefault(&k.EntryPoint, "/sbin/zinit init") + + a.Describe(&k.Name, "The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported") + a.Describe(&k.NetworkName, "The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist") + a.Describe(&k.Description, "The description of the kubernetes node, optional with no restrictions") + a.Describe(&k.NodeID, "The node ID to deploy the kubernetes node on, required and should match the requested resources") + a.Describe(&k.Flist, "The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist") + a.Describe(&k.EntryPoint, "The entry point for the flist. Example: /sbin/zinit init") + a.Describe(&k.FlistChecksum, "The checksum of the flist which should match the checksum of the given flist, optional") + a.Describe(&k.CPU, "The cpu units needed for the kubernetes node. Range in [1: 32]") + a.Describe(&k.Memory, "The memory capacity for the kubernetes node in MB. Min is 250 MB") + a.Describe(&k.Mycelium, "A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node") + a.Describe(&k.MyceliumIPSeed, "The seed used for mycelium IP generated for the kubernetes node. It's length should be 6") + a.Describe(&k.Planetary, "A flag to enable generating a yggdrasil IP for the kubernetes node") + a.Describe(&k.PublicIP, "A flag to enable generating a public IP for the kubernetes node, public node is required for it") + a.Describe(&k.PublicIP6, "A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it") a.Describe(&k.DiskSize, "Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs)") } diff --git a/provider/cmd/pulumi-resource-threefold/schema.json b/provider/cmd/pulumi-resource-threefold/schema.json index 6017db2..779ed0b 100644 --- a/provider/cmd/pulumi-resource-threefold/schema.json +++ b/provider/cmd/pulumi-resource-threefold/schema.json @@ -155,64 +155,45 @@ "properties": { "cpu": { "type": "integer", - "description": "The cpu units needed for the virtual machine. Range in [1: 32]" + "description": "The cpu units needed for the kubernetes node. Range in [1: 32]" }, "description": { "type": "string", - "description": "The description of the virtual machine workload, optional with no restrictions" + "description": "The description of the kubernetes node, optional with no restrictions" }, "disk_size": { "type": "integer", "description": "Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs)" }, - "entrypoint": { + "entry_point": { "type": "string", - "description": "The entry point for the flist. Example: /sbin/zinit init" - }, - "env_vars": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "The environment variables to be passed to the virtual machine. Example: SSH_KEY" + "description": "The entry point for the flist. Example: /sbin/zinit init", + "default": "/sbin/zinit init" }, "flist": { "type": "string", - "description": "The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist" + "description": "The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist", + "default": "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist" }, "flist_checksum": { "type": "string", "description": "The checksum of the flist which should match the checksum of the given flist, optional" }, - "gpus": { - "type": "array", - "items": { - "type": "string" - }, - "description": "A list of gpu IDs to be used in the virtual machine. GPU ID format: \u003cslot\u003e/\u003cvendor\u003e/\u003cdevice\u003e. Example: 0000:28:00.0/1002/731f" - }, "memory": { "type": "integer", - "description": "The memory capacity for the virtual machine in MB. Min is 250 MB" - }, - "mounts": { - "type": "array", - "items": { - "$ref": "#/types/threefold:index:Mount" - }, - "description": "A list of mounted disks or volumes" + "description": "The memory capacity for the kubernetes node in MB. Min is 250 MB" }, "mycelium": { "type": "boolean", - "description": "A flag to generate a random mycelium IP seed to support mycelium in the virtual machine" + "description": "A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node" }, "mycelium_ip_seed": { "type": "string", - "description": "The seed used for mycelium IP generated for the virtual machine. It's length should be 6" + "description": "The seed used for mycelium IP generated for the kubernetes node. It's length should be 6" }, "name": { "type": "string", - "description": "The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported" + "description": "The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported" }, "network_name": { "type": "string", @@ -220,37 +201,25 @@ }, "node_id": { "$ref": "pulumi.json#/Any", - "description": "The node ID to deploy the virtual machine on, required and should match the requested resources" + "description": "The node ID to deploy the kubernetes node on, required and should match the requested resources" }, "planetary": { "type": "boolean", - "description": "A flag to enable generating a yggdrasil IP for the virtual machine" + "description": "A flag to enable generating a yggdrasil IP for the kubernetes node" }, "public_ip": { "type": "boolean", - "description": "A flag to enable generating a public IP for the virtual machine, public node is required for it" + "description": "A flag to enable generating a public IP for the kubernetes node, public node is required for it" }, "public_ip6": { "type": "boolean", - "description": "A flag to enable generating a public IPv6 for the virtual machine, public node is required for it" - }, - "rootfs_size": { - "type": "integer", - "description": "The root fs size in GB (type SSD). Can be set as 0 to get the default minimum" - }, - "zlogs": { - "type": "array", - "items": { - "$ref": "#/types/threefold:index:Zlog" - }, - "description": "A list of virtual machine loggers" + "description": "A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it" } }, "type": "object", "required": [ "cpu", "disk_size", - "flist", "memory", "name", "network_name", @@ -1083,6 +1052,18 @@ }, "threefold:index:Kubernetes": { "properties": { + "entry_point": { + "type": "string", + "description": "The entry point for the flist. Example: /sbin/zinit init" + }, + "flist": { + "type": "string", + "description": "The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist" + }, + "flist_checksum": { + "type": "string", + "description": "The checksum of the flist which should match the checksum of the given flist, optional" + }, "master": { "$ref": "#/types/threefold:index:K8sNodeInput", "description": "Master holds the configuration of master node in the kubernetes cluster" @@ -1116,7 +1097,8 @@ }, "ssh_key": { "type": "string", - "description": "SSH key to access the cluster nodes" + "description": "SSH key to access the cluster nodes", + "default": "" }, "token": { "type": "string", @@ -1149,6 +1131,18 @@ "workers_computed" ], "inputProperties": { + "entry_point": { + "type": "string", + "description": "The entry point for the flist. Example: /sbin/zinit init" + }, + "flist": { + "type": "string", + "description": "The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist" + }, + "flist_checksum": { + "type": "string", + "description": "The checksum of the flist which should match the checksum of the given flist, optional" + }, "master": { "$ref": "#/types/threefold:index:K8sNodeInput", "description": "Master holds the configuration of master node in the kubernetes cluster" @@ -1164,7 +1158,8 @@ }, "ssh_key": { "type": "string", - "description": "SSH key to access the cluster nodes" + "description": "SSH key to access the cluster nodes", + "default": "" }, "token": { "type": "string", diff --git a/provider/deployment_parser.go b/provider/deployment_parser.go index 1a5bc29..7423073 100644 --- a/provider/deployment_parser.go +++ b/provider/deployment_parser.go @@ -63,7 +63,7 @@ type VMInput struct { Description string `pulumi:"description,optional"` GPUs []zos.GPU `pulumi:"gpus,optional"` RootfsSize int `pulumi:"rootfs_size,optional"` - Entrypoint string `pulumi:"entrypoint,optional"` + EntryPoint string `pulumi:"entrypoint,optional"` Mounts []Mount `pulumi:"mounts,optional"` Zlogs []Zlog `pulumi:"zlogs,optional"` EnvVars map[string]string `pulumi:"env_vars,optional"` @@ -210,7 +210,7 @@ func parseInputToDeployment(deploymentArgs DeploymentArgs) (workloads.Deployment CPU: uint8(vm.CPU), MemoryMB: uint64(vm.Memory), RootfsSizeMB: uint64(vm.RootfsSize), - Entrypoint: vm.Entrypoint, + Entrypoint: vm.EntryPoint, Mounts: mounts, Zlogs: zlogs, EnvVars: vm.EnvVars, @@ -347,7 +347,7 @@ func parseDeploymentToState(deployment workloads.Deployment) DeploymentState { CPU: int(vm.CPU), Memory: int(vm.MemoryMB), RootfsSize: int(vm.RootfsSizeMB), - Entrypoint: vm.Entrypoint, + EntryPoint: vm.Entrypoint, Mounts: mounts, Zlogs: zlogs, EnvVars: vm.EnvVars, diff --git a/provider/deployment_parser_test.go b/provider/deployment_parser_test.go index 3be558d..1690f59 100644 --- a/provider/deployment_parser_test.go +++ b/provider/deployment_parser_test.go @@ -42,7 +42,7 @@ func generateInputs() (Disk, ZDBInput, VMInput, QSFSInput, DeploymentArgs) { Description: "vm-description", GPUs: []zos.GPU{"gpu"}, RootfsSize: 0, - Entrypoint: "entrypoint", + EntryPoint: "entrypoint", Mounts: []Mount{{ Name: diskInput.Name, MountPoint: fmt.Sprintf("/%s", diskInput.Name), diff --git a/provider/go.mod b/provider/go.mod index b49c39d..755c57d 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -8,7 +8,7 @@ require ( github.com/pulumi/pulumi/pkg/v3 v3.134.0 github.com/pulumi/pulumi/sdk/v3 v3.134.0 github.com/stretchr/testify v1.9.0 - github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17-0.20240904123303-a296d35314f5 + github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17 github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.16 github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6 @@ -172,7 +172,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/texttheater/golang-levenshtein v1.0.1 // indirect github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20240827163226-d4e15e206974 // indirect - github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.16 // indirect + github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.17 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect github.com/vedhavyas/go-subkey v1.0.3 // indirect diff --git a/provider/go.sum b/provider/go.sum index 98634ea..92579ee 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -558,12 +558,12 @@ github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqa github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20240827163226-d4e15e206974 h1:95Ox9WYNiwm3mVJeVF/lp7iCpVGA28AkU1atN893eDo= github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20240827163226-d4e15e206974/go.mod h1:dtDKAPiUDxAwIkfHV7xcAFZcOm+xwNIuOI1MLFS+MeQ= -github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17-0.20240904123303-a296d35314f5 h1:MHzGVSmShASc+6nt6advdjzZjr/ae7g2WJXLDHTKOIc= -github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17-0.20240904123303-a296d35314f5/go.mod h1:MwKEEeKN7qApCdabKRBTs18lrJ6JzA2Xx5Hd2/zb4o0= +github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17 h1:JwjhOz4mSV0qL0/oF+fdLYtE+l0s7fFjObunzTairYA= +github.com/threefoldtech/tfgrid-sdk-go/grid-client v0.15.17/go.mod h1:MwKEEeKN7qApCdabKRBTs18lrJ6JzA2Xx5Hd2/zb4o0= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.16 h1:Bnt9POje9hc9nv1YwAu13ABnl63DBMH0qL4SeVhNsIQ= github.com/threefoldtech/tfgrid-sdk-go/grid-proxy v0.15.16/go.mod h1:2Z7uJYHeilN7bASpmkcDxtl+3AT8tim6iIvqZ08pwCg= -github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.16 h1:xe3LgMdznykz6d6cOFBt2s+sq3XooOVn20aHOZ3gbQE= -github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.16/go.mod h1:cDTivSsUl4r1jN+H8/W6yDqByOOliY8HEGuVuL3ixV8= +github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.17 h1:0pdPsy5KekfzlNbHj6y3suxM8jk4R41s0mUcC3aT1N4= +github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.15.17/go.mod h1:cDTivSsUl4r1jN+H8/W6yDqByOOliY8HEGuVuL3ixV8= github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee h1:pqpYVM0qkXujplHNfH6w5GDqcY5sLJAgOc4/hlR6+Xw= github.com/threefoldtech/zos v0.5.6-0.20240902110349-172a0a29a6ee/go.mod h1:lut72yYMJhgK0QRvF0Wd/mB3+OfIoXWz04DQuXck3Sw= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= diff --git a/provider/k8s_parser.go b/provider/k8s_parser.go index cf39988..ba3425d 100644 --- a/provider/k8s_parser.go +++ b/provider/k8s_parser.go @@ -3,7 +3,6 @@ package provider import ( "encoding/hex" "fmt" - "os" "strconv" "github.com/threefoldtech/tfgrid-sdk-go/grid-client/workloads" @@ -12,8 +11,21 @@ import ( // K8sNodeInput struct of input data type K8sNodeInput struct { - VMInput - DiskSize int `pulumi:"disk_size"` + Name string `pulumi:"name"` + Description string `pulumi:"description,optional"` + NetworkName string `pulumi:"network_name"` + NodeID interface{} `pulumi:"node_id"` + DiskSize int `pulumi:"disk_size"` + Flist string `pulumi:"flist,optional"` + EntryPoint string `pulumi:"entry_point,optional"` + FlistChecksum string `pulumi:"flist_checksum,optional"` + CPU int `pulumi:"cpu"` + Memory int `pulumi:"memory"` + PublicIP bool `pulumi:"public_ip,optional"` + PublicIP6 bool `pulumi:"public_ip6,optional"` + Planetary bool `pulumi:"planetary,optional"` + Mycelium bool `pulumi:"mycelium,optional"` + MyceliumIPSeed string `pulumi:"mycelium_ip_seed,optional"` } func parseToK8sState(k8sCluster workloads.K8sCluster) KubernetesState { @@ -42,20 +54,20 @@ func parseToK8sState(k8sCluster workloads.K8sCluster) KubernetesState { // parse master input masterInput := K8sNodeInput{ - VMInput: VMInput{ - Name: k8sCluster.Master.Name, - NetworkName: k8sCluster.Master.NetworkName, - NodeID: int(k8sCluster.Master.NodeID), - PublicIP: k8sCluster.Master.PublicIP, - PublicIP6: k8sCluster.Master.PublicIP6, - Planetary: k8sCluster.Master.Planetary, - MyceliumIPSeed: hex.EncodeToString(k8sCluster.Master.MyceliumIPSeed), - Flist: k8sCluster.Master.Flist, - FlistChecksum: k8sCluster.Master.FlistChecksum, - CPU: int(k8sCluster.Master.CPU), - Memory: int(k8sCluster.Master.MemoryMB), - }, - DiskSize: int(k8sCluster.Master.DiskSizeGB), + Name: k8sCluster.Master.Name, + Description: k8sCluster.Master.Description, + NetworkName: k8sCluster.Master.NetworkName, + NodeID: int(k8sCluster.Master.NodeID), + PublicIP: k8sCluster.Master.PublicIP, + PublicIP6: k8sCluster.Master.PublicIP6, + Planetary: k8sCluster.Master.Planetary, + MyceliumIPSeed: hex.EncodeToString(k8sCluster.Master.MyceliumIPSeed), + Flist: k8sCluster.Master.Flist, + EntryPoint: k8sCluster.Master.Entrypoint, + FlistChecksum: k8sCluster.Master.FlistChecksum, + CPU: int(k8sCluster.Master.CPU), + Memory: int(k8sCluster.Master.MemoryMB), + DiskSize: int(k8sCluster.Master.DiskSizeGB), } // parse workers computed & input @@ -74,32 +86,35 @@ func parseToK8sState(k8sCluster workloads.K8sCluster) KubernetesState { workersComputed[w.Name] = newWorkerComputed newWorkerInput := K8sNodeInput{ - VMInput: VMInput{ - Name: w.Name, - NetworkName: w.NetworkName, - NodeID: int(w.NodeID), - PublicIP: w.PublicIP, - PublicIP6: w.PublicIP6, - Planetary: w.Planetary, - MyceliumIPSeed: hex.EncodeToString(w.MyceliumIPSeed), - Flist: w.Flist, - FlistChecksum: w.FlistChecksum, - CPU: int(w.CPU), - Memory: int(w.MemoryMB), - }, - DiskSize: int(w.DiskSizeGB), + Name: w.Name, + Description: w.Description, + NetworkName: w.NetworkName, + NodeID: int(w.NodeID), + PublicIP: w.PublicIP, + PublicIP6: w.PublicIP6, + Planetary: w.Planetary, + MyceliumIPSeed: hex.EncodeToString(w.MyceliumIPSeed), + Flist: w.Flist, + EntryPoint: w.Entrypoint, + FlistChecksum: w.FlistChecksum, + CPU: int(w.CPU), + Memory: int(w.MemoryMB), + DiskSize: int(w.DiskSizeGB), } workersInput = append(workersInput, newWorkerInput) } return KubernetesState{ KubernetesArgs: KubernetesArgs{ - Master: masterInput, - Workers: workersInput, - Token: k8sCluster.Token, - NetworkName: k8sCluster.NetworkName, - SolutionType: k8sCluster.SolutionType, - SSHKey: k8sCluster.SSHKey, + Master: masterInput, + Workers: workersInput, + Token: k8sCluster.Token, + NetworkName: k8sCluster.NetworkName, + SolutionType: k8sCluster.SolutionType, + SSHKey: k8sCluster.SSHKey, + Flist: k8sCluster.Flist, + EntryPoint: k8sCluster.Entrypoint, + FlistChecksum: k8sCluster.FlistChecksum, }, MasterComputed: masterComputed, WorkersComputed: workersComputed, @@ -109,12 +124,6 @@ func parseToK8sState(k8sCluster workloads.K8sCluster) KubernetesState { } func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, error) { - // for tests - sshKey := os.Getenv("SSH_KEY") - if sshKey != "" { - kubernetesArgs.SSHKey = sshKey - } - nodeID, err := strconv.Atoi(fmt.Sprint(kubernetesArgs.Master.NodeID)) if err != nil { return workloads.K8sCluster{}, err @@ -140,6 +149,7 @@ func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, err master := &workloads.K8sNode{ VM: &workloads.VM{ Name: kubernetesArgs.Master.Name, + Description: kubernetesArgs.Master.Description, NetworkName: kubernetesArgs.Master.NetworkName, NodeID: uint32(nodeID), PublicIP: kubernetesArgs.Master.PublicIP, @@ -147,6 +157,7 @@ func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, err Planetary: kubernetesArgs.Master.Planetary, MyceliumIPSeed: myceliumIPSeed, Flist: kubernetesArgs.Master.Flist, + Entrypoint: kubernetesArgs.Master.EntryPoint, FlistChecksum: kubernetesArgs.Master.FlistChecksum, CPU: uint8(kubernetesArgs.Master.CPU), MemoryMB: uint64(kubernetesArgs.Master.Memory), @@ -154,11 +165,6 @@ func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, err DiskSizeGB: uint64(kubernetesArgs.Master.DiskSize), } - // set default flist - if master.Flist == "" { - master.Flist = "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist" - } - // parse workers workers := []workloads.K8sNode{} for _, w := range kubernetesArgs.Workers { @@ -186,6 +192,7 @@ func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, err newWorker := workloads.K8sNode{ VM: &workloads.VM{ Name: w.Name, + Description: w.Description, NetworkName: w.NetworkName, NodeID: uint32(nodeID), PublicIP: w.PublicIP, @@ -194,28 +201,28 @@ func parseToK8sCluster(kubernetesArgs KubernetesArgs) (workloads.K8sCluster, err MyceliumIPSeed: myceliumIPSeed, Flist: w.Flist, FlistChecksum: w.FlistChecksum, + Entrypoint: w.EntryPoint, CPU: uint8(w.CPU), MemoryMB: uint64(w.Memory), }, DiskSizeGB: uint64(w.DiskSize), } - // set default flist - if newWorker.Flist == "" { - newWorker.Flist = "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist" - } - workers = append(workers, newWorker) } return workloads.K8sCluster{ - Master: master, - Workers: workers, - Token: kubernetesArgs.Token, - NetworkName: kubernetesArgs.NetworkName, - SolutionType: kubernetesArgs.SolutionType, - SSHKey: kubernetesArgs.SSHKey, - NodesIPRange: make(map[uint32]gridtypes.IPNet), + Master: master, + Workers: workers, + Token: kubernetesArgs.Token, + NetworkName: kubernetesArgs.NetworkName, + Flist: kubernetesArgs.Flist, + Entrypoint: kubernetesArgs.EntryPoint, + FlistChecksum: kubernetesArgs.FlistChecksum, + SolutionType: kubernetesArgs.SolutionType, + SSHKey: kubernetesArgs.SSHKey, + NodesIPRange: make(map[uint32]gridtypes.IPNet), + NodeDeploymentID: map[uint32]uint64{}, }, nil } diff --git a/provider/k8s_parser_test.go b/provider/k8s_parser_test.go index 60d20b1..cb78e68 100644 --- a/provider/k8s_parser_test.go +++ b/provider/k8s_parser_test.go @@ -9,17 +9,15 @@ import ( func TestK8sParser(t *testing.T) { k8sNodeInput := K8sNodeInput{ - VMInput: VMInput{ - Name: "master", - NodeID: 1, - Flist: "", - CPU: 1, - Memory: 1, - PublicIP: false, - PublicIP6: false, - Planetary: false, - }, - DiskSize: 1, + Name: "master", + NodeID: 1, + Flist: "", + CPU: 1, + Memory: 1, + PublicIP: false, + PublicIP6: false, + Planetary: false, + DiskSize: 1, } k8sWorkerInput1 := k8sNodeInput diff --git a/provider/k8s_resource.go b/provider/k8s_resource.go index 1b9a9f4..06d3d4f 100644 --- a/provider/k8s_resource.go +++ b/provider/k8s_resource.go @@ -13,12 +13,15 @@ type Kubernetes struct{} // KubernetesArgs is defining what arguments it accepts type KubernetesArgs struct { - Master K8sNodeInput `pulumi:"master"` - Workers []K8sNodeInput `pulumi:"workers"` - Token string `pulumi:"token"` - NetworkName string `pulumi:"network_name"` - SolutionType string `pulumi:"solution_type,optional"` - SSHKey string `pulumi:"ssh_key,optional"` + Master K8sNodeInput `pulumi:"master"` + Workers []K8sNodeInput `pulumi:"workers"` + Token string `pulumi:"token"` + NetworkName string `pulumi:"network_name"` + SolutionType string `pulumi:"solution_type,optional"` + SSHKey string `pulumi:"ssh_key,optional"` + Flist string `pulumi:"flist,optional"` + EntryPoint string `pulumi:"entry_point,optional"` + FlistChecksum string `pulumi:"flist_checksum,optional"` } // KubernetesState is describing the fields that exist on the created resource. @@ -58,6 +61,13 @@ func (*Kubernetes) Check( return args, checkFailures, err } + // get master and worker flists from the cluster + Kubernetes.Master.Flist = Kubernetes.Flist + Kubernetes.Master.Entrypoint = Kubernetes.Entrypoint + for i := range Kubernetes.Workers { + Kubernetes.Workers[i].Flist = Kubernetes.Flist + Kubernetes.Workers[i].Entrypoint = Kubernetes.Entrypoint + } return args, checkFailures, Kubernetes.Validate() } diff --git a/sdk/go/threefold/kubernetes.go b/sdk/go/threefold/kubernetes.go index bd253c0..8035215 100644 --- a/sdk/go/threefold/kubernetes.go +++ b/sdk/go/threefold/kubernetes.go @@ -15,6 +15,12 @@ import ( type Kubernetes struct { pulumi.CustomResourceState + // The entry point for the flist. Example: /sbin/zinit init + Entry_point pulumi.StringPtrOutput `pulumi:"entry_point"` + // The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + Flist pulumi.StringPtrOutput `pulumi:"flist"` + // The checksum of the flist which should match the checksum of the given flist, optional + Flist_checksum pulumi.StringPtrOutput `pulumi:"flist_checksum"` // Master holds the configuration of master node in the kubernetes cluster Master K8sNodeInputOutput `pulumi:"master"` // The computed fields of the master node @@ -56,9 +62,13 @@ func NewKubernetes(ctx *pulumi.Context, if args.Workers == nil { return nil, errors.New("invalid value for required argument 'Workers'") } + args.Master = args.Master.ToK8sNodeInputOutput().ApplyT(func(v K8sNodeInput) K8sNodeInput { return *v.Defaults() }).(K8sNodeInputOutput) if args.Solution_type == nil { args.Solution_type = pulumi.StringPtr("kubernetes/") } + if args.Ssh_key == nil { + args.Ssh_key = pulumi.StringPtr("") + } opts = internal.PkgResourceDefaultOpts(opts) var resource Kubernetes err := ctx.RegisterResource("threefold:index:Kubernetes", name, args, &resource, opts...) @@ -92,6 +102,12 @@ func (KubernetesState) ElementType() reflect.Type { } type kubernetesArgs struct { + // The entry point for the flist. Example: /sbin/zinit init + Entry_point *string `pulumi:"entry_point"` + // The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + Flist *string `pulumi:"flist"` + // The checksum of the flist which should match the checksum of the given flist, optional + Flist_checksum *string `pulumi:"flist_checksum"` // Master holds the configuration of master node in the kubernetes cluster Master K8sNodeInput `pulumi:"master"` // The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist @@ -108,6 +124,12 @@ type kubernetesArgs struct { // The set of arguments for constructing a Kubernetes resource. type KubernetesArgs struct { + // The entry point for the flist. Example: /sbin/zinit init + Entry_point pulumi.StringPtrInput + // The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + Flist pulumi.StringPtrInput + // The checksum of the flist which should match the checksum of the given flist, optional + Flist_checksum pulumi.StringPtrInput // Master holds the configuration of master node in the kubernetes cluster Master K8sNodeInputInput // The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist @@ -209,6 +231,21 @@ func (o KubernetesOutput) ToKubernetesOutputWithContext(ctx context.Context) Kub return o } +// The entry point for the flist. Example: /sbin/zinit init +func (o KubernetesOutput) Entry_point() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Kubernetes) pulumi.StringPtrOutput { return v.Entry_point }).(pulumi.StringPtrOutput) +} + +// The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist +func (o KubernetesOutput) Flist() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Kubernetes) pulumi.StringPtrOutput { return v.Flist }).(pulumi.StringPtrOutput) +} + +// The checksum of the flist which should match the checksum of the given flist, optional +func (o KubernetesOutput) Flist_checksum() pulumi.StringPtrOutput { + return o.ApplyT(func(v *Kubernetes) pulumi.StringPtrOutput { return v.Flist_checksum }).(pulumi.StringPtrOutput) +} + // Master holds the configuration of master node in the kubernetes cluster func (o KubernetesOutput) Master() K8sNodeInputOutput { return o.ApplyT(func(v *Kubernetes) K8sNodeInputOutput { return v.Master }).(K8sNodeInputOutput) diff --git a/sdk/go/threefold/pulumiTypes.go b/sdk/go/threefold/pulumiTypes.go index 9c4e45c..bab87b8 100644 --- a/sdk/go/threefold/pulumiTypes.go +++ b/sdk/go/threefold/pulumiTypes.go @@ -341,46 +341,53 @@ func (o GroupArrayOutput) Index(i pulumi.IntInput) GroupOutput { } type K8sNodeInput struct { - // The cpu units needed for the virtual machine. Range in [1: 32] + // The cpu units needed for the kubernetes node. Range in [1: 32] Cpu int `pulumi:"cpu"` - // The description of the virtual machine workload, optional with no restrictions + // The description of the kubernetes node, optional with no restrictions Description *string `pulumi:"description"` // Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs) Disk_size int `pulumi:"disk_size"` // The entry point for the flist. Example: /sbin/zinit init - Entrypoint *string `pulumi:"entrypoint"` - // The environment variables to be passed to the virtual machine. Example: SSH_KEY - Env_vars map[string]string `pulumi:"env_vars"` - // The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - Flist string `pulumi:"flist"` + Entry_point *string `pulumi:"entry_point"` + // The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + Flist *string `pulumi:"flist"` // The checksum of the flist which should match the checksum of the given flist, optional Flist_checksum *string `pulumi:"flist_checksum"` - // A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - Gpus []string `pulumi:"gpus"` - // The memory capacity for the virtual machine in MB. Min is 250 MB + // The memory capacity for the kubernetes node in MB. Min is 250 MB Memory int `pulumi:"memory"` - // A list of mounted disks or volumes - Mounts []Mount `pulumi:"mounts"` - // A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + // A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node Mycelium *bool `pulumi:"mycelium"` - // The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + // The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 Mycelium_ip_seed *string `pulumi:"mycelium_ip_seed"` - // The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + // The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported Name string `pulumi:"name"` // The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist Network_name string `pulumi:"network_name"` - // The node ID to deploy the virtual machine on, required and should match the requested resources + // The node ID to deploy the kubernetes node on, required and should match the requested resources Node_id interface{} `pulumi:"node_id"` - // A flag to enable generating a yggdrasil IP for the virtual machine + // A flag to enable generating a yggdrasil IP for the kubernetes node Planetary *bool `pulumi:"planetary"` - // A flag to enable generating a public IP for the virtual machine, public node is required for it + // A flag to enable generating a public IP for the kubernetes node, public node is required for it Public_ip *bool `pulumi:"public_ip"` - // A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + // A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it Public_ip6 *bool `pulumi:"public_ip6"` - // The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - Rootfs_size *int `pulumi:"rootfs_size"` - // A list of virtual machine loggers - Zlogs []Zlog `pulumi:"zlogs"` +} + +// Defaults sets the appropriate defaults for K8sNodeInput +func (val *K8sNodeInput) Defaults() *K8sNodeInput { + if val == nil { + return nil + } + tmp := *val + if tmp.Entry_point == nil { + entry_point_ := "/sbin/zinit init" + tmp.Entry_point = &entry_point_ + } + if tmp.Flist == nil { + flist_ := "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist" + tmp.Flist = &flist_ + } + return &tmp } // K8sNodeInputInput is an input type that accepts K8sNodeInputArgs and K8sNodeInputOutput values. @@ -395,48 +402,52 @@ type K8sNodeInputInput interface { } type K8sNodeInputArgs struct { - // The cpu units needed for the virtual machine. Range in [1: 32] + // The cpu units needed for the kubernetes node. Range in [1: 32] Cpu pulumi.IntInput `pulumi:"cpu"` - // The description of the virtual machine workload, optional with no restrictions + // The description of the kubernetes node, optional with no restrictions Description pulumi.StringPtrInput `pulumi:"description"` // Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs) Disk_size pulumi.IntInput `pulumi:"disk_size"` // The entry point for the flist. Example: /sbin/zinit init - Entrypoint pulumi.StringPtrInput `pulumi:"entrypoint"` - // The environment variables to be passed to the virtual machine. Example: SSH_KEY - Env_vars pulumi.StringMapInput `pulumi:"env_vars"` - // The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - Flist pulumi.StringInput `pulumi:"flist"` + Entry_point pulumi.StringPtrInput `pulumi:"entry_point"` + // The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + Flist pulumi.StringPtrInput `pulumi:"flist"` // The checksum of the flist which should match the checksum of the given flist, optional Flist_checksum pulumi.StringPtrInput `pulumi:"flist_checksum"` - // A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - Gpus pulumi.StringArrayInput `pulumi:"gpus"` - // The memory capacity for the virtual machine in MB. Min is 250 MB + // The memory capacity for the kubernetes node in MB. Min is 250 MB Memory pulumi.IntInput `pulumi:"memory"` - // A list of mounted disks or volumes - Mounts MountArrayInput `pulumi:"mounts"` - // A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + // A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node Mycelium pulumi.BoolPtrInput `pulumi:"mycelium"` - // The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + // The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 Mycelium_ip_seed pulumi.StringPtrInput `pulumi:"mycelium_ip_seed"` - // The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + // The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported Name pulumi.StringInput `pulumi:"name"` // The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist Network_name pulumi.StringInput `pulumi:"network_name"` - // The node ID to deploy the virtual machine on, required and should match the requested resources + // The node ID to deploy the kubernetes node on, required and should match the requested resources Node_id pulumi.Input `pulumi:"node_id"` - // A flag to enable generating a yggdrasil IP for the virtual machine + // A flag to enable generating a yggdrasil IP for the kubernetes node Planetary pulumi.BoolPtrInput `pulumi:"planetary"` - // A flag to enable generating a public IP for the virtual machine, public node is required for it + // A flag to enable generating a public IP for the kubernetes node, public node is required for it Public_ip pulumi.BoolPtrInput `pulumi:"public_ip"` - // A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + // A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it Public_ip6 pulumi.BoolPtrInput `pulumi:"public_ip6"` - // The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - Rootfs_size pulumi.IntPtrInput `pulumi:"rootfs_size"` - // A list of virtual machine loggers - Zlogs ZlogArrayInput `pulumi:"zlogs"` } +// Defaults sets the appropriate defaults for K8sNodeInputArgs +func (val *K8sNodeInputArgs) Defaults() *K8sNodeInputArgs { + if val == nil { + return nil + } + tmp := *val + if tmp.Entry_point == nil { + tmp.Entry_point = pulumi.StringPtr("/sbin/zinit init") + } + if tmp.Flist == nil { + tmp.Flist = pulumi.StringPtr("https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist") + } + return &tmp +} func (K8sNodeInputArgs) ElementType() reflect.Type { return reflect.TypeOf((*K8sNodeInput)(nil)).Elem() } @@ -488,12 +499,12 @@ func (o K8sNodeInputOutput) ToK8sNodeInputOutputWithContext(ctx context.Context) return o } -// The cpu units needed for the virtual machine. Range in [1: 32] +// The cpu units needed for the kubernetes node. Range in [1: 32] func (o K8sNodeInputOutput) Cpu() pulumi.IntOutput { return o.ApplyT(func(v K8sNodeInput) int { return v.Cpu }).(pulumi.IntOutput) } -// The description of the virtual machine workload, optional with no restrictions +// The description of the kubernetes node, optional with no restrictions func (o K8sNodeInputOutput) Description() pulumi.StringPtrOutput { return o.ApplyT(func(v K8sNodeInput) *string { return v.Description }).(pulumi.StringPtrOutput) } @@ -504,18 +515,13 @@ func (o K8sNodeInputOutput) Disk_size() pulumi.IntOutput { } // The entry point for the flist. Example: /sbin/zinit init -func (o K8sNodeInputOutput) Entrypoint() pulumi.StringPtrOutput { - return o.ApplyT(func(v K8sNodeInput) *string { return v.Entrypoint }).(pulumi.StringPtrOutput) -} - -// The environment variables to be passed to the virtual machine. Example: SSH_KEY -func (o K8sNodeInputOutput) Env_vars() pulumi.StringMapOutput { - return o.ApplyT(func(v K8sNodeInput) map[string]string { return v.Env_vars }).(pulumi.StringMapOutput) +func (o K8sNodeInputOutput) Entry_point() pulumi.StringPtrOutput { + return o.ApplyT(func(v K8sNodeInput) *string { return v.Entry_point }).(pulumi.StringPtrOutput) } -// The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist -func (o K8sNodeInputOutput) Flist() pulumi.StringOutput { - return o.ApplyT(func(v K8sNodeInput) string { return v.Flist }).(pulumi.StringOutput) +// The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist +func (o K8sNodeInputOutput) Flist() pulumi.StringPtrOutput { + return o.ApplyT(func(v K8sNodeInput) *string { return v.Flist }).(pulumi.StringPtrOutput) } // The checksum of the flist which should match the checksum of the given flist, optional @@ -523,32 +529,22 @@ func (o K8sNodeInputOutput) Flist_checksum() pulumi.StringPtrOutput { return o.ApplyT(func(v K8sNodeInput) *string { return v.Flist_checksum }).(pulumi.StringPtrOutput) } -// A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f -func (o K8sNodeInputOutput) Gpus() pulumi.StringArrayOutput { - return o.ApplyT(func(v K8sNodeInput) []string { return v.Gpus }).(pulumi.StringArrayOutput) -} - -// The memory capacity for the virtual machine in MB. Min is 250 MB +// The memory capacity for the kubernetes node in MB. Min is 250 MB func (o K8sNodeInputOutput) Memory() pulumi.IntOutput { return o.ApplyT(func(v K8sNodeInput) int { return v.Memory }).(pulumi.IntOutput) } -// A list of mounted disks or volumes -func (o K8sNodeInputOutput) Mounts() MountArrayOutput { - return o.ApplyT(func(v K8sNodeInput) []Mount { return v.Mounts }).(MountArrayOutput) -} - -// A flag to generate a random mycelium IP seed to support mycelium in the virtual machine +// A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node func (o K8sNodeInputOutput) Mycelium() pulumi.BoolPtrOutput { return o.ApplyT(func(v K8sNodeInput) *bool { return v.Mycelium }).(pulumi.BoolPtrOutput) } -// The seed used for mycelium IP generated for the virtual machine. It's length should be 6 +// The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 func (o K8sNodeInputOutput) Mycelium_ip_seed() pulumi.StringPtrOutput { return o.ApplyT(func(v K8sNodeInput) *string { return v.Mycelium_ip_seed }).(pulumi.StringPtrOutput) } -// The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported +// The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported func (o K8sNodeInputOutput) Name() pulumi.StringOutput { return o.ApplyT(func(v K8sNodeInput) string { return v.Name }).(pulumi.StringOutput) } @@ -558,36 +554,26 @@ func (o K8sNodeInputOutput) Network_name() pulumi.StringOutput { return o.ApplyT(func(v K8sNodeInput) string { return v.Network_name }).(pulumi.StringOutput) } -// The node ID to deploy the virtual machine on, required and should match the requested resources +// The node ID to deploy the kubernetes node on, required and should match the requested resources func (o K8sNodeInputOutput) Node_id() pulumi.AnyOutput { return o.ApplyT(func(v K8sNodeInput) interface{} { return v.Node_id }).(pulumi.AnyOutput) } -// A flag to enable generating a yggdrasil IP for the virtual machine +// A flag to enable generating a yggdrasil IP for the kubernetes node func (o K8sNodeInputOutput) Planetary() pulumi.BoolPtrOutput { return o.ApplyT(func(v K8sNodeInput) *bool { return v.Planetary }).(pulumi.BoolPtrOutput) } -// A flag to enable generating a public IP for the virtual machine, public node is required for it +// A flag to enable generating a public IP for the kubernetes node, public node is required for it func (o K8sNodeInputOutput) Public_ip() pulumi.BoolPtrOutput { return o.ApplyT(func(v K8sNodeInput) *bool { return v.Public_ip }).(pulumi.BoolPtrOutput) } -// A flag to enable generating a public IPv6 for the virtual machine, public node is required for it +// A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it func (o K8sNodeInputOutput) Public_ip6() pulumi.BoolPtrOutput { return o.ApplyT(func(v K8sNodeInput) *bool { return v.Public_ip6 }).(pulumi.BoolPtrOutput) } -// The root fs size in GB (type SSD). Can be set as 0 to get the default minimum -func (o K8sNodeInputOutput) Rootfs_size() pulumi.IntPtrOutput { - return o.ApplyT(func(v K8sNodeInput) *int { return v.Rootfs_size }).(pulumi.IntPtrOutput) -} - -// A list of virtual machine loggers -func (o K8sNodeInputOutput) Zlogs() ZlogArrayOutput { - return o.ApplyT(func(v K8sNodeInput) []Zlog { return v.Zlogs }).(ZlogArrayOutput) -} - type K8sNodeInputArrayOutput struct{ *pulumi.OutputState } func (K8sNodeInputArrayOutput) ElementType() reflect.Type { diff --git a/sdk/nodejs/kubernetes.ts b/sdk/nodejs/kubernetes.ts index 4ac0254..acc3c90 100644 --- a/sdk/nodejs/kubernetes.ts +++ b/sdk/nodejs/kubernetes.ts @@ -33,6 +33,18 @@ export class Kubernetes extends pulumi.CustomResource { return obj['__pulumiType'] === Kubernetes.__pulumiType; } + /** + * The entry point for the flist. Example: /sbin/zinit init + */ + public readonly entry_point!: pulumi.Output; + /** + * The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + */ + public readonly flist!: pulumi.Output; + /** + * The checksum of the flist which should match the checksum of the given flist, optional + */ + public readonly flist_checksum!: pulumi.Output; /** * Master holds the configuration of master node in the kubernetes cluster */ @@ -97,10 +109,13 @@ export class Kubernetes extends pulumi.CustomResource { if ((!args || args.workers === undefined) && !opts.urn) { throw new Error("Missing required property 'workers'"); } - resourceInputs["master"] = args ? args.master : undefined; + resourceInputs["entry_point"] = args ? args.entry_point : undefined; + resourceInputs["flist"] = args ? args.flist : undefined; + resourceInputs["flist_checksum"] = args ? args.flist_checksum : undefined; + resourceInputs["master"] = args ? (args.master ? pulumi.output(args.master).apply(inputs.k8sNodeInputArgsProvideDefaults) : undefined) : undefined; resourceInputs["network_name"] = args ? args.network_name : undefined; resourceInputs["solution_type"] = (args ? args.solution_type : undefined) ?? "kubernetes/"; - resourceInputs["ssh_key"] = args ? args.ssh_key : undefined; + resourceInputs["ssh_key"] = (args ? args.ssh_key : undefined) ?? ""; resourceInputs["token"] = args ? args.token : undefined; resourceInputs["workers"] = args ? args.workers : undefined; resourceInputs["master_computed"] = undefined /*out*/; @@ -108,6 +123,9 @@ export class Kubernetes extends pulumi.CustomResource { resourceInputs["nodes_ip_range"] = undefined /*out*/; resourceInputs["workers_computed"] = undefined /*out*/; } else { + resourceInputs["entry_point"] = undefined /*out*/; + resourceInputs["flist"] = undefined /*out*/; + resourceInputs["flist_checksum"] = undefined /*out*/; resourceInputs["master"] = undefined /*out*/; resourceInputs["master_computed"] = undefined /*out*/; resourceInputs["network_name"] = undefined /*out*/; @@ -128,6 +146,18 @@ export class Kubernetes extends pulumi.CustomResource { * The set of arguments for constructing a Kubernetes resource. */ export interface KubernetesArgs { + /** + * The entry point for the flist. Example: /sbin/zinit init + */ + entry_point?: pulumi.Input; + /** + * The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + */ + flist?: pulumi.Input; + /** + * The checksum of the flist which should match the checksum of the given flist, optional + */ + flist_checksum?: pulumi.Input; /** * Master holds the configuration of master node in the kubernetes cluster */ diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index f795c64..a294ae6 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -46,11 +46,11 @@ export interface GroupArgs { export interface K8sNodeInputArgs { /** - * The cpu units needed for the virtual machine. Range in [1: 32] + * The cpu units needed for the kubernetes node. Range in [1: 32] */ cpu: pulumi.Input; /** - * The description of the virtual machine workload, optional with no restrictions + * The description of the kubernetes node, optional with no restrictions */ description?: pulumi.Input; /** @@ -60,41 +60,29 @@ export interface K8sNodeInputArgs { /** * The entry point for the flist. Example: /sbin/zinit init */ - entrypoint?: pulumi.Input; - /** - * The environment variables to be passed to the virtual machine. Example: SSH_KEY - */ - env_vars?: pulumi.Input<{[key: string]: pulumi.Input}>; + entry_point?: pulumi.Input; /** - * The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + * The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist */ - flist: pulumi.Input; + flist?: pulumi.Input; /** * The checksum of the flist which should match the checksum of the given flist, optional */ flist_checksum?: pulumi.Input; /** - * A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - */ - gpus?: pulumi.Input[]>; - /** - * The memory capacity for the virtual machine in MB. Min is 250 MB + * The memory capacity for the kubernetes node in MB. Min is 250 MB */ memory: pulumi.Input; /** - * A list of mounted disks or volumes - */ - mounts?: pulumi.Input[]>; - /** - * A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + * A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node */ mycelium?: pulumi.Input; /** - * The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + * The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 */ mycelium_ip_seed?: pulumi.Input; /** - * The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + * The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported */ name: pulumi.Input; /** @@ -102,29 +90,31 @@ export interface K8sNodeInputArgs { */ network_name: pulumi.Input; /** - * The node ID to deploy the virtual machine on, required and should match the requested resources + * The node ID to deploy the kubernetes node on, required and should match the requested resources */ node_id: any; /** - * A flag to enable generating a yggdrasil IP for the virtual machine + * A flag to enable generating a yggdrasil IP for the kubernetes node */ planetary?: pulumi.Input; /** - * A flag to enable generating a public IP for the virtual machine, public node is required for it + * A flag to enable generating a public IP for the kubernetes node, public node is required for it */ public_ip?: pulumi.Input; /** - * A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + * A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it */ public_ip6?: pulumi.Input; - /** - * The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - */ - rootfs_size?: pulumi.Input; - /** - * A list of virtual machine loggers - */ - zlogs?: pulumi.Input[]>; +} +/** + * k8sNodeInputArgsProvideDefaults sets the appropriate defaults for K8sNodeInputArgs + */ +export function k8sNodeInputArgsProvideDefaults(val: K8sNodeInputArgs): K8sNodeInputArgs { + return { + ...val, + entry_point: (val.entry_point) ?? "/sbin/zinit init", + flist: (val.flist) ?? "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist", + }; } export interface MetadataArgs { diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index e20928a..cc23f9c 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -46,11 +46,11 @@ export interface Group { export interface K8sNodeInput { /** - * The cpu units needed for the virtual machine. Range in [1: 32] + * The cpu units needed for the kubernetes node. Range in [1: 32] */ cpu: number; /** - * The description of the virtual machine workload, optional with no restrictions + * The description of the kubernetes node, optional with no restrictions */ description?: string; /** @@ -60,41 +60,29 @@ export interface K8sNodeInput { /** * The entry point for the flist. Example: /sbin/zinit init */ - entrypoint?: string; - /** - * The environment variables to be passed to the virtual machine. Example: SSH_KEY - */ - env_vars?: {[key: string]: string}; + entry_point?: string; /** - * The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + * The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist */ - flist: string; + flist?: string; /** * The checksum of the flist which should match the checksum of the given flist, optional */ flist_checksum?: string; /** - * A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - */ - gpus?: string[]; - /** - * The memory capacity for the virtual machine in MB. Min is 250 MB + * The memory capacity for the kubernetes node in MB. Min is 250 MB */ memory: number; /** - * A list of mounted disks or volumes - */ - mounts?: outputs.Mount[]; - /** - * A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + * A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node */ mycelium?: boolean; /** - * The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + * The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 */ mycelium_ip_seed?: string; /** - * The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + * The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported */ name: string; /** @@ -102,29 +90,31 @@ export interface K8sNodeInput { */ network_name: string; /** - * The node ID to deploy the virtual machine on, required and should match the requested resources + * The node ID to deploy the kubernetes node on, required and should match the requested resources */ node_id: any; /** - * A flag to enable generating a yggdrasil IP for the virtual machine + * A flag to enable generating a yggdrasil IP for the kubernetes node */ planetary?: boolean; /** - * A flag to enable generating a public IP for the virtual machine, public node is required for it + * A flag to enable generating a public IP for the kubernetes node, public node is required for it */ public_ip?: boolean; /** - * A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + * A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it */ public_ip6?: boolean; - /** - * The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - */ - rootfs_size?: number; - /** - * A list of virtual machine loggers - */ - zlogs?: outputs.Zlog[]; +} +/** + * k8sNodeInputProvideDefaults sets the appropriate defaults for K8sNodeInput + */ +export function k8sNodeInputProvideDefaults(val: K8sNodeInput): K8sNodeInput { + return { + ...val, + entry_point: (val.entry_point) ?? "/sbin/zinit init", + flist: (val.flist) ?? "https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist", + }; } export interface Metadata { diff --git a/sdk/python/pulumi_threefold/_inputs.py b/sdk/python/pulumi_threefold/_inputs.py index 61732f2..d561358 100644 --- a/sdk/python/pulumi_threefold/_inputs.py +++ b/sdk/python/pulumi_threefold/_inputs.py @@ -214,23 +214,19 @@ def backends(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['BackendAr class K8sNodeInputArgsDict(TypedDict): cpu: pulumi.Input[int] """ - The cpu units needed for the virtual machine. Range in [1: 32] + The cpu units needed for the kubernetes node. Range in [1: 32] """ disk_size: pulumi.Input[int] """ Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs) """ - flist: pulumi.Input[str] - """ - The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - """ memory: pulumi.Input[int] """ - The memory capacity for the virtual machine in MB. Min is 250 MB + The memory capacity for the kubernetes node in MB. Min is 250 MB """ name: pulumi.Input[str] """ - The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported """ network_name: pulumi.Input[str] """ @@ -238,59 +234,43 @@ class K8sNodeInputArgsDict(TypedDict): """ node_id: Any """ - The node ID to deploy the virtual machine on, required and should match the requested resources + The node ID to deploy the kubernetes node on, required and should match the requested resources """ description: NotRequired[pulumi.Input[str]] """ - The description of the virtual machine workload, optional with no restrictions + The description of the kubernetes node, optional with no restrictions """ - entrypoint: NotRequired[pulumi.Input[str]] + entry_point: NotRequired[pulumi.Input[str]] """ The entry point for the flist. Example: /sbin/zinit init """ - env_vars: NotRequired[pulumi.Input[Mapping[str, pulumi.Input[str]]]] + flist: NotRequired[pulumi.Input[str]] """ - The environment variables to be passed to the virtual machine. Example: SSH_KEY + The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist """ flist_checksum: NotRequired[pulumi.Input[str]] """ The checksum of the flist which should match the checksum of the given flist, optional """ - gpus: NotRequired[pulumi.Input[Sequence[pulumi.Input[str]]]] - """ - A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - """ - mounts: NotRequired[pulumi.Input[Sequence[pulumi.Input['MountArgsDict']]]] - """ - A list of mounted disks or volumes - """ mycelium: NotRequired[pulumi.Input[bool]] """ - A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node """ mycelium_ip_seed: NotRequired[pulumi.Input[str]] """ - The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 """ planetary: NotRequired[pulumi.Input[bool]] """ - A flag to enable generating a yggdrasil IP for the virtual machine + A flag to enable generating a yggdrasil IP for the kubernetes node """ public_ip: NotRequired[pulumi.Input[bool]] """ - A flag to enable generating a public IP for the virtual machine, public node is required for it + A flag to enable generating a public IP for the kubernetes node, public node is required for it """ public_ip6: NotRequired[pulumi.Input[bool]] """ - A flag to enable generating a public IPv6 for the virtual machine, public node is required for it - """ - rootfs_size: NotRequired[pulumi.Input[int]] - """ - The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - """ - zlogs: NotRequired[pulumi.Input[Sequence[pulumi.Input['ZlogArgsDict']]]] - """ - A list of virtual machine loggers + A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it """ elif False: K8sNodeInputArgsDict: TypeAlias = Mapping[str, Any] @@ -300,65 +280,54 @@ class K8sNodeInputArgs: def __init__(__self__, *, cpu: pulumi.Input[int], disk_size: pulumi.Input[int], - flist: pulumi.Input[str], memory: pulumi.Input[int], name: pulumi.Input[str], network_name: pulumi.Input[str], node_id: Any, description: Optional[pulumi.Input[str]] = None, - entrypoint: Optional[pulumi.Input[str]] = None, - env_vars: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None, + entry_point: Optional[pulumi.Input[str]] = None, + flist: Optional[pulumi.Input[str]] = None, flist_checksum: Optional[pulumi.Input[str]] = None, - gpus: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, - mounts: Optional[pulumi.Input[Sequence[pulumi.Input['MountArgs']]]] = None, mycelium: Optional[pulumi.Input[bool]] = None, mycelium_ip_seed: Optional[pulumi.Input[str]] = None, planetary: Optional[pulumi.Input[bool]] = None, public_ip: Optional[pulumi.Input[bool]] = None, - public_ip6: Optional[pulumi.Input[bool]] = None, - rootfs_size: Optional[pulumi.Input[int]] = None, - zlogs: Optional[pulumi.Input[Sequence[pulumi.Input['ZlogArgs']]]] = None): + public_ip6: Optional[pulumi.Input[bool]] = None): """ - :param pulumi.Input[int] cpu: The cpu units needed for the virtual machine. Range in [1: 32] + :param pulumi.Input[int] cpu: The cpu units needed for the kubernetes node. Range in [1: 32] :param pulumi.Input[int] disk_size: Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs) - :param pulumi.Input[str] flist: The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - :param pulumi.Input[int] memory: The memory capacity for the virtual machine in MB. Min is 250 MB - :param pulumi.Input[str] name: The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + :param pulumi.Input[int] memory: The memory capacity for the kubernetes node in MB. Min is 250 MB + :param pulumi.Input[str] name: The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported :param pulumi.Input[str] network_name: The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist - :param Any node_id: The node ID to deploy the virtual machine on, required and should match the requested resources - :param pulumi.Input[str] description: The description of the virtual machine workload, optional with no restrictions - :param pulumi.Input[str] entrypoint: The entry point for the flist. Example: /sbin/zinit init - :param pulumi.Input[Mapping[str, pulumi.Input[str]]] env_vars: The environment variables to be passed to the virtual machine. Example: SSH_KEY + :param Any node_id: The node ID to deploy the kubernetes node on, required and should match the requested resources + :param pulumi.Input[str] description: The description of the kubernetes node, optional with no restrictions + :param pulumi.Input[str] entry_point: The entry point for the flist. Example: /sbin/zinit init + :param pulumi.Input[str] flist: The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist :param pulumi.Input[str] flist_checksum: The checksum of the flist which should match the checksum of the given flist, optional - :param pulumi.Input[Sequence[pulumi.Input[str]]] gpus: A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - :param pulumi.Input[Sequence[pulumi.Input['MountArgs']]] mounts: A list of mounted disks or volumes - :param pulumi.Input[bool] mycelium: A flag to generate a random mycelium IP seed to support mycelium in the virtual machine - :param pulumi.Input[str] mycelium_ip_seed: The seed used for mycelium IP generated for the virtual machine. It's length should be 6 - :param pulumi.Input[bool] planetary: A flag to enable generating a yggdrasil IP for the virtual machine - :param pulumi.Input[bool] public_ip: A flag to enable generating a public IP for the virtual machine, public node is required for it - :param pulumi.Input[bool] public_ip6: A flag to enable generating a public IPv6 for the virtual machine, public node is required for it - :param pulumi.Input[int] rootfs_size: The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - :param pulumi.Input[Sequence[pulumi.Input['ZlogArgs']]] zlogs: A list of virtual machine loggers + :param pulumi.Input[bool] mycelium: A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node + :param pulumi.Input[str] mycelium_ip_seed: The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 + :param pulumi.Input[bool] planetary: A flag to enable generating a yggdrasil IP for the kubernetes node + :param pulumi.Input[bool] public_ip: A flag to enable generating a public IP for the kubernetes node, public node is required for it + :param pulumi.Input[bool] public_ip6: A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it """ pulumi.set(__self__, "cpu", cpu) pulumi.set(__self__, "disk_size", disk_size) - pulumi.set(__self__, "flist", flist) pulumi.set(__self__, "memory", memory) pulumi.set(__self__, "name", name) pulumi.set(__self__, "network_name", network_name) pulumi.set(__self__, "node_id", node_id) if description is not None: pulumi.set(__self__, "description", description) - if entrypoint is not None: - pulumi.set(__self__, "entrypoint", entrypoint) - if env_vars is not None: - pulumi.set(__self__, "env_vars", env_vars) + if entry_point is None: + entry_point = '/sbin/zinit init' + if entry_point is not None: + pulumi.set(__self__, "entry_point", entry_point) + if flist is None: + flist = 'https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist' + if flist is not None: + pulumi.set(__self__, "flist", flist) if flist_checksum is not None: pulumi.set(__self__, "flist_checksum", flist_checksum) - if gpus is not None: - pulumi.set(__self__, "gpus", gpus) - if mounts is not None: - pulumi.set(__self__, "mounts", mounts) if mycelium is not None: pulumi.set(__self__, "mycelium", mycelium) if mycelium_ip_seed is not None: @@ -369,16 +338,12 @@ def __init__(__self__, *, pulumi.set(__self__, "public_ip", public_ip) if public_ip6 is not None: pulumi.set(__self__, "public_ip6", public_ip6) - if rootfs_size is not None: - pulumi.set(__self__, "rootfs_size", rootfs_size) - if zlogs is not None: - pulumi.set(__self__, "zlogs", zlogs) @property @pulumi.getter def cpu(self) -> pulumi.Input[int]: """ - The cpu units needed for the virtual machine. Range in [1: 32] + The cpu units needed for the kubernetes node. Range in [1: 32] """ return pulumi.get(self, "cpu") @@ -398,23 +363,11 @@ def disk_size(self) -> pulumi.Input[int]: def disk_size(self, value: pulumi.Input[int]): pulumi.set(self, "disk_size", value) - @property - @pulumi.getter - def flist(self) -> pulumi.Input[str]: - """ - The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - """ - return pulumi.get(self, "flist") - - @flist.setter - def flist(self, value: pulumi.Input[str]): - pulumi.set(self, "flist", value) - @property @pulumi.getter def memory(self) -> pulumi.Input[int]: """ - The memory capacity for the virtual machine in MB. Min is 250 MB + The memory capacity for the kubernetes node in MB. Min is 250 MB """ return pulumi.get(self, "memory") @@ -426,7 +379,7 @@ def memory(self, value: pulumi.Input[int]): @pulumi.getter def name(self) -> pulumi.Input[str]: """ - The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported """ return pulumi.get(self, "name") @@ -450,7 +403,7 @@ def network_name(self, value: pulumi.Input[str]): @pulumi.getter def node_id(self) -> Any: """ - The node ID to deploy the virtual machine on, required and should match the requested resources + The node ID to deploy the kubernetes node on, required and should match the requested resources """ return pulumi.get(self, "node_id") @@ -462,7 +415,7 @@ def node_id(self, value: Any): @pulumi.getter def description(self) -> Optional[pulumi.Input[str]]: """ - The description of the virtual machine workload, optional with no restrictions + The description of the kubernetes node, optional with no restrictions """ return pulumi.get(self, "description") @@ -472,27 +425,27 @@ def description(self, value: Optional[pulumi.Input[str]]): @property @pulumi.getter - def entrypoint(self) -> Optional[pulumi.Input[str]]: + def entry_point(self) -> Optional[pulumi.Input[str]]: """ The entry point for the flist. Example: /sbin/zinit init """ - return pulumi.get(self, "entrypoint") + return pulumi.get(self, "entry_point") - @entrypoint.setter - def entrypoint(self, value: Optional[pulumi.Input[str]]): - pulumi.set(self, "entrypoint", value) + @entry_point.setter + def entry_point(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "entry_point", value) @property @pulumi.getter - def env_vars(self) -> Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]: + def flist(self) -> Optional[pulumi.Input[str]]: """ - The environment variables to be passed to the virtual machine. Example: SSH_KEY + The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist """ - return pulumi.get(self, "env_vars") + return pulumi.get(self, "flist") - @env_vars.setter - def env_vars(self, value: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]]): - pulumi.set(self, "env_vars", value) + @flist.setter + def flist(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "flist", value) @property @pulumi.getter @@ -506,35 +459,11 @@ def flist_checksum(self) -> Optional[pulumi.Input[str]]: def flist_checksum(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "flist_checksum", value) - @property - @pulumi.getter - def gpus(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: - """ - A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - """ - return pulumi.get(self, "gpus") - - @gpus.setter - def gpus(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): - pulumi.set(self, "gpus", value) - - @property - @pulumi.getter - def mounts(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['MountArgs']]]]: - """ - A list of mounted disks or volumes - """ - return pulumi.get(self, "mounts") - - @mounts.setter - def mounts(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['MountArgs']]]]): - pulumi.set(self, "mounts", value) - @property @pulumi.getter def mycelium(self) -> Optional[pulumi.Input[bool]]: """ - A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node """ return pulumi.get(self, "mycelium") @@ -546,7 +475,7 @@ def mycelium(self, value: Optional[pulumi.Input[bool]]): @pulumi.getter def mycelium_ip_seed(self) -> Optional[pulumi.Input[str]]: """ - The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 """ return pulumi.get(self, "mycelium_ip_seed") @@ -558,7 +487,7 @@ def mycelium_ip_seed(self, value: Optional[pulumi.Input[str]]): @pulumi.getter def planetary(self) -> Optional[pulumi.Input[bool]]: """ - A flag to enable generating a yggdrasil IP for the virtual machine + A flag to enable generating a yggdrasil IP for the kubernetes node """ return pulumi.get(self, "planetary") @@ -570,7 +499,7 @@ def planetary(self, value: Optional[pulumi.Input[bool]]): @pulumi.getter def public_ip(self) -> Optional[pulumi.Input[bool]]: """ - A flag to enable generating a public IP for the virtual machine, public node is required for it + A flag to enable generating a public IP for the kubernetes node, public node is required for it """ return pulumi.get(self, "public_ip") @@ -582,7 +511,7 @@ def public_ip(self, value: Optional[pulumi.Input[bool]]): @pulumi.getter def public_ip6(self) -> Optional[pulumi.Input[bool]]: """ - A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it """ return pulumi.get(self, "public_ip6") @@ -590,30 +519,6 @@ def public_ip6(self) -> Optional[pulumi.Input[bool]]: def public_ip6(self, value: Optional[pulumi.Input[bool]]): pulumi.set(self, "public_ip6", value) - @property - @pulumi.getter - def rootfs_size(self) -> Optional[pulumi.Input[int]]: - """ - The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - """ - return pulumi.get(self, "rootfs_size") - - @rootfs_size.setter - def rootfs_size(self, value: Optional[pulumi.Input[int]]): - pulumi.set(self, "rootfs_size", value) - - @property - @pulumi.getter - def zlogs(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['ZlogArgs']]]]: - """ - A list of virtual machine loggers - """ - return pulumi.get(self, "zlogs") - - @zlogs.setter - def zlogs(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['ZlogArgs']]]]): - pulumi.set(self, "zlogs", value) - if not MYPY: class MetadataArgsDict(TypedDict): diff --git a/sdk/python/pulumi_threefold/kubernetes.py b/sdk/python/pulumi_threefold/kubernetes.py index 4a186e5..de35251 100644 --- a/sdk/python/pulumi_threefold/kubernetes.py +++ b/sdk/python/pulumi_threefold/kubernetes.py @@ -25,6 +25,9 @@ def __init__(__self__, *, network_name: pulumi.Input[str], token: pulumi.Input[str], workers: pulumi.Input[Sequence[pulumi.Input['K8sNodeInputArgs']]], + entry_point: Optional[pulumi.Input[str]] = None, + flist: Optional[pulumi.Input[str]] = None, + flist_checksum: Optional[pulumi.Input[str]] = None, solution_type: Optional[pulumi.Input[str]] = None, ssh_key: Optional[pulumi.Input[str]] = None): """ @@ -33,6 +36,9 @@ def __init__(__self__, *, :param pulumi.Input[str] network_name: The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist :param pulumi.Input[str] token: The cluster secret token. Each node has to have this token to be part of the cluster. This token should be an alphanumeric non-empty string :param pulumi.Input[Sequence[pulumi.Input['K8sNodeInputArgs']]] workers: Workers is a list holding the workers configuration for the kubernetes cluster + :param pulumi.Input[str] entry_point: The entry point for the flist. Example: /sbin/zinit init + :param pulumi.Input[str] flist: The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + :param pulumi.Input[str] flist_checksum: The checksum of the flist which should match the checksum of the given flist, optional :param pulumi.Input[str] solution_type: The solution type of the cluster, displayed as project name in contract metadata :param pulumi.Input[str] ssh_key: SSH key to access the cluster nodes """ @@ -40,10 +46,18 @@ def __init__(__self__, *, pulumi.set(__self__, "network_name", network_name) pulumi.set(__self__, "token", token) pulumi.set(__self__, "workers", workers) + if entry_point is not None: + pulumi.set(__self__, "entry_point", entry_point) + if flist is not None: + pulumi.set(__self__, "flist", flist) + if flist_checksum is not None: + pulumi.set(__self__, "flist_checksum", flist_checksum) if solution_type is None: solution_type = 'kubernetes/' if solution_type is not None: pulumi.set(__self__, "solution_type", solution_type) + if ssh_key is None: + ssh_key = '' if ssh_key is not None: pulumi.set(__self__, "ssh_key", ssh_key) @@ -95,6 +109,42 @@ def workers(self) -> pulumi.Input[Sequence[pulumi.Input['K8sNodeInputArgs']]]: def workers(self, value: pulumi.Input[Sequence[pulumi.Input['K8sNodeInputArgs']]]): pulumi.set(self, "workers", value) + @property + @pulumi.getter + def entry_point(self) -> Optional[pulumi.Input[str]]: + """ + The entry point for the flist. Example: /sbin/zinit init + """ + return pulumi.get(self, "entry_point") + + @entry_point.setter + def entry_point(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "entry_point", value) + + @property + @pulumi.getter + def flist(self) -> Optional[pulumi.Input[str]]: + """ + The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + """ + return pulumi.get(self, "flist") + + @flist.setter + def flist(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "flist", value) + + @property + @pulumi.getter + def flist_checksum(self) -> Optional[pulumi.Input[str]]: + """ + The checksum of the flist which should match the checksum of the given flist, optional + """ + return pulumi.get(self, "flist_checksum") + + @flist_checksum.setter + def flist_checksum(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "flist_checksum", value) + @property @pulumi.getter def solution_type(self) -> Optional[pulumi.Input[str]]: @@ -125,6 +175,9 @@ class Kubernetes(pulumi.CustomResource): def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, + entry_point: Optional[pulumi.Input[str]] = None, + flist: Optional[pulumi.Input[str]] = None, + flist_checksum: Optional[pulumi.Input[str]] = None, master: Optional[pulumi.Input[pulumi.InputType['K8sNodeInputArgs']]] = None, network_name: Optional[pulumi.Input[str]] = None, solution_type: Optional[pulumi.Input[str]] = None, @@ -136,6 +189,9 @@ def __init__(__self__, Create a Kubernetes resource with the given unique name, props, and options. :param str resource_name: The name of the resource. :param pulumi.ResourceOptions opts: Options for the resource. + :param pulumi.Input[str] entry_point: The entry point for the flist. Example: /sbin/zinit init + :param pulumi.Input[str] flist: The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + :param pulumi.Input[str] flist_checksum: The checksum of the flist which should match the checksum of the given flist, optional :param pulumi.Input[pulumi.InputType['K8sNodeInputArgs']] master: Master holds the configuration of master node in the kubernetes cluster :param pulumi.Input[str] network_name: The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist :param pulumi.Input[str] solution_type: The solution type of the cluster, displayed as project name in contract metadata @@ -166,6 +222,9 @@ def __init__(__self__, resource_name: str, *args, **kwargs): def _internal_init(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions] = None, + entry_point: Optional[pulumi.Input[str]] = None, + flist: Optional[pulumi.Input[str]] = None, + flist_checksum: Optional[pulumi.Input[str]] = None, master: Optional[pulumi.Input[pulumi.InputType['K8sNodeInputArgs']]] = None, network_name: Optional[pulumi.Input[str]] = None, solution_type: Optional[pulumi.Input[str]] = None, @@ -181,6 +240,9 @@ def _internal_init(__self__, raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') __props__ = KubernetesArgs.__new__(KubernetesArgs) + __props__.__dict__["entry_point"] = entry_point + __props__.__dict__["flist"] = flist + __props__.__dict__["flist_checksum"] = flist_checksum if master is None and not opts.urn: raise TypeError("Missing required property 'master'") __props__.__dict__["master"] = master @@ -190,6 +252,8 @@ def _internal_init(__self__, if solution_type is None: solution_type = 'kubernetes/' __props__.__dict__["solution_type"] = solution_type + if ssh_key is None: + ssh_key = '' __props__.__dict__["ssh_key"] = ssh_key if token is None and not opts.urn: raise TypeError("Missing required property 'token'") @@ -223,6 +287,9 @@ def get(resource_name: str, __props__ = KubernetesArgs.__new__(KubernetesArgs) + __props__.__dict__["entry_point"] = None + __props__.__dict__["flist"] = None + __props__.__dict__["flist_checksum"] = None __props__.__dict__["master"] = None __props__.__dict__["master_computed"] = None __props__.__dict__["network_name"] = None @@ -235,6 +302,30 @@ def get(resource_name: str, __props__.__dict__["workers_computed"] = None return Kubernetes(resource_name, opts=opts, __props__=__props__) + @property + @pulumi.getter + def entry_point(self) -> pulumi.Output[Optional[str]]: + """ + The entry point for the flist. Example: /sbin/zinit init + """ + return pulumi.get(self, "entry_point") + + @property + @pulumi.getter + def flist(self) -> pulumi.Output[Optional[str]]: + """ + The flist to be mounted in the kubernetes cluster nodes. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist + """ + return pulumi.get(self, "flist") + + @property + @pulumi.getter + def flist_checksum(self) -> pulumi.Output[Optional[str]]: + """ + The checksum of the flist which should match the checksum of the given flist, optional + """ + return pulumi.get(self, "flist_checksum") + @property @pulumi.getter def master(self) -> pulumi.Output['outputs.K8sNodeInput']: diff --git a/sdk/python/pulumi_threefold/outputs.py b/sdk/python/pulumi_threefold/outputs.py index 0843454..63f8e56 100644 --- a/sdk/python/pulumi_threefold/outputs.py +++ b/sdk/python/pulumi_threefold/outputs.py @@ -136,65 +136,54 @@ class K8sNodeInput(dict): def __init__(__self__, *, cpu: int, disk_size: int, - flist: str, memory: int, name: str, network_name: str, node_id: Any, description: Optional[str] = None, - entrypoint: Optional[str] = None, - env_vars: Optional[Mapping[str, str]] = None, + entry_point: Optional[str] = None, + flist: Optional[str] = None, flist_checksum: Optional[str] = None, - gpus: Optional[Sequence[str]] = None, - mounts: Optional[Sequence['outputs.Mount']] = None, mycelium: Optional[bool] = None, mycelium_ip_seed: Optional[str] = None, planetary: Optional[bool] = None, public_ip: Optional[bool] = None, - public_ip6: Optional[bool] = None, - rootfs_size: Optional[int] = None, - zlogs: Optional[Sequence['outputs.Zlog']] = None): + public_ip6: Optional[bool] = None): """ - :param int cpu: The cpu units needed for the virtual machine. Range in [1: 32] + :param int cpu: The cpu units needed for the kubernetes node. Range in [1: 32] :param int disk_size: Data disk size in GBs. Must be between 1GB and 10240GBs (10TBs) - :param str flist: The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - :param int memory: The memory capacity for the virtual machine in MB. Min is 250 MB - :param str name: The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + :param int memory: The memory capacity for the kubernetes node in MB. Min is 250 MB + :param str name: The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported :param str network_name: The name of the network, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported. Network must exist - :param Any node_id: The node ID to deploy the virtual machine on, required and should match the requested resources - :param str description: The description of the virtual machine workload, optional with no restrictions - :param str entrypoint: The entry point for the flist. Example: /sbin/zinit init - :param Mapping[str, str] env_vars: The environment variables to be passed to the virtual machine. Example: SSH_KEY + :param Any node_id: The node ID to deploy the kubernetes node on, required and should match the requested resources + :param str description: The description of the kubernetes node, optional with no restrictions + :param str entry_point: The entry point for the flist. Example: /sbin/zinit init + :param str flist: The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist :param str flist_checksum: The checksum of the flist which should match the checksum of the given flist, optional - :param Sequence[str] gpus: A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - :param Sequence['Mount'] mounts: A list of mounted disks or volumes - :param bool mycelium: A flag to generate a random mycelium IP seed to support mycelium in the virtual machine - :param str mycelium_ip_seed: The seed used for mycelium IP generated for the virtual machine. It's length should be 6 - :param bool planetary: A flag to enable generating a yggdrasil IP for the virtual machine - :param bool public_ip: A flag to enable generating a public IP for the virtual machine, public node is required for it - :param bool public_ip6: A flag to enable generating a public IPv6 for the virtual machine, public node is required for it - :param int rootfs_size: The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - :param Sequence['Zlog'] zlogs: A list of virtual machine loggers + :param bool mycelium: A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node + :param str mycelium_ip_seed: The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 + :param bool planetary: A flag to enable generating a yggdrasil IP for the kubernetes node + :param bool public_ip: A flag to enable generating a public IP for the kubernetes node, public node is required for it + :param bool public_ip6: A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it """ pulumi.set(__self__, "cpu", cpu) pulumi.set(__self__, "disk_size", disk_size) - pulumi.set(__self__, "flist", flist) pulumi.set(__self__, "memory", memory) pulumi.set(__self__, "name", name) pulumi.set(__self__, "network_name", network_name) pulumi.set(__self__, "node_id", node_id) if description is not None: pulumi.set(__self__, "description", description) - if entrypoint is not None: - pulumi.set(__self__, "entrypoint", entrypoint) - if env_vars is not None: - pulumi.set(__self__, "env_vars", env_vars) + if entry_point is None: + entry_point = '/sbin/zinit init' + if entry_point is not None: + pulumi.set(__self__, "entry_point", entry_point) + if flist is None: + flist = 'https://hub.grid.tf/tf-official-apps/threefoldtech-k3s-latest.flist' + if flist is not None: + pulumi.set(__self__, "flist", flist) if flist_checksum is not None: pulumi.set(__self__, "flist_checksum", flist_checksum) - if gpus is not None: - pulumi.set(__self__, "gpus", gpus) - if mounts is not None: - pulumi.set(__self__, "mounts", mounts) if mycelium is not None: pulumi.set(__self__, "mycelium", mycelium) if mycelium_ip_seed is not None: @@ -205,16 +194,12 @@ def __init__(__self__, *, pulumi.set(__self__, "public_ip", public_ip) if public_ip6 is not None: pulumi.set(__self__, "public_ip6", public_ip6) - if rootfs_size is not None: - pulumi.set(__self__, "rootfs_size", rootfs_size) - if zlogs is not None: - pulumi.set(__self__, "zlogs", zlogs) @property @pulumi.getter def cpu(self) -> int: """ - The cpu units needed for the virtual machine. Range in [1: 32] + The cpu units needed for the kubernetes node. Range in [1: 32] """ return pulumi.get(self, "cpu") @@ -226,19 +211,11 @@ def disk_size(self) -> int: """ return pulumi.get(self, "disk_size") - @property - @pulumi.getter - def flist(self) -> str: - """ - The flist to be mounted in the virtual machine, required and should be valid. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist - """ - return pulumi.get(self, "flist") - @property @pulumi.getter def memory(self) -> int: """ - The memory capacity for the virtual machine in MB. Min is 250 MB + The memory capacity for the kubernetes node in MB. Min is 250 MB """ return pulumi.get(self, "memory") @@ -246,7 +223,7 @@ def memory(self) -> int: @pulumi.getter def name(self) -> str: """ - The name of the virtual machine workload, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported + The name of the kubernetes node, it's required and cannot exceed 50 characters. Only alphanumeric and underscores characters are supported """ return pulumi.get(self, "name") @@ -262,7 +239,7 @@ def network_name(self) -> str: @pulumi.getter def node_id(self) -> Any: """ - The node ID to deploy the virtual machine on, required and should match the requested resources + The node ID to deploy the kubernetes node on, required and should match the requested resources """ return pulumi.get(self, "node_id") @@ -270,25 +247,25 @@ def node_id(self) -> Any: @pulumi.getter def description(self) -> Optional[str]: """ - The description of the virtual machine workload, optional with no restrictions + The description of the kubernetes node, optional with no restrictions """ return pulumi.get(self, "description") @property @pulumi.getter - def entrypoint(self) -> Optional[str]: + def entry_point(self) -> Optional[str]: """ The entry point for the flist. Example: /sbin/zinit init """ - return pulumi.get(self, "entrypoint") + return pulumi.get(self, "entry_point") @property @pulumi.getter - def env_vars(self) -> Optional[Mapping[str, str]]: + def flist(self) -> Optional[str]: """ - The environment variables to be passed to the virtual machine. Example: SSH_KEY + The flist to be mounted in the kubernetes node. Example: https://hub.grid.tf/tf-official-apps/base:latest.flist """ - return pulumi.get(self, "env_vars") + return pulumi.get(self, "flist") @property @pulumi.getter @@ -298,27 +275,11 @@ def flist_checksum(self) -> Optional[str]: """ return pulumi.get(self, "flist_checksum") - @property - @pulumi.getter - def gpus(self) -> Optional[Sequence[str]]: - """ - A list of gpu IDs to be used in the virtual machine. GPU ID format: //. Example: 0000:28:00.0/1002/731f - """ - return pulumi.get(self, "gpus") - - @property - @pulumi.getter - def mounts(self) -> Optional[Sequence['outputs.Mount']]: - """ - A list of mounted disks or volumes - """ - return pulumi.get(self, "mounts") - @property @pulumi.getter def mycelium(self) -> Optional[bool]: """ - A flag to generate a random mycelium IP seed to support mycelium in the virtual machine + A flag to generate a random mycelium IP seed to support mycelium in the kubernetes node """ return pulumi.get(self, "mycelium") @@ -326,7 +287,7 @@ def mycelium(self) -> Optional[bool]: @pulumi.getter def mycelium_ip_seed(self) -> Optional[str]: """ - The seed used for mycelium IP generated for the virtual machine. It's length should be 6 + The seed used for mycelium IP generated for the kubernetes node. It's length should be 6 """ return pulumi.get(self, "mycelium_ip_seed") @@ -334,7 +295,7 @@ def mycelium_ip_seed(self) -> Optional[str]: @pulumi.getter def planetary(self) -> Optional[bool]: """ - A flag to enable generating a yggdrasil IP for the virtual machine + A flag to enable generating a yggdrasil IP for the kubernetes node """ return pulumi.get(self, "planetary") @@ -342,7 +303,7 @@ def planetary(self) -> Optional[bool]: @pulumi.getter def public_ip(self) -> Optional[bool]: """ - A flag to enable generating a public IP for the virtual machine, public node is required for it + A flag to enable generating a public IP for the kubernetes node, public node is required for it """ return pulumi.get(self, "public_ip") @@ -350,26 +311,10 @@ def public_ip(self) -> Optional[bool]: @pulumi.getter def public_ip6(self) -> Optional[bool]: """ - A flag to enable generating a public IPv6 for the virtual machine, public node is required for it + A flag to enable generating a public IPv6 for the kubernetes node, public node is required for it """ return pulumi.get(self, "public_ip6") - @property - @pulumi.getter - def rootfs_size(self) -> Optional[int]: - """ - The root fs size in GB (type SSD). Can be set as 0 to get the default minimum - """ - return pulumi.get(self, "rootfs_size") - - @property - @pulumi.getter - def zlogs(self) -> Optional[Sequence['outputs.Zlog']]: - """ - A list of virtual machine loggers - """ - return pulumi.get(self, "zlogs") - @pulumi.output_type class Metadata(dict):