Kubernetes Operator
The operator acts like a SRE inside your own cluster, properly deploying and configuring the various Speedscale components.
The Speedscale Kubernetes Operator works similarly to a service mesh controller like Istio or Linkerd. It waits for deployments to be applied to the cluster that contain specific annotations. It then automatically stands up an isolation test environment around the deployment. The operator itself is a deployment that will be always present on the cluster.

Install Operator

The Speedscale Operator is compatible with Kubernetes 1.16 and newer releases. To deploy the operator, run:
1
speedctl deploy operator -e $(kubectl config current-context) | kubectl apply -f -
Copied!
If you'd like to review the yaml beforehand then remove the call to kubectl and inspect. The output should look something like this:
1
namespace/speedscale created
2
secret/gcrcred created
3
secret/awscreds created
4
secret/ss-certs created
5
secret/operator-cert created
6
configmap/speedscale-controller created
7
role.rbac.authorization.k8s.io/speed-operator-leader-election-role created
8
clusterrole.rbac.authorization.k8s.io/speed-operator-manager-role created
9
clusterrole.rbac.authorization.k8s.io/speed-operator-proxy-role created
10
clusterrole.rbac.authorization.k8s.io/speed-operator-metrics-reader created
11
rolebinding.rbac.authorization.k8s.io/speed-operator-leader-election-rolebinding created
12
clusterrolebinding.rbac.authorization.k8s.io/speed-operator-manager-rolebinding created
13
clusterrolebinding.rbac.authorization.k8s.io/speed-operator-proxy-rolebinding created
14
service/speed-operator-controller-manager-metrics-service created
15
service/speed-operator-webhook-service created
16
deployment.apps/speed-operator-controller-manager created
17
mutatingwebhookconfiguration.admissionregistration.k8s.io/speed-operator-mutating-webhook-configuration created
Copied!
Once you're done, go ahead and make sure the operator pods are running properly:
1
kubectl -n speedscale get pods
Copied!
Note: The operator will start 2 other pods (forwarder and redis) after it starts. On your cluster the ids of the pods will be different.
1
NAME READY STATUS RESTARTS AGE
2
speed-operator-controller-manager-xxxxxxxxxx-xxxxx 2/2 Running 0 16s
3
speedscale-forwarder-xxxxxxxxx-xxxxx 1/1 Running 0 10s
4
speedscale-redis-xxxxxxxxxx-xxxxx 1/1 Running 0 10s
Copied!

Uninstall Operator

Before you uninstall the operator, make sure that you have uninjected the sidecar from your pods.
To uninstall the Speedscale Operator, run the following command:
1
speedctl deploy operator | kubectl delete -f -
Copied!
This command must be run to properly delete the Operator.

Using Minikube

If you get webhook errors when running in minikube, it could be related to the network configuration. You need to add these 2 flags to your start command to ensure the network is properly configured:
1
minikube start \
2
--cni=true --container-runtime=containerd \
3
--ALL_YOUR_OTHER_FLAGS_HERE
Copied!

Using microk8s

If you get webhook errors when running in microk8s, it could be related to the network configuration. You need to enable the dns add-on to ensure the network is properly configured:
1
microk8s enable dns
Copied!

Seeing Webhook Errors?

Manually deleting the speedscale namespace will cause your cluster to stop accepting deployments due to a dangling mutating webhook. The error may look something like this:
1
Internal error occurred: failed calling webhook "operator.speedscale.com":
2
Post "https://speed-operator-webhook-service.speedscale.svc:443/mutate-speedscale-speedscale-com-v1-isotest?timeout=30s":
3
dial tcp xx.xx.xx.xx:443: connect: connection refused
Copied!
If you experience this problem, you can fix your cluster by deleting the webhook manually:
1
kubectl delete mutatingwebhookconfigurations.admissionregistration.k8s.io speed-operator-mutating-webhook-configuration
Copied!
After the webhook has been deleted, re-run the full operator delete command to make sure that service roles and other items are properly cleaned up.
Last modified 12d ago