A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cjihrig/kubenode below:

cjihrig/kubenode: Kubernetes tools for Node.js

Kubenode is a set of modules and tools for working with Kubernetes in Node.js.

This section demonstrates the process of creating a new Kubernetes Custom Resource Definition (CRD) and corresponding controller using the Kubenode CLI. This is meant to get up and running quickly. A more in depth guide is available on my blog.

Initialize a new Kubenode project using the following command. This command will create a number of files and directories in the current directory.

mkdir /tmp/kubenode
cd /tmp/kubenode
npx kubenode init -p library-project -d library.io

Create scaffolding for a new Book resource type using the following command. This will create several more files and directories containing controller code, types, and a sample resource that can be applied to your Kubernetes cluster later. It will also update the existing code to run the new controller.

Note: The generated controller is an empty skeleton that runs, but does not do anything. For the purposes of this guide, it may be helpful to add console.log(req) to the generated reconcile() function.

npx kubenode add api -g library.io -v v1 -k Book

Generate a CRD from the types created in the previous step using the following codegen command:

npx kubenode codegen -g library.io -v v1 -k Book

Add a validating webhook for the new Book type via the following command:

npx kubenode add webhook -g library.io -v v1 -k Book -a

The generated resources need to be built into an image and pushed to a registry. In order to do this, the image needs a name. The resources are scaffolded with an image reference of controller:latest. You will need to decide on an image name of your own. The following command configures the project to use an image reference of localhost:5000/controller. You should substitute your own image reference instead.

npx kubenode configure manager-image localhost:5000/controller

Build the image and push it to the registry using the following command:

npm run docker-build
npm run docker-push

Deploy the generated system using the following command:

At this point, you can create a new instance of your CRD by applying the generated sample to the cluster using the following command:

kubectl apply -f config/samples/library.io_v1_book.yaml

If you added a console.log() to your controller it should be executed once the sample resource is created. You can view the logs via the following command:

kubectl logs -n kubenode deployment/controller-manager -f

The system can be torn down using the following command:

Generates resources for a new CRD.

Flags:

Generates resources for validating and mutating webhooks.

Flags:

Generates configuration files for a CRD that was previously created via the kubenode add api command.

Flags:

kubenode configure manager-image IMAGE_REFERENCE

Sets the project's image reference to be IMAGE_REFERENCE.

Flags:

Initializes a new project.

Flags:

This project was heavily inspired by Kubebuilder and its subprojects such as controller-runtime. Some of the code here has been adapted from those projects.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4