Lab with Kind, Terraform and YAKS
This is a lab experiment that creates a Kind Kubernetes cluster, installs a YAKS Operator using Terraform and run a sample test.
- Terraform v. 1.4.5
- Kubectl v. 1.27.1
- Yaks v. 0.16.0
- Git v. 2.34.1
- Install all tools
- Using an IDE such as VS Code or even any terminal, clone locally this repository with Git
- Run
terraform apply -auto-approve
will create all resources (this may take ~ 5 min)
- Run a test with command
yaks run apps/yaks/helloworld.feature
- Show tests results with
kubectl get tests
Below is the documentation of Terraform code produced to this lab.
No modules.
Name |
Description |
Type |
Default |
Required |
apps |
Information to configure applications in K8s Cluster |
map |
{ "olm": { "yamls": { "crds": "https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/crds.yaml", "olm": "https://raw.githubusercontent.com/operator-framework/operator-lifecycle-manager/master/deploy/upstream/quickstart/olm.yaml" } }, "yaks": { "instance": { "name": "yaks", "namespace": "operators", "operator": { "global": false, "namespace": "operators" }, "yaml_path": "apps/yaks/instance.yaml" }, "subscription": { "channel": "alpha", "name": "yaks-poc", "namespace": "operators", "operator": { "name": "yaks", "source": { "name": "operatorhubio-catalog", "namespace": "olm" } }, "time_to_wait": "90s", "yaml_path": "apps/yaks/subscription.yaml" } } } |
no |
cluster |
Information to configure the K8s Cluster |
map |
{ "api_version": "kind.x-k8s.io/v1alpha4", "name": "kind-lab-k8s-cluster", "node_image": "kindest/node:v1.24.0" } |
no |
kubernetes_resources |
Type of resources created in cluster that will be labeled |
map |
{ "instance": { "api_version": "yaks.citrusframework.org/v1alpha1", "kind": "Instance" }, "subscription": { "api_version": "operators.coreos.com/v1alpha1", "kind": "Subscription" } } |
no |
terraform_managed_by_label |
Content of label to be put throughout all resources created in cluster |
map |
{ "app.kubernetes.io/managed-by": "terraform" } |
no |
Name |
Description |
yaks_info |
Information about the YAKS instance created on K8S cluster |