TerraTest: Test a Kubernetes deployment and service
In this story, we will see how to test a Kubernetes deployment and service. For that, we will use TerraTest.
Create the deployment and service manifests
Now, we will create the deployment and the service that we want to test. In first, let’s create a deployment manifest deploy.yaml
:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels…