https://github.com/sandipmavani/demo-kubernate-api
https://github.com/sandipmavani/demo-kubernate-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sandipmavani/demo-kubernate-api
- Owner: sandipmavani
- Created: 2020-01-27T16:51:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-27T16:52:58.000Z (over 5 years ago)
- Last Synced: 2025-01-11T21:10:52.194Z (5 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## How to make a call to Minikube Kubernetes API
run Minikube with command
```bash
minikube start
```1) first, you need to find IP of your local Minikube instance via command
```bash
minikube ip
```2) secondly, give a system user permissions to read the list of roles
```bash
kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts
```## How to build docker image in local
go on project root
```bash
eval $(minikube docker-env)
docker build -t demo-kubernate-api:dev .
```## How to deploy app to the Minikube
navigate to the folder resource-manifests and call two commands:
```bash
kubectl apply -f deployment-enumerator.yaml
kubectl apply -f service-enumerator.yaml
```and then you can open the service in your browser like so:
```bash
minikube service front-enumerator-api
```but, probably, the page will be empty. Please, modify the URL and call like so:
```bash
curl http://192.168.64.2:32262/ping
```## How to update version
```bash
kubectl rollout status deployment enumerator
```## Example request
In order to send a request to get filtered list of roles, please do the:
```bash
curl -X POST http://192.168.64.2:32262/enumerate --data '{"filter_by": "cloud"}'
```