sample-operator

module
v0.0.0-...-76d2eae Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0

README

Operator reference implementation

sample-operator controls deployment of a simple, not customized nginx HTTP server.

Deployment

sample-operator is deployed in kubevirt namespace and deployment manifests will create it, if it's not present.

To deploy the operator execute following command:

kubectl apply -f manifests/v0.0.3/operator.yaml

Deployment of the HTTP server is controlled by the presence of a sampleconfig CR; to deploy it, execute:

kubectl apply -f manifests/v0.0.3/sampleconfig_types.go

The HTTP service listens on port 8081, which in turn is exposed as a node port 30080.

In case of deployments like CRC or kubevirtci, port forwarding might be required:

kubectl -n kubevirt port-forward service/http-server 8081:8081

To upgrade the HTTP server deployment, change configuration of the sample-operator container in the spec.template.spec.containers array of sample-operator deployment.

Building the sample operator

For convenience Makefile has been provided that helps with testing, building and publishing of the operator:

  • make docker-build will build both operator and HTTP server images (by default: quay.io/$USER/sample-operator:latest and quay.io/$USER/sample-http-server:latest)
  • make docker-push will push both images to the remote repository;

Directories

Path Synopsis
cmd
pkg
api-client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
api-client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
api-client/clientset/versioned/typed/sample/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
apis/sample
Package sample contains sample API versions.
Package sample contains sample API versions.
apis/sample/v1alpha1
Package v1alpha1 contains API Schema definitions for the sample v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=sample.lifecycle.kubevirt.io
Package v1alpha1 contains API Schema definitions for the sample v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=sample.lifecycle.kubevirt.io
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL