Generate scaffold with the following command.
operator-sdk init --plugins=ansible
operator-sdk create api --group hazelcast --version v1 --kind Hazelcast --generate-role
Then, you can add logic to roles/hazelcast/tasks/main.yaml
and role/hazelcast/defaults/main.yaml
.
docker build -t leszko/hazelcast-operator:ansible . && docker push leszko/hazelcast-operator:ansible
make install
make deploy IMG=leszko/hazelcast-operator:ansible
Check that the operator is running with the following command.
kubectl logs deployment.apps/operator-ansible-controller-manager -n operator-ansible-system -c manager
kubectl apply -f config/samples/hazelcast_v1_hazelcast.yaml
Note: If you want Hazelcast members themselves to form a cluster, you need to configure RBAC for Hazelcast: kubectl apply -f https://raw.githubusercontent.com/hazelcast/hazelcast-kubernetes/master/rbac.yaml
.
kubectl delete -f config/samples/hazelcast_v1_hazelcast.yaml
make undeploy