https://github.com/abdullahalshaad/bookstore-controller-kubebuilder
A Kubernetes Controller written using Kubebuilder which reconciles a custom resource named Bookstore
https://github.com/abdullahalshaad/bookstore-controller-kubebuilder
golang kubebuilder kubernetes
Last synced: 5 days ago
JSON representation
A Kubernetes Controller written using Kubebuilder which reconciles a custom resource named Bookstore
- Host: GitHub
- URL: https://github.com/abdullahalshaad/bookstore-controller-kubebuilder
- Owner: AbdullahAlShaad
- Created: 2022-01-24T10:12:06.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-26T12:25:34.000Z (over 3 years ago)
- Last Synced: 2025-04-08T14:50:53.950Z (3 months ago)
- Topics: golang, kubebuilder, kubernetes
- Language: Go
- Homepage:
- Size: 6.48 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bookstore-controller-kubebuilder
A Kubernetes Controller written using Kubebuilder. It reconciles a custom resource named Bookstore. A bookstore
object creates a deployment and service. We provide Replica count, Service Type, ContainerPort and
KindNodePort (if the service is type NodePort) with
other optional fields when creating an object of type Bookstore. The container image is a simple
[bookstore api server](https://github.com/Shaad7/bookstore-api-server). `port` value should match with `hostPort`
value in `cluster-config.yaml` file. If the `serviceType` is `NodePort` the server listens and serve request on given port.## How to Use
```shell
git clone https://github.com/Shaad7/bookstore-controller-kubebuilder
cd bookstore-controller-kubebuilder
```Create a cluster using [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)
```shell
kind create cluster --config=clusterconfig.yaml
```Generate CRD yaml and generated codes
```shell
make manifest
```Register CRD
```shell
make install
```Run the Controller
```shell
make run
```
Create an example Custom Resource
```shell
kubectl apply -f config/samples/core_v1_bookstore.yaml
```