tpl2git-operator

command module
v0.0.0-...-da63395 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

tpl2git-operator

framework choice

This repository contains a sample kubernetes operator built using operator-framework/operator-sdk.

Other Frameworks:

For an example using kubernetes-sigs/kubebuilder that comes with extensive documentation, including a youtube video of a talk by Michael Gasch & Rafael Brito at VMware code, see embano1/codeconnect-vm-operator.

generate project

must be in an empty directory (will not even let you have a .git directory)

initialize using operator-framework/operator-sdk

operator-sdk init --domain "stephanhcb.github.io" --repo "github.com/StephanHCB/tpl2git-operator" \
--license none --owner "StephanHCB" --plugins "go.kubebuilder.io/v3" --project-name "tpl2git-operator"

create a custom resource and a controller scaffold

operator-sdk create api --group tpl2git --version v1alpha1 --kind Renderer --resource --controller

implementation

edit api/v1alpha1/renderer_types.go to define the fields of your custom resource.

run make to adapt the code to reflect your changes.

run make manifests to create the custom resource definition manifests.

implement the reconcile loop, then build the binary

execution for debugging

  • build the binary
  • transfer it to a system with an admin kubeconfig
  • transfer config/crd directory
  • kubectl apply -k config/crd (uses built-in kustomize)
  • run the binary with access to an admin kubeconfig

For deployment into the cluster instead

  • build the docker image
  • push it to a registry the cluster can reach
  • kubectl apply -k config/default (uses built-in kustomize)

example resource

See example.yaml.

kubectl apply -f example.yaml

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the tpl2git v1alpha1 API group +kubebuilder:object:generate=true +groupName=tpl2git.stephanhcb.github.io
Package v1alpha1 contains API Schema definitions for the tpl2git v1alpha1 API group +kubebuilder:object:generate=true +groupName=tpl2git.stephanhcb.github.io

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳