Open Service Broker API which provisions Redis and MariaDB instances via crossplane.
Based on crossplane-service-broker.
Most of the explanation on how this all works together currently lives in the VSHN Knowledgebase.
You'll need:
- A running kubernetes cluster (minishift, minikube, k3s, ... you name it) with crossplane installed
- kubectl and kustomize
- Go development environment
- Your favorite IDE (with a Go plugin)
- docker
- make
These are the most common make targets: build
, test
, docker-build
, run
.
.
├── cmd
│ └── swisscom-service-broker # main file
├── deploy
│ └── base # deployment files
├── docs # antora docs
├── e2e # e2e testing files
├── pkg
│ ├── custom # custom API with swisscom specifics
└── testdata # integration testing files
You can run the operator in different ways:
- using
make run
(provide your own env variables) - using
make kind-run
(uses KIND to install a cluster in docker and provides its own kubeconfig intestbin/
) - using a configuration of your favorite IDE (see below for VSCode example)
Example VSCode run configuration:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/swisscom-service-broker/main.go",
"env": {
"KUBECONFIG": "path/to/kubeconfig",
"OSB_USERNAME": "test",
"OSB_PASSWORD": "TEST",
"OSB_SERVICE_IDS": "PROVIDE-SERVICE-UUIDS-HERE",
"OSB_NAMESPACE": "test"
},
"args": []
}
]
}
"Integration" testing is done using envtest and crossplane's integration test helper.
make integration-test
The e2e tests currently only test if the deployment works. They do not represent a real e2e test as of now but are meant as a base to build upon.
You need node
and npm
to run the tests, as it runs with DETIK.
To run e2e tests for newer K8s versions run
make e2e-test
To remove the local KIND cluster and other resources, run
make clean