Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

Latest commit

 

History

History

tomcat-operator

[DEPRECATED] Example: Tomcat Operator

This example is deprecated. The Helm operator functionality has been integrated into the Operator SDK as of v0.3.0. To get started developing a Helm operator with the SDK, see the Helm operator user guide.

Overview

Simple Operator using the official Tomcat Helm Chart and deployed directly or using the Operator Lifecycle Manager.

Build and push the tomcat-operator container

export IMAGE=quay.io/<namespace>/tomcat-operator:v0.0.1
docker build \
  --build-arg HELM_CHART=https://storage.googleapis.com/kubernetes-charts/tomcat-0.1.0.tgz \
  --build-arg API_VERSION=apache.org/v1alpha1 \
  --build-arg KIND=Tomcat \
  -t $IMAGE ../../

docker push $IMAGE

Deploying the tomcat-operator to your cluster

As a deployment:

kubectl create -f crd.yaml
kubectl create -n <operator-namespace> -f rbac.yaml

sed "s|REPLACE_IMAGE|$IMAGE|" operator.yaml.template > operator.yaml
kubectl create -n <operator-namespace> -f operator.yaml

Using the Operator Lifecycle Manager:

NOTE: Operator Lifecycle Manager must be installed in the cluster in advance.

kubectl create -f crd.yaml

sed "s|REPLACE_IMAGE|$IMAGE|" csv.yaml.template > csv.yaml
kubectl create -n <operator-namespace> -f csv.yaml

Deploying an instance of tomcat

kubectl create -n <operator-namespace> -f cr.yaml