kyma-companion-manager

module
v0.0.0-...-0585a07 Latest Latest
Warning

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

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

README

Kyma Companion Manager

REUSE status

Overview

Kyma Companion Manager is a standard Kubernetes operator that observes the state of companion resources and reconciles their state according to the desired state. It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached in the cluster.

This project is scaffolded using Kubebuilder, and all the Kubebuilder makefile helpers mentioned here can be used.

Get Started

You need a Kubernetes cluster to run against. You can use k3d to get a local cluster for testing, or run against a remote cluster.

[!NOTE] Your controller automatically uses the current context in your kubeconfig file, that is, whatever cluster kubectl cluster-info shows.

Development

Prerequisites
Run Kyma Companion Manager Locally
  1. Install the CRDs into the cluster:

    make install
    
  2. Run Kyma Companion Manager. It runs in the foreground, so if you want to leave it running, switch to a new terminal.

    make run
    

[!NOTE] You can also run this in one step with the command: make install run.

Run Tests

Run the unit and integration tests:

make generate-and-test
Linting
  1. Fix common lint issues:

    make imports
    make fmt
    make lint
    
Modify the API Definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs:

make manifests

[!NOTE] Run make --help for more information on all potential make targets.

For more information, see the Kubebuilder documentation.

Build Container Images

Build and push your image to the location specified by IMG:

make docker-build docker-push IMG=<container-registry>/kyma-companion-manager:<tag> # If using docker, <container-registry> is your username.

NOTE: For MacBook M1 devices, run:

make docker-buildx IMG=<container-registry>/kyma-companion-manager:<tag>

Deployment

You need a Kubernetes cluster to run against. You can use k3d to get a local cluster for testing, or run against a remote cluster.

[!NOTE] Your controller automatically uses the current context in your kubeconfig file, that is, whatever cluster kubectl cluster-info shows.

Deploy in the Cluster
  1. Download Go packages:

    go mod vendor && go mod tidy
    
  2. Install the CRDs to the cluster:

    make install
    
  3. Build and push your image to the location specified by IMG:

    make docker-build docker-push IMG=<container-registry>/kyma-companion-manager:<tag>
    
  4. Deploy the kyma-companion-manager controller to the cluster:

    make deploy IMG=<container-registry>/kyma-companion-manager:<tag>
    
  5. [Optional] Install Companion Custom Resource:

    kubectl apply -f config/samples/default.yaml
    
Undeploy Kyma Companion Manager

Undeploy Kyma Companion Manager from the cluster:

make undeploy
Uninstall CRDs

To delete the CRDs from the cluster:

make uninstall

Contributing

See the Contributing Rules.

Code of Conduct

See the Code of Conduct document.

Licensing

See the license file.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group +kubebuilder:object:generate=true +groupName=operator.kyma-project.io
Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group +kubebuilder:object:generate=true +groupName=operator.kyma-project.io
internal
pkg
env
k8s
test

Jump to

Keyboard shortcuts

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