Install on Kubernetes

Kubernetes

Deploy the platform

To install and configure the steadybit platform within Kubernetes you need to define the manifest. Below you will see an example of a YAML file to run the steadybit platform. Please replace the string 'replace-with-agent-key' with your specific Agent-Key and run the shown commands to encode the key correctly.

This needs to be done in three steps:

  1. Run echo -n _:<replace-with-agent-key> | base64 and fill in the result into the value for the auth key
  2. Run echo -n '{"auths":{"docker.steadybit.io":{"auth":"<replace-with-encoded-key-from-step-1>"}}}' | base64
  3. Fill in the result from Step 2 into the value for the .dockerconfigjson key

Example:

apiVersion: v1
kind: Namespace
metadata:
name: steadybit-platform
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: steadybit-platform
namespace: steadybit-platform
---
apiVersion: v1
kind: Secret
metadata:
name: regcredinternal
namespace: steadybit-platform
data:
.dockerconfigjson: <echo -n '{"auths":{"docker.steadybit.io":{"auth":"<echo -n _:<replace-with-agent-key> | base64>"}}}' | base64>
type: kubernetes.io/dockerconfigjson
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: steadybit-platform
labels:
run: steadybit-platform
name: steadybit-platform
spec:
replicas: 1
selector:
matchLabels:
run: steadybit-platform-exposed
template:
metadata:
labels:
run: steadybit-platform-exposed
spec:
containers:
- image: docker.steadybit.io/steadybit/platform
imagePullPolicy: Always
name: steadybit-platform
ports:
- name: ui-port
containerPort: 8080
protocol: TCP
- name: websocket-port
containerPort: 7878
protocol: TCP
env:
- name: SPRING_DATASOURCE_URL
value: "<replace-with-jdbc-url>"
- name: SPRING_DATASOURCE_USERNAME
value: "<replace-with-jdbc-user>"
- name: SPRING_DATASOURCE_PASSWORD
value: "<replace-with-jdbc-password>"
- name: STEADYBIT_TENANT_NAME
value: "<replace-with-tenant-name>"
- name: STEADYBIT_TENANT_KEY
value: "<replace-with-tenant-key>"
- name: STEADYBIT_TENANT_AGENTKEY
value: "<replace-with-agent-key>"
- name: STEADYBIT_AUTH_PROVIDER
value: "static"
- name: STEADYBIT_AUTH_STATIC_USERNAME
value: "admin"
- name: STEADYBIT_AUTH_STATIC_PASSWORD
value: "{noop}admin"
- name: STEADYBIT_WEB_PUBLIC_URL
value: "<replace with public url>"
imagePullSecrets:
- name: regcredinternal
---
apiVersion: v1
kind: Service
metadata:
namespace: steadybit-platform
labels:
run: steadybit-platform
name: steadybit-platform
spec:
ports:
- port: 80
name: ui-port
protocol: TCP
targetPort: 8080
- port: 7878
name: websocket-port
protocol: TCP
targetPort: 7878
selector:
run: steadybit-platform-exposed
type: LoadBalancer

Once the YAML file is customized you can apply it with kubectl:

kubectl apply -f steadybit-platform.yml

Create an ingress resource

Please keep in mind that you need to define an ingress controller to accesss the platform from the outside. That depends on your chosen K8s distribution. Below you will find examples for an ALB (AWS) and NGINX.

ALB
---
apiVersion: networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
kind: Ingress
metadata:
name: steadybit-platform-ingress
namespace: steadybit-platform
annotations:
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
labels:
app: steadybit-platform-ingress
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: steadybit-platform
servicePort: 80
- path: /
backend:
serviceName: steadybit-platform
servicePort: 7878
NGINX
---
apiVersion: networking.k8s.io/v1beta1 # for versions before 1.14 use extensions/v1beta1
kind: Ingress
metadata:
name: steadybit-platform-ingress
namespace: steadybit-platform
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: <replace with hostname>
http:
paths:
- path: /
backend:
serviceName: steadybit-platform
servicePort: 80
- path: /
backend:
serviceName: steadybit-platform
servicePort: 7878

Local test setup: Minikube + NGINX Ingress Controller

Below you find a complete example with Minikube and NGINX as Ingress to setup a local test environment for the platform with a Postgres database. Please replace the string 'replace-with-agent-key' with your specific Agent-Key and run the shown commands to encode the key correctly.

apiVersion: v1
kind: Namespace
metadata:
name: steadybit-platform
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: steadybit-platform
namespace: steadybit-platform
---
apiVersion: v1
kind: Secret
metadata:
name: regcredinternal
namespace: steadybit-platform
data:
.dockerconfigjson: <echo -n '{"auths":{"docker.steadybit.io":{"auth":"<echo -n _:<replace-with-agent-key> | base64>"}}}' | base64>
type: kubernetes.io/dockerconfigjson
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: steadybit-platform
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:11.5
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
value: "steadybitdb"
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
value: "postgres"
---
apiVersion: v1
kind: Service
metadata:
namespace: steadybit-platform
name: postgres
labels:
app: postgres
spec:
type: NodePort
ports:
- port: 5432
selector:
app: postgres
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: steadybit-platform
labels:
run: steadybit-platform
name: steadybit-platform
spec:
replicas: 1
selector:
matchLabels:
run: steadybit-platform-exposed
template:
metadata:
labels:
run: steadybit-platform-exposed
spec:
containers:
- image: docker.steadybit.io/steadybit/platform
imagePullPolicy: Always
name: steadybit-platform
ports:
- name: ui-port
containerPort: 8080
protocol: TCP
- name: websocket-port
containerPort: 7878
protocol: TCP
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://postgres.steadybit-platform:5432/steadybitdb"
- name: SPRING_DATASOURCE_USERNAME
value: "postgres"
- name: SPRING_DATASOURCE_PASSWORD
value: "postgres"
- name: STEADYBIT_TENANT_NAME
value: "Demo"
- name: STEADYBIT_TENANT_KEY
value: "db"
- name: STEADYBIT_TENANT_AGENTKEY
value: "abcdefghijklmn"
- name: STEADYBIT_AUTH_PROVIDER
value: "static"
- name: STEADYBIT_AUTH_STATIC_USERNAME
value: "admin"
- name: STEADYBIT_AUTH_STATIC_PASSWORD
value: "{noop}admin"
imagePullSecrets:
- name: regcredinternal
---
apiVersion: v1
kind: Service
metadata:
namespace: steadybit-platform
labels:
run: steadybit-platform
name: steadybit-platform
spec:
ports:
- port: 80
name: ui-port
protocol: TCP
targetPort: 8080
- port: 7878
name: websocket-port
protocol: TCP
targetPort: 7878
selector:
run: steadybit-platform-exposed
type: LoadBalancer
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: steadybit-platform-ingress
namespace: steadybit-platform
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: steadybit-platform
servicePort: 80
- path: /
backend:
serviceName: steadybit-platform
servicePort: 7878

First install Minikube to run on your system: https://minikube.sigs.k8s.io/docs/start

Start the cluster and enable the ingress resource:

minikube start
minikube addons enable ingress

Check if ingress is running. This could take a few seconds:

kubectl get -n steadybit-platform ingress

Apply manifest:

kubectl apply -f <steadybit-platform-deployment-minikube.yml>

Get the external IP of your cluster:

minikube ip

Add the following line to the bottom of the /etc/hosts file:

<replace with ip from above> platform.steadybit.local

Now you should be able to access the platform in your browser.

Need Help? Get in touch with us© steadybit. All rights reserved.