Socket
Socket
Sign inDemoInstall

github.com/lalatendumohanty/another-replicaset-operator

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/lalatendumohanty/another-replicaset-operator


Version published
Created
Source

Another ReplicaSet Controller/Operator

The objective is to implement a replicaset controller similar to Kube replicaset controller using kubebuilder quick start. The process of implementating a controller will help the developer better understanding the challenges and understanding of how Kubernetes controllers work.

Steps to generate this project

$ go mod init another-replicaset-operator

$ kubebuilder version
  Version: main.version{KubeBuilderVersion:"3.1.0", KubernetesVendor:"1.19.2", GitCommit:"92e0349ca7334a0a8e5e499da4fb077eb524e94a", BuildDate:"2021-05-27T17:54:28Z", GoOs:"linux", GoArch:"amd64"}

$ kubebuilder init --domain my.domain
$ kubebuilder create api --group replicaset --version v1alpha1 --kind AnotherReplicaSet

Steps after changing the API

  • If you are editing the API definitions, generate the manifests such as Custom Resources (CRs) or Custom Resource Defintions (CRDs) using
make manifests

Steps to run the operator

  • Before running the operator , check if the api group already exists
kubectl api-resources --api-group=replicaset.my.domain
  • Install the CRDs into the cluster:
make install
  • Run your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running)
make run
  • Check the api-resources (optional)
$ kubectl api-resources --api-group=replicaset.my.domain
NAME                 SHORTNAMES   APIVERSION                      NAMESPACED   KIND
anotherreplicasets                replicaset.my.domain/v1alpha1   true         AnotherReplicaSet

Steps to test the operator

  • Apply the custom resource in another terminal which has KUBECONFIG configured for the kube environment
  kubectl apply -f manifests/busybox/busybox-another-replicaset.yaml --validate=false

Uninstall CRDs

  • To delete your CRDs from the cluster
make uninstall

Undeploy controller

  • Undeploy the controller to the cluster
make undeploy

FAQs

Package last updated on 09 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc