Skip to content

shn27/bookstore-sample-controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bookstore-sample-controller

A Controller written in kubernetes sample-controller style which watches a custom resource named Bookstore. A resource create a deployment and a NodePort service. The container image is a simple bookstore api server. The NodePort service listen to request on host port 30000.

How to Use

Clone repo and move to directory

git clone [email protected]:shn27/bookstore-sample-controller.git
cd bookstore-sample-controller

Create a cluster using Kind

kind create cluster --config=clusterconfig.yaml

Create bookstores.shn.com Custom Resource Definition (CRD)

kc create -f menifest/crd-status-subresource.yaml

Build and Run the controller

go build .
./sample-controller -kubeconfig=clusterconfig.yaml

Create Custom Resource

kc create -f menifest/example-bookstore.yaml

Port Forward

kc port-forward service/bookstore 3000

Test

Use POSTMAN
USERNAME : admin
PASSWORD : 1234
https://github.com/shn27/BookStoreApi-Go

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published