Skip to content

Latest commit

 

History

History
59 lines (37 loc) · 1.84 KB

File metadata and controls

59 lines (37 loc) · 1.84 KB

Delivering the example using a Helm-based operator

Preparation steps

RELEASE_VERSION=v0.8.0
curl -OJL https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu
sudo cp operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu /usr/local/bin/operator-sdk
rm operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu

Check operator-sdk is installed :

operator-sdk version

What has been done in this project

Creating the operatior project

Running initProject.sh will setup the basics for the operator. This script is just executing the following operator sdk command

operator-sdk init --plugins=helm --domain=helloservice--group=helloservice-demo --version=v1alpha1 --helm-chart ../charts/ Which creates a Helm-based operator based on the helm charts example. This will put everything in values into the CRD. You can find an example in ./config/samples/

Building the operator image

make docker-build docker-push IMG=ghcr.io/podtato-head/helloperator:latest

Installing the 'podtatoserver' Custom Resource Definition (CRD)

make install

Installing the operator

make deploy IMG=ghcr.io/podtato-head/helloperator:latest

Installing the 'podtatoserver' Custom Resource (CR)

kubectl apply -f ./config/samples/helloservice-demo_v1alpha1_podtatoserver.yaml

Seeing things in action

Cleaning up

kubectl delete -f ./config/samples/helloservice-demo_v1alpha1_podtatoserver.yaml
make undeploy

References