-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation, examples. Fix templates used for tfplugindocs
- Loading branch information
1 parent
9114df7
commit c54edaf
Showing
36 changed files
with
745 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docs/data-sources/rancherk3d_cluster_list.md → docs/data-sources/cluster_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ata-sources/rancherk3d_kubeconfig.md.tmpl → docs/data-sources/kubeconfig.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...data-sources/rancherk3d_node_list.md.tmpl → docs/data-sources/node_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...-sources/rancherk3d_registry_list.md.tmpl → docs/data-sources/registry_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 13 additions & 3 deletions
16
docs/resources/rancherk3d_cluster_action.md → docs/resources/cluster_action.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "k3d_cluster_create Resource - terraform-provider-k3d" | ||
subcategory: "" | ||
description: |- | ||
--- | ||
|
||
# k3d_cluster_create (Resource) | ||
Creates a k3d cluster with all below passed configuration by leveraging k3d golang [code](github.com/k3d-io/k3d/v5). | ||
The below attributes are terraform translated k3d [config.yaml](https://k3d.io/v5.4.7/usage/configfile/) which would used while creating cluster via cli `k3d cluster create --config /path/to/cluster-config.yaml`. | ||
|
||
```terraform | ||
resource "k3d_cluster_create" "sample_cluster" { | ||
name = "default" | ||
servers_count = 1 | ||
agents_count = 2 | ||
// image = "rancher/k3s:v1.24.4-k3s1" | ||
kube_api { | ||
host_ip = "0.0.0.0" | ||
host_port = 6445 | ||
} | ||
// | ||
// ports { | ||
// host_port = 8080 | ||
// container_port = 80 | ||
// node_filters = [ | ||
// "loadbalancer", | ||
// ] | ||
// } | ||
k3d_options { | ||
no_loadbalancer = false | ||
no_image_volume = false | ||
} | ||
kube_config { | ||
update_default = true | ||
switch_context = true | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Optional | ||
|
||
- `agents_count` (Number) Count of agents in the cluster | ||
- `cluster_token` (String, Sensitive) superSecretToken to be used | ||
- `config_yaml` (String) | ||
- `env` (Block Set) Environment variables to be added nodes. (see [below for nested schema](#nestedblock--env)) | ||
- `host_aliases` (Block Set) /etc/hosts style entries to be injected into /etc/hosts in the node containers and in the NodeHosts section in CoreDNS. (see [below for nested schema](#nestedblock--host_aliases)) | ||
- `image` (String) Image name to be used for creation of cluster, it would be used along with kubernetes_version | ||
- `k3d_options` (Block Set) k3d runtime settings (see [below for nested schema](#nestedblock--k3d_options)) | ||
- `k3s_options` (Block Set) Options passed on to K3s itself (see [below for nested schema](#nestedblock--k3s_options)) | ||
- `kube_api` (Block Set, Max: 1) same as `--api-port myhost.my.domain:6445` (where the name would resolve to 127.0.0.1) (see [below for nested schema](#nestedblock--kube_api)) | ||
- `kube_config` (Block Set) Way to manage the kubeconfig generated after creating k3d clusters. (see [below for nested schema](#nestedblock--kube_config)) | ||
- `name` (String) Name of the Cluster to be created | ||
- `network` (String) Network to be associated with the cluster | ||
- `ports` (Block Set) Map ports from the node containers (via the serverlb) to the host (Format: [HOST:][HOSTPORT:]CONTAINERPORT[/PROTOCOL][@NODEFILTER]) (see [below for nested schema](#nestedblock--ports)) | ||
- `registries` (Block Set) Define how registries should be created or used (see [below for nested schema](#nestedblock--registries)) | ||
- `runtime` (Block Set, Max: 1) Runtime options for k3d (see [below for nested schema](#nestedblock--runtime)) | ||
- `servers_count` (Number) Count of servers | ||
- `subnetwork` (String) Define a subnet for the newly created container network | ||
- `volumes` (Block Set) Mount volumes into the nodes (Format: [SOURCE:]DEST[@NODEFILTER[;NODEFILTER...]] (see [below for nested schema](#nestedblock--volumes)) | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--env"></a> | ||
### Nested Schema for `env` | ||
|
||
Optional: | ||
|
||
- `extra_args` (String) | ||
- `key` (String) key of key-value pair | ||
- `node_filters` (List of String) | ||
- `value` (String) value of key-value pair | ||
|
||
|
||
<a id="nestedblock--host_aliases"></a> | ||
### Nested Schema for `host_aliases` | ||
|
||
Optional: | ||
|
||
- `hostnames` (List of String) list of hosts names mapped to an IP | ||
- `ip` (String) ip address to which the list of hostnames to be mapped | ||
|
||
|
||
<a id="nestedblock--k3d_options"></a> | ||
### Nested Schema for `k3d_options` | ||
|
||
Optional: | ||
|
||
- `loadbalancer_config_overrides` (List of String) Use dotted YAML path syntax to override nginx loadbalancer settings | ||
- `no_image_volume` (Boolean) Disable the creation of a volume for importing images. | ||
- `no_loadbalancer` (Boolean) Disable the creation of a LoadBalancer in front of the server nodes. | ||
- `no_rollback` (Boolean) Disable the automatic rollback actions, if anything goes wrong. | ||
- `timeout` (String) Rollback changes if cluster couldn't be created in specified duration. | ||
- `wait` (Boolean) Wait for the server(s) to be ready before returning. Use '--timeout DURATION' to not wait forever. (default true). | ||
|
||
|
||
<a id="nestedblock--k3s_options"></a> | ||
### Nested Schema for `k3s_options` | ||
|
||
Optional: | ||
|
||
- `extra_args` (Block List) additional arguments passed to the `k3s server|agent` command; same as `--k3s-arg` (see [below for nested schema](#nestedblock--k3s_options--extra_args)) | ||
- `node_labels` (Block List) same as `--k3s-node-label 'foo=bar@agent:1'` -> this results in a Kubernetes node label (see [below for nested schema](#nestedblock--k3s_options--node_labels)) | ||
|
||
<a id="nestedblock--k3s_options--extra_args"></a> | ||
### Nested Schema for `k3s_options.extra_args` | ||
|
||
Optional: | ||
|
||
- `extra_args` (String) | ||
- `key` (String) key of key-value pair | ||
- `node_filters` (List of String) | ||
- `value` (String) value of key-value pair | ||
|
||
|
||
<a id="nestedblock--k3s_options--node_labels"></a> | ||
### Nested Schema for `k3s_options.node_labels` | ||
|
||
Optional: | ||
|
||
- `extra_args` (String) | ||
- `key` (String) key of key-value pair | ||
- `node_filters` (List of String) | ||
- `value` (String) value of key-value pair | ||
|
||
|
||
|
||
<a id="nestedblock--kube_api"></a> | ||
### Nested Schema for `kube_api` | ||
|
||
Optional: | ||
|
||
- `host` (String) Important for the `server` setting in the kubeconfig. | ||
- `host_ip` (String) Where the Kubernetes API will be listening on. | ||
- `host_port` (Number) Specify the Kubernetes API server port exposed on the LoadBalancer. | ||
|
||
|
||
<a id="nestedblock--kube_config"></a> | ||
### Nested Schema for `kube_config` | ||
|
||
Optional: | ||
|
||
- `switch_context` (Boolean) Directly switch the default kubeconfig's current-context to the new cluster's context | ||
- `update_default` (Boolean) Directly update the default kubeconfig with the new cluster's context. | ||
|
||
|
||
<a id="nestedblock--ports"></a> | ||
### Nested Schema for `ports` | ||
|
||
Required: | ||
|
||
- `container_port` (Number) | ||
|
||
Optional: | ||
|
||
- `host` (String) | ||
- `host_port` (Number) | ||
- `node_filters` (List of String) | ||
- `protocol` (String) | ||
|
||
|
||
<a id="nestedblock--registries"></a> | ||
### Nested Schema for `registries` | ||
|
||
Optional: | ||
|
||
- `config` (String) define contents of the `registries.yaml` file (or reference a file); same as `--registry-config /path/to/config.yaml` | ||
- `create` (Boolean) creates a default registry to be used with the cluster | ||
- `use` (List of String) some other k3d-managed registry | ||
|
||
|
||
<a id="nestedblock--runtime"></a> | ||
### Nested Schema for `runtime` | ||
|
||
Optional: | ||
|
||
- `agents_memory` (String) Memory limit imposed on the agents nodes [From docker] | ||
- `gpu_request` (String) GPU devices to add to the cluster node containers ('all' to pass all GPUs) [From docker]. | ||
- `host_pid_mode` (Boolean) Enable host pid mode of server(s) and agent(s) | ||
- `labels` (Block List) Labels to be added node container. (see [below for nested schema](#nestedblock--runtime--labels)) | ||
- `servers_memory` (String) Memory limit imposed on the server nodes [From docker] | ||
|
||
<a id="nestedblock--runtime--labels"></a> | ||
### Nested Schema for `runtime.labels` | ||
|
||
Optional: | ||
|
||
- `extra_args` (String) | ||
- `key` (String) key of key-value pair | ||
- `node_filters` (List of String) | ||
- `value` (String) value of key-value pair | ||
|
||
|
||
|
||
<a id="nestedblock--volumes"></a> | ||
### Nested Schema for `volumes` | ||
|
||
Required: | ||
|
||
- `destination` (String) Destination path for the volume | ||
|
||
Optional: | ||
|
||
- `node_filters` (List of String) | ||
- `source` (String) Source path of volume mount | ||
|
||
|
14 changes: 10 additions & 4 deletions
14
...urces/rancherk3d_connect_registry.md.tmpl → docs/resources/connect_registry.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.