Skip to content

Latest commit

 

History

History
 
 

kubernetes-basic-example

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Kubernetes Basic Example

This folder contains a minimal Kubernetes resource config file to demonstrate how you can use Terratest to write automated tests for Kubernetes.

This resource file deploys an nginx container as a single pod deployment with a node port service attached to it.

See the corresponding terratest code for an example of how to test this resource config:

Deploying the Kubernetes resource

  1. Setup a Kubernetes cluster. We recommend using a local version:

  2. Install and setup kubectl to talk to the deployed Kubernetes cluster.

  3. Run kubectl apply -f nginx-deployment.yml

Running automated tests against this Kubernetes deployment

  1. Setup a Kubernetes cluster. We recommend using a local version:

  2. Install and setup kubectl to talk to the deployed Kubernetes cluster.

  3. Install and setup kubectl.

  4. Install Golang and make sure this code is checked out into your GOPATH.

  5. cd test

  6. dep ensure

  7. go test -v -run TestKubernetesBasicExample

  8. You can also run TestKubernetesBasicExampleServiceCheck