github.com/swisspost/terratest@v0.0.0-20230214120104-7ec6de2e1ae0/examples/kubernetes-kustomize-example/README.md (about)

     1  # Kubernetes Kustomize Example
     2  
     3  This folder contains a minimal Kubernetes resource config file to demonstrate how you can use Terratest to write
     4  automated tests for Kubernetes.
     5  
     6  This resource file deploys an nginx container as a single pod deployment with a node port service attached to it.
     7  
     8  See the corresponding terratest code for an example of how to test this resource config:
     9  - [kubernetes_kustomize_example_test.go](../../test/kubernetes_kustomize_example_test.go)
    10  
    11  
    12  ## Deploying the Kubernetes resource
    13  
    14  1. Setup a Kubernetes cluster. We recommend using a local version:
    15      - [minikube](https://github.com/kubernetes/minikube)
    16      - [Kubernetes on Docker For Mac](https://docs.docker.com/docker-for-mac/kubernetes/)
    17      - [Kubernetes on Docker For Windows](https://docs.docker.com/docker-for-windows/kubernetes/)
    18  
    19  1. Install and setup [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) to talk to the deployed
    20     Kubernetes cluster.
    21  1. Run `kubectl apply -k .`
    22  
    23  
    24  ## Running automated tests against this Kubernetes deployment
    25  
    26  1. Setup a Kubernetes cluster. We recommend using a local version:
    27      - [minikube](https://github.com/kubernetes/minikube)
    28      - [Kubernetes on Docker For Mac](https://docs.docker.com/docker-for-mac/kubernetes/)
    29      - [Kubernetes on Docker For Windows](https://docs.docker.com/docker-for-windows/kubernetes/)
    30  
    31  1. Install and setup [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) to talk to the deployed
    32     Kubernetes cluster.
    33  1. Install [Golang](https://golang.org/) and make sure this code is checked out into your `GOPATH`.
    34  1. `cd test`
    35  1. `dep ensure`
    36  1. `go test -v -tags kubernetes -run TestKubernetesKustomizeExample`