Skip to main content

Local Testing

Prerequisites
1Create kind cluster

The demo requires access to mission control via an ingress configuration. To route traffic into the kind cluster, it must be configured with a binding to a port on the host.

kind.config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 8080
protocol: TCP
- containerPort: 443
hostPort: 8443
protocol: TCP

A single node cluster will be provisioned, hosting both the control plane and workloads. Configure the hostPort bindings onto free ports, in this case 8080 and 8443 are used.

Provision the kind cluster with

kind create cluster --config kind.config

verify the cluster is running by using:

kubectl get nodes
2Provision Ingress controller

Install nginx ingress controller with:

The Kubernetes Nginx Ingress Controller maintains a kind-compatible manifest - deploy this to the cluster using:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

Confirm that the ingress controller pod is running with:

kubectl get pods -n ingress-nginx
3Install Mission Control

nip.io is simple wildcard DNS server that returns the ip provided in the host name, e.g.

nslookup  127.0.0.1.nip.io
Address: 127.0.0.1

By using nip you will be able to access mission-control without any further networking / configuration setup.

values.yaml
global:
ui:
host: 127.0.0.1.nip.io
helm repo add flanksource https://flanksource.github.io/charts
helm repo update
helm install mission-control \
flanksource/mission-control \
-n mission-control \
--create-namespace \
--wait \
-f values.yaml

See values.yaml for more options.

4Login

The default username is admin@local and the password can be retrived with:

kubectl get secret  mission-control-admin-password \
-n mission-control \
--template='{{.data.password | base64decode}}'

You can then goto https://127.0.0.1.nip.io:8443 to login.

Self-Signed Certificate

This example uses a self-signed certificate created by Nginx, We recommend using cert-manager.io.

5Taking your first step, creating a health check

Create a file containing canary definitions, for example:

apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
name: http
spec:
interval: 30
http:
- url: https://httpstat.us/200
name: "httpstat healthy"

and apply to the cluster with:

kubectl apply -f canaries.yaml

When you goto the Health tab you can then see the check running: