k8s-operator

module
v0.0.0-...-69bc0f9 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: MIT

README

Resource Operator for Kubernetes

Examples for the articles cycle about managing k8s resources. It should work on local environment with minikube as a local k8s cluster.

Get started

Dependencies
  • Go 1.24
  • Docker Engine
  • Minikube
  • kubectl
Local environment

Firstly, you need to clone this repo:

# firstly
git clone https://github.com/uagolang/k8s-operator.git
# then
cd k8s-operator
go mod tidy

Then start minikube, check it status and use its context:

minikube start --nodes 2
minikube status
kubectl config use-context minikube

After that you need to execute docker login and then build Docker image and push it to the Docker Hub using command:

make docker-build docker-push

After that you need to generate all needed resources and deploy operator:

make generate
make manifests
make deploy

# use `make undeploy` to undeploy operator
# use `make uninstall` to uninstall CRDs
Create new CRD using CLI tool
go run cmd/cli/main.go valkey create --name=test --namespace=test --image=valkey/valkey --user=root --pass=root --replicas=1 --volume_enabled=true --cpu=200m --memory=512Mi --storage=512Mi

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the database v1alpha1 API group +kubebuilder:object:generate=true +groupName=database.kuberly.io
Package v1alpha1 contains API Schema definitions for the database v1alpha1 API group +kubebuilder:object:generate=true +groupName=database.kuberly.io
cmd
cli command
internal
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
test

Jump to

Keyboard shortcuts

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