Giter VIP home page Giter VIP logo

terraform-provider-kind's Introduction

⚠️ Archived

This repository has been deprecated and archived on Apr 1th, 2022.

An actively maintained fork can be found at https://github.com/tehcyx/terraform-provider-kind.

Terraform Provider for kind

Overview

The Terraform Provider for kind enables Terraform to provision local Kubernetes clusters on base of Kubernetes IN Docker (kind).

Quick Starts

Example Usage

Copy the following code into a file with the extension .tf to create a kind cluster with only default values.

provider "kind" {}

resource "kind_cluster" "default" {
    name = "test-cluster"
}

Then run terraform init, terraform plan & terraform apply and follow the on screen instructions. For more details on how to influence creation of the kind resource check out the Quick Start section above.

terraform-provider-kind's People

Contributors

a-thaler avatar brandonros avatar jrhouston avatar jwillebrands avatar keisukeyamashita avatar nickjj avatar pst avatar shaneramey avatar tehcyx avatar unicell avatar w9n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terraform-provider-kind's Issues

Help for using kubeadm_config_patches !!!

Hi All !
How to use kubeadm_config_patches on resource. I have tried this but not success.

        kubeadm_config_patches = [
            <<-INTF
            kind: InitConfiguration
              nodeRegistration: 
                  kubeletExtraArgs: 
                      node-labels = "ingress-ready=true"
           INTF

This is what I have got:

$ terraform apply "kind.out"
kind_cluster.default: Creating...
kind_cluster.default: Still creating... [10s elapsed]

Error: failed to generate kubeadm config content: failed to parse patches: failed to parse type meta for "kind: InitConfiguration\n nodeRegistration: \n kubeletExtraArgs: \n node-labels = "ingress-ready=true"\n": error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context
on main.tf line 13, in resource "kind_cluster" "default":
13: resource "kind_cluster" "default" {
]

Any example ? Please help ! Thanks in advance

MAA-BIK

nginx ingress is never reachable when using containerd_config_patches

After following the docs and looking at a bit of your tests I came up with:

resource "kind_cluster" "default" {
  name           = "example"
  wait_for_ready = true

  kind_config {
    kind        = "Cluster"
    api_version = "kind.x-k8s.io/v1alpha4"
    containerd_config_patches = [
      <<-TOML
      kind = "InitConfiguration"

      [nodeRegistration.kubeletExtraArgs]
      node-labels = "ingress-ready=true"
      TOML
    ]

    node {
      role = "control-plane"
      extra_port_mappings {
        container_port = 80
        host_port      = 80
      }
    }

    node {
      role = "worker"
    }
  }
}

After applying this, and applying kind's instructions for installing the nginx ingress at https://kind.sigs.k8s.io/docs/user/ingress/#ingress-nginx it always results in getting an empty reply from the server when running curl localhost.

If I use kind's config file and the kind CLI tool instead of this provider it works and the nginx ingress is reachable.

It's worth pointing out that the containerd_config_patches is applied to the control plane node in kind's config based on their documentation at https://kind.sigs.k8s.io/docs/user/ingress/#create-cluster. I'm not sure if that applies here but in your provider it expects it to be set on the kind_config itself, not the control plane.

Also I converted kind's YAML to TOML using an online converter.

Option to wait for cluster to become ready

Description

When you create a new cluster, the default behaviour is that it doesn't wait for the control plane node to become ready. i.e if you do a kubectl get no you'll see a NotReady status.

The kind package supports an option to wait but it is disabled by default. It would be nice to expose this as an optional attribute so we can tell Terraform to wait for the cluster to become fully ready.

Example

resource "kind" "example" {
  name = "example"
  wait_for_ready = true
}

Terraform has a timeouts feature baked in, so we could supply the value for the Create timeout when creating the kind cluster.

References

CreateWithWaitForReady option: https://github.com/kubernetes-sigs/kind/blob/master/pkg/cluster/createoption.go#L85

terraform init error

Hi, I follow the instructions in the README. After running terraform init, an error occurs:

[root@k8s1 terraform]# terraform init

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/kind...

Error: Failed to install provider

Error while installing hashicorp/kind: provider registry registry.terraform.io
does not have a provider named registry.terraform.io/hashicorp/kind

Anything else shoud I do to configure terraform?

kubectl configuration file issue MacOSX

On MacOS using podman (& podman machine), although I assume it would be the same for Docker Desktop users too.
In order to use Kind k8s api, you need to open the apiServerAdress on 0.0.0.0 rather than the default 127.0.0.1.

Eg a kind config file with:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  apiServerAddress: 0.0.0.0

If you leave it as default (127.0.0.1) then everything just times out, but the configuration file is correct, eg.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <REDCATED>
    server: https://127.0.0.1:56152
  name: kind-terraform-1-23

So I translated that config file into this awesome provider instead:

terraform {
  required_providers {
    kind = {
      source = "kyma-incubator/kind"
      version = "0.0.11"
    }
  }
}

resource "kind_cluster" "default" {
  name = var.cluster_name
  # Get latest available here: https://hub.docker.com/r/kindest/node/tags
  node_image = "kindest/node:v1.23.1"
  kind_config {
    kind = "Cluster"
    api_version = "kind.x-k8s.io/v1alpha4"
    networking {
      api_server_address = "0.0.0.0"
    }
  }
}

This was almost perfect until I tried to connect to the new cluster. I kept getting the following error:

(⎈ |kind-terraform-1-23:default)➜  kind-terraform git:(pf/terraform-kind-env) ✗ k get pods
Unable to connect to the server: tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config

A bit of a red herring as I found that the generated config file was slightly incorrect. The api_server_address input wasn't propagated to the config file. Neither the separate one, or the config in my default KUBECONFIG file.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: <REDACTED>
    server: https://:56509
  name: kind-terraform-1-23

It's a simple fix to edit the server field to include the 0.0.0.0 but I think this works when calling kind natively, without the module.

# Command
k config set clusters.<CLUSTER_NAME>.server https://0.0.0.0:<EXISTING_PORT>
# Example
k config set clusters.kind-terraform-1-23.server https://0.0.0.0:56509

I couldn't see where the kubectl config is generated but perhaps the custom setting isn't being passed or is being passed blank somewhere?
I have a workaround but thought others might see the same thing, so thought I'd share here to save some pain working it out.

[ EDIT ]
I looked in terraform state tf state show kind_cluster.default and the endpoint setting is also blank endpoint = "https://:57355" for example.

Also tried explicitly setting the address to 127.0.0.1 and that populates the config and state as expected:

  kind_config {
    kind = "Cluster"
    api_version = "kind.x-k8s.io/v1alpha4"
    networking {
      api_server_address = "127.0.0.1"
    }
  }

Create the pre-built binary for the plugin

Thank you for the development!
I would like to take this into our testing enivronment but I could not find the release here.
Could you mind to have the release binary for easy installation?

Publishing to Terraform registry

Heya! Is there any chance for this provider to be published to the Terraform registry? I see that @unicell has a fork that has been published, but it is currently two versions behind. Are there any plans to merge that effort into this repository? It would be great to have an easy way to pull in this provider.

Error: failed to init node with kubeadm

Terraform version: 0.15
Kind version: 0.10
Provider version: 0.0.7
OS: WSL

Terraform Plan

resource "kind_cluster" "this" {
      + client_certificate     = (known after apply)
      + client_key             = (known after apply)
      + cluster_ca_certificate = (known after apply)
      + endpoint               = (known after apply)
      + id                     = (known after apply)
      + kubeconfig             = (known after apply)
      + kubeconfig_path        = (known after apply)
      + name                   = "kind_cluster_name"
      + node_image             = "kindest/node:v1.20.2"
      + wait_for_ready         = true

      + kind_config {
          + api_version = "kind.x-k8s.io/v1alpha4"
          + kind        = "Cluster"

          + node {
              + role = "control-plan"
            }
        }
    }

Got Error

Error: failed to init node with kubeadm: command "docker exec --privileged horizontal_pod_autoscaler_lab-control-plane kubeadm init --skip-phases=preflight --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1

Change to standard value doesn't change anything

When you init/plan/apply the provided example main.tf file, it will create a cluster with a node:v1.15.3 image,

provider "kind" {}
resource "kind" "my-cluster" {
    name = "test-cluster"
}

if you then change it to e.g. a v1.16.1 image, do apply it will correctly delete and recreate the cluster

provider "kind" {}
resource "kind" "my-cluster" {
    name = "test-cluster"
    node_image = "kindest/node:v1.16.1"
}
but if you change it back to the initial state of the file, terraform will not delete and recreate a 1.15.3 cluster. I assume this is, because the schema defines `node_image` as Optional.

Cluster parameters not available as output

The kind_cluster resource doesn't have outputs that can be used by other modules to connect to the created cluster. The following state attributes should be exposed for other modules:

  • client_certificate
  • client_key
  • cluster_ca_certificate
  • endpoint
  • kubeconfig

How to overwrite kubeadm_config_patches default interfaces using this kind provider ?

@jwillebrands @unicell @pst @valentinvieriu @tehcyx

In fact I want to translate this type of yaml code

kubeadmConfigPatches:

  • |
    kind: JoinConfiguration
    nodeRegistration:
    kubeletExtraArgs:
    node-labels: "my-label2=true"

using this kind provider. In kind/schema_kind_config.go file, we have in func kindConfigNodeFields() map[string]*schema.Schema this
part of code:

	"kubeadm_config_patches": {
		Type:     schema.TypeList,
		Optional: true,
		Elem:     &schema.Schema{Type: schema.TypeString},
	},

How to be done for writing the corresponding kubeadmConfigPatches yaml code with kyma-incubator/terraform-provider-kind.
Could you give me an example to use that please !

[0.0.9] Does not work on Apple Silicon (M1 Pro)

When I run terraform init I get Provider registry.terraform.io/kyma-incubator/kind v0.0.9 does not have a package available for your current platform, darwin_arm64..

(Partial) content of versions.tf for one of my modules:

terraform { 
   required_providers { 
     kind = { 
       source = "kyma-incubator/kind" 
       version = "0.0.9" 
     }
   }
}

Example of how to use extra_port_mappings?

Hi,

I was looking at the resource documentation at https://github.com/kyma-incubator/terraform-provider-kind/blob/master/docs/resources/cluster.md but I didn't see a reference on how to use extra_port_mappings. I also didn't see any tests for this. I noticed that's the property name in the source code but I'm not well versed enough in Go in reverse what it expects as input.

I was trying to convert this kind.yaml config to TF using your provider:

nodes:
- role: "control-plane"
  extraPortMappings:
  - containerPort: 80
    hostPort: 80
  - containerPort: 443
    hostPort: 443

So far this is what I have:

node {
  role = "control-plane"
  extra_port_mappings = ??
}

Any suggestions?

Edit:

After a bit of tinkering this partially works:

      extra_port_mappings {
        container_port = 80
        host_port      = 80
      }

It passes the validate command but I don't see a path forward on how to define multiple ports (80 and 443) since it doesn't support setting [80, 443] as a value or defining the same container_port property twice.

Error applying when specifying network configuration

it seems that configuring a kind cluster with any network configuration defined at all terraform will crash when attempting to apply.

take, for example, this simple resource definition with an empty network configuration:

resource "kind_cluster" "default" {
  name = "testing"
  wait_for_ready = true

  kind_config {
    api_version = var.kind_api_version
    kind = "Cluster"

    networking {}

    node {
      role = "control-plane"
    }
  }
}

despite retrying with multiple arrangements of networking configuration values it consistently crashes on every attempt to apply. an interesting thing to note is that when creating the plan, it seems to always inject the optional disable_default_cni argument:

module.local_kind_cluster.kind_cluster.default will be created
  resource "kind_cluster" "default" {
      client_certificate     = (known after apply)
      client_key             = (known after apply)
      cluster_ca_certificate = (known after apply)
      endpoint               = (known after apply)
      id                     = (known after apply)
      kubeconfig             = (known after apply)
      kubeconfig_path        = (known after apply)
      name                   = "testing"
      node_image             = (known after apply)
      wait_for_ready         = true

      kind_config {
          api_version = "kind.x-k8s.io/v1alpha4"
          kind        = "Cluster"

          networking {
              disable_default_cni = false
            }

          node {
              role = "control-plane"
            }
        }
    }

using:

  • terraform version: 0.13.4
  • provider version: 0.0.5

find the relevant excerpt of the crash log below:

...
2020-10-03T20:00:44.942-0400 [DEBUG] plugin.terraform-provider-kind: 2020/10/03 20:00:44 Creating local Kubernetes cluster...
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: panic: interface conversion: interface {} is int, not int32
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind:
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: goroutine 40 [running]:
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind.flattenKindConfigNetworking(0xc0003ed920, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind/structure_kind_config.go:88 +0x561
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind.flattenKindConfig(0xc0003ec990, 0x1359dad)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind/structure_kind_config.go:27 +0x337
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind.resourceKindClusterCreate(0xc0003f1650, 0x0, 0x0, 0x2, 0x1fa6880)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/kyma-incubator/terraform-provider-kind/kind/resource_cluster.go:105 +0x7d6
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).Apply(0xc000196900, 0xc0000b3590, 0xc000613c60, 0x0, 0x0, 0x11b7701, 0xc0004f0808, 0xc00028a060)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/[email protected]/helper/schema/resource.go:310 +0x365
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Apply(0xc000188e00, 0xc000679a10, 0xc0000b3590, 0xc000613c60, 0xc000281948, 0xc000207108, 0x11b9b00)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/[email protected]/helper/schema/provider.go:294 +0x99
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ApplyResourceChange(0xc000206188, 0x1665000, 0xc000245680, 0xc0003f1030, 0xc000206188, 0xc000245680, 0xc00089cb78)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/[email protected]/internal/helper/plugin/grpc_provider.go:885 +0x8b4
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ApplyResourceChange_Handler(0x12fef80, 0xc000206188, 0x1665000, 0xc000245680, 0xc000701a40, 0x0, 0x1665000, 0xc000245680, 0xc000251000, 0xddd)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: github.com/hashicorp/[email protected]/internal/tfplugin5/tfplugin5.pb.go:3305 +0x217
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/grpc.(*Server).processUnaryRPC(0xc000683500, 0x1672b40, 0xc00009b200, 0xc000282300, 0xc0005f0960, 0x1f69920, 0x0, 0x0, 0x0)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/[email protected]/server.go:1024 +0x501
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/grpc.(*Server).handleStream(0xc000683500, 0x1672b40, 0xc00009b200, 0xc000282300, 0x0)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/[email protected]/server.go:1313 +0xd3d
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000516180, 0xc000683500, 0x1672b40, 0xc00009b200, 0xc000282300)
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/[email protected]/server.go:722 +0xa1
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: created by google.golang.org/grpc.(*Server).serveStreams.func1
2020-10-03T20:00:44.945-0400 [DEBUG] plugin.terraform-provider-kind: google.golang.org/[email protected]/server.go:720 +0xa1
2020-10-03T20:00:44.946-0400 [WARN] plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2020/10/03 20:00:44 [DEBUG] module.local_kind_cluster.kind_cluster.default: apply errored, but we're indicating that via the Error pointer rather than returning it: rpc error: code = Unavailable desc = transport is closing
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalMaybeTainted
2020/10/03 20:00:44 [TRACE] EvalMaybeTainted: module.local_kind_cluster.kind_cluster.default encountered an error during creation, so it is now marked as tainted
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalWriteState
2020/10/03 20:00:44 [TRACE] states.SyncState: pruning module.local_kind_cluster because it is empty
2020/10/03 20:00:44 [TRACE] EvalWriteState: removing state object for module.local_kind_cluster.kind_cluster.default
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalApplyProvisioners
2020/10/03 20:00:44 [TRACE] EvalApplyProvisioners: kind_cluster.default has no state, so skipping provisioners
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalMaybeTainted
2020/10/03 20:00:44 [TRACE] EvalMaybeTainted: module.local_kind_cluster.kind_cluster.default encountered an error during creation, so it is now marked as tainted
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalWriteState
2020/10/03 20:00:44 [TRACE] states.SyncState: pruning module.local_kind_cluster because it is empty
2020/10/03 20:00:44 [TRACE] EvalWriteState: removing state object for module.local_kind_cluster.kind_cluster.default
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalIf
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalIf
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalWriteDiff
2020/10/03 20:00:44 [TRACE] eval: *terraform.EvalApplyPost
2020/10/03 20:00:44 [ERROR] eval: *terraform.EvalApplyPost, err: rpc error: code = Unavailable desc = transport is closing
2020/10/03 20:00:44 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
...

Changed behavior between releases - kubeconfig server returns DNS name instead of IP

In the previous release the kubeconfig's server attribute was set to server: https://172.17.0.4:6443 but the new release sets server: https://kind-ops-localhost-control-plane:6443.

I'm using this kind provider in combination with my kustomize provider for the local development environment of the Kubestack GitOps framework. Unfortunately, after upgrading to the latest release of the kind provider this fails with:

Get "https://kind-ops-localhost-control-plane:6443/api?timeout=32s": dial tcp: lookup kind-ops-localhost-control-plane on 192.168.10.1:53: no such host

I can see that provider.KubeConfig always set true for the second parameter, which sounded like it would be related. But a quick hack setting this to false did not seem to restore the previous behavior. I checked upstream in the kind code base but could not find anything that suggests there was a change either. There are mentions of DNS now just working in the release notes. But it's not clear to me if this is related.

Any ideas what could have caused this or more importantly how to fix it? For what it's worth, the kubeconfig file created on the filesystem, does specify an IP and works.

Scheduler unhealthy

When creating a cluster via the following code..

resource "kind_cluster" "default" {
  name       = "my-cluster"
  node_image = "kindest/node:v1.22.4"
}

and run kubectl get componentstatuses I get the following:

Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS      MESSAGE                                                                                       ERROR
scheduler            Unhealthy   Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused   
controller-manager   Healthy     ok                                                                                            
etcd-0               Healthy     {"health":"true"}  

I am running terraform on M1 Pro.

Any idea why that happens? Shall I report that at https://github.com/kubernetes-sigs/kind ?

How can I use kind command to connect with kind cluster

Hello,I like this provider very much, It help me a lot. But I met some problem now.

When I use terrafrom and this provider build a kind cluster, I can not use kind command to communicate with kind cluster.

For example If I input "kind get clusters", I will get nothing. But actually I have made a kind cluster with this provider.

Any suggestions? Thank you very much

terraform init issue

Hi

I want to know if there is a way to check the way that kind search for the plugin. After I try to run terraform init it fails.

Provider "kind" not available for installation.

A provider named "kind" could not be found in the Terraform Registry.

This may result from mistyping the provider name, or the given provider may
be a third-party provider that cannot be installed automatically.

In the latter case, the plugin must be installed manually by locating and
downloading a suitable distribution package and placing the plugin's executable
file in the following directory:
terraform.d/plugins/linux_amd64

Terraform detects necessary plugins by inspecting the configuration and state.
To view the provider versions requested by each module, run
"terraform providers".

Error: no provider exists with the given name
How can I resolve this issue?.

load balancer issue

Hi

I configure kind and configured metalb. I want to know why I cannot expose any app to the outside with the loadbalancer.

fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$ kubectl --namespace=metallb-system get all
NAME READY STATUS RESTARTS AGE
pod/controller-64f86798cc-79dhv 1/1 Running 0 179m
pod/speaker-5vpzk 1/1 Running 0 179m
pod/speaker-5zskj 1/1 Running 0 179m
pod/speaker-wk297 1/1 Running 0 179m

NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
daemonset.apps/speaker 3 3 3 3 3 kubernetes.io/os=linux 179m

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/controller 1/1 1 1 179m

NAME DESIRED CURRENT READY AGE
replicaset.apps/controller-64f86798cc 1 1 1 179m

I tired to export the service of my app as a loadbalancer but I cannot access it from the outside

fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$ kubectl --namespace=selenium get all
NAME READY STATUS RESTARTS AGE
pod/selenium-hub-deployment-856d4bb8fd-545pj 1/1 Running 0 80m

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/selenium-hub LoadBalancer 10.96.165.222 172.19.255.201 4444:32048/TCP,5555:30298/TCP 80m

NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/selenium-hub-deployment 1/1 1 1 80m

NAME DESIRED CURRENT READY AGE
replicaset.apps/selenium-hub-deployment-856d4bb8fd 1 1 1 80m
fmontaldo@fmontaldo-ThinkPad-L14-Gen-1:~$

Expose configuration options as Terraform attributes instead of passing in YAML heredoc

👋 Thanks for making a provider for kind, this is super helpful for me.

Description

Something I do with some frequency is create kind clusters with certain feature gates enabled. I'd like to be able to do this just with attributes on the resource, instead of having to pass in a YAML heredoc.

There's a couple of ways we could do this. The ideal way would be to codify the schema for the cluster config file into the kind resource itself, so we could do things like this:

Example

resource "kind "example" {
   name = "example"
  
   feature_gates = {
       StartupProbe = true,
       TokenRequest = false,
   }
}

An advantage of this is that terraform validate will catch more problems upfront, but the downside is the maintenance burden of keeping the schema up to date. I haven't checked but if kind publishes a schema for their config file format we could probably automate this.

A simpler way of doing it would be to expose a config attribute that accepts an arbitrary map, which the provider could then decode into YAML, e.g:

resource "kind" "example" {
  name = "example"
  config = {
     kind = "Cluster"
     apiVersion = "kind.x-k8s.io/v1alpha4"
     featureGates = {
       TokenRequest = true
     }
  }
}

This would be easy to implement but suffers the problem that if you mess up the config format you wont find out until it blows up when you run apply.

I'm going to take a stab at this myself, but I wanted to open an issue for it capture my thoughts.

[enhancement] Support kubeconfig option during cluster creation

First of all, just wanted to give a shout of appreciation for putting together this provider. It's been really helpful for some automation of local development and test integration environments. =)

So wanted to formally request a feature here to enable specifying a custom kubernetes configuration file for cluster creation. If you refer to the kind cli for cluster creation:

$ kind create cluster --help
Creates a local Kubernetes cluster using Docker container 'nodes'

Usage:
  kind create cluster [flags]

Flags:
      --config string       path to a kind config file
  -h, --help                help for cluster
      --image string        node docker image to use for booting the cluster
      --kubeconfig string   sets kubeconfig path instead of $KUBECONFIG or $HOME/.kube/config
      --name string         cluster context name (default "kind")
      --retain              retain nodes for debugging when cluster creation fails
      --wait duration       wait for control plane node to be ready (default 0s)

Global Flags:
      --loglevel string   DEPRECATED: see -v instead
  -q, --quiet             silence all stderr output
  -v, --verbosity int32   info log verbosity

the kubeconfig option is quite useful if/when using separate kubernetes configuration files!

i believe the current behavior upon cluster creation is automatically updating either the kubernetes configuration file specified via the KUBECONFIG environment variable or defaulting to the ~/.kube/config file if not specified. while this provides a means to achieve what we want, it would be preferable to have a similar parity with other providers that already expect/accept the kubernetes configuration file as an input (e.g. terraform's kubernetes provider via the config_path variable) such that we can pass this variable across providers without having to have an environment variable set.

thank you in advance for your consideration!

Image loading with terraform

It will be awesome if this plugin could support this command.

kind load docker-image my-custom-image:unique-tag

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.