Skip to content

A reference implementation of the guestbook-application from the official Kubernetes documentation demonstrating building an operator with the Operator Builder tool.

Notifications You must be signed in to change notification settings

nukleros/guestbook-app-ref-implementation-for-operator-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guestbook Application Reference Implementation for Operator Builder

This repository uses two projects to construct an operator, based on the Kubernetes sample guestbook application.

  • YAML Overlay Tool Used for taking the source manifests found in the Kubernetes documentation and injecting operator-builder workload markers to prepare for building an operator.
  • Operator Builder Used for constructing a fully functional operator from source Kubernetes manifests that have been marked up for CRD customization.

How to use this repository

  • Clone the repository

  • Overlay the source manifests: cd .yot; yot -i yot.yaml

  • Initialize the repository for Operator Builder:

# assuming you're in .yot still
cd ..
go mod init guestbook-app

operator-builder init \
    --workload-config .source/workload.yaml \
    --skip-go-version-check
  • Build the guestbook operator:
operator-builder create api \
    --workload-config .source/workload.yaml \
    --controller \
    --resource
  • Install the guestbook CRD to your cluster:
make install
  • Run the operator locally for testing purposes:
make run
  • Since the controller is occupying your terminal, you'll want to start up another terminal to install the sample CR to your Kubernetes cluster:
kubectl apply -f config/samples

You should now see the guestbook application get deployed into your cluster.

Please reference the operator-builder documentation for all the details on building more complex operators.

About

A reference implementation of the guestbook-application from the official Kubernetes documentation demonstrating building an operator with the Operator Builder tool.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published