This project provides an experimental operator for managing FoundationDB clusters on Kubernetes.
Running the Operator
To run the operator in your environment, you need to install the controller and the CRDs:
(kubectl create -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/master/config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml) || (kubectl replace -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/master/config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml) (kubectl create -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/master/config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml) || (kubectl replace -f https://raw.githubusercontent.com/FoundationDB/fdb-kubernetes-operator/master/config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml) kubectl apply -f https://raw.githubusercontent.com/foundationdb/fdb-kubernetes-operator/master/config/samples/deployment.yaml
At that point, you can set up one of the sample clusters:
kubectl apply -f https://raw.githubusercontent.com/foundationdb/fdb-kubernetes-operator/master/config/samples/cluster_local.yaml
You can see logs from the operator by running
kubectl logs fdb-kubernetes-operator-controller-manager-0 --container=manager. To determine whether the reconciliation has completed, you can run
kubectl get foundationdbcluster sample-cluster. This will show the latest generation of the spec and the last reconciled generation of the spec. Once reconciliation has completed, these values will be the same.
Once the reconciliation is complete, you can run
kubectl exec -it sample-cluster-1 fdbcli to open up a CLI on your cluster.
You can also browse the sample directory for more examples of how to configure a cluster.
Most of these examples are designed for doing local development on the operator, so there may be aspects of them that you need to adapt if you want to run in a more realistic environment. The TLS examples assume you have a certificate and key stored in Kubernetes secrets, which may not be the mechanism you want to use for your certificates. The backup examples assume you have backup credentials stored in Kubernetes secrets, so the same consideration applies.
For more information about using the operator, see the user manual.
For more information on version compatibility, see our compatibility guide.
For more information on the fields you can define on the cluster resource, see the API documentation.
- Install GO on your machine, see the Getting Started guide for more information.
- Install KubeBuilder and its dependencies on your machine, see The KubeBuilder Book for more information.
- Set your $GOPATH, e.x.
- Install kustomize.
To get this controller running in a local Kubernetes cluster:
- Change your current directory to $GOPATH/src/github.com using the command
cd $GOPATH/src/github.comand run
mkdir foundationdbto create the directory
- CD into newly created directory and clone this github repo inside the created directory that is
config/test-certs/generate_secrets.bashto set up a secret with self-signed test certs.
make rebuild-operatorto install the operator.
kubectl apply -f config/samples/cluster_local_tls.yamlto create a new FoundationDB cluster with the operator.