add another example to the README.md
This check tests if a `deployment` and `service` can be created within your Kubernetes cluster. It will attempt to bring up a `deployment` with `2` replicas and a `service` of type `ClusterIP` in the `kuberhealthy` namespace and waits for the pods to come up. Once the `deployment` is ready, the check makes a request to the hostname looking for a `200 OK`. The check then proceeds to terminate them and ensures that the deployment and service terminations were successful. A complete tear down of the `deployment` and `service` after receiving a `200 OK` marks a successful test run.
-Container resource requests are set to `15 millicores` of CPU and `20Mi` units of memory and use the Nginx's latest image `nginx:latest` for the deployment. If the environment variable `CHECK_DEPLOYMENT_ROLLING_UPDATE` is set to `true`, the check will attempt to perform a rolling-update on the `deployment`. Once this rolling-update completes, the check makes another request to the hostname looking for a `200 OK` again before cleaning up. By default, the check will initially deploy Nginx's unprivileged `nginxinc/nginx-unprivileged:1.17.8` image, and update to `nginxinc/nginx-unprivileged:1.17.8`.
+Container resource requests are set to `15 millicores` of CPU and `20Mi` units of memory and use the Nginx's latest image `nginx:latest` for the deployment. If the environment variable `CHECK_DEPLOYMENT_ROLLING_UPDATE` is set to `true`, the check will attempt to perform a rolling-update on the `deployment`. Once this rolling-update completes, the check makes another request to the hostname looking for a `200 OK` again before cleaning up. By default, the check will initially deploy Nginx's unprivileged `nginxinc/nginx-unprivileged:1.17.8` image, and update to `nginxinc/nginx-unprivileged:1.17.9`.
Custom images can be used for this check and can be specified with the `CHECK_IMAGE` and `CHECK_IMAGE_ROLL_TO` environment variables. If a custom image requires the use of environment variables, they can be passed down into your container by setting the environment variable `ADDITIONAL_ENV_VARS` to a string of comma-separated values (`"X=foo,Y=bar"`).
@@ -91,6 +91,36 @@ spec:
restartPolicy: Always
```
+The following configuration will create a deployment with 6 replicas and roll from `nginxinc/nginx-unprivileged:1.17.8` to `nginxinc/nginx-unprivileged:1.17.9`:
+
+```yaml
+apiVersion: comcast.github.io/v1
+kind: KuberhealthyCheck
+metadata:
+ name: deployment
+ namespace: kuberhealthy
+spec:
+ runInterval: 10m
+ timeout: 15m
+ podSpec:
+ containers:
+ - name: deployment
+ image: kuberhealthy/deployment-check:v1.6.0
+ imagePullPolicy: IfNotPresent
+ env:
+ - name: CHECK_DEPLOYMENT_REPLICAS
+ value: "6"
+ - name: CHECK_DEPLOYMENT_ROLLING_UPDATE
+ value: "true"
+ resources:
+ requests:
+ cpu: 15m
+ memory: 15Mi
+ limits:
+ cpu: 25m
+ restartPolicy: Always
+```
+
#### Install
To use the *Deployment Check* with Kuberhealthy, apply the configuration file [deployment-check.yaml](deployment-check.yaml) to your Kubernetes Cluster. The following command will also apply the configuration file to your current context:
