Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpakach/kube-go
Running a simple go application in Kubernetes locally with minikube
https://github.com/dpakach/kube-go
Last synced: about 1 month ago
JSON representation
Running a simple go application in Kubernetes locally with minikube
- Host: GitHub
- URL: https://github.com/dpakach/kube-go
- Owner: dpakach
- Created: 2021-03-31T10:41:38.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-31T13:08:25.000Z (almost 4 years ago)
- Last Synced: 2023-03-09T02:58:24.613Z (almost 2 years ago)
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## kube go
Testing out deploying simple go application in local kubernetes cluster with minikube### Commands available
- `make build` - Build the go binary
- `make docker-build` - Build the docker image for the app
- `make docker-push` - Push docker image to docker hub (change the image name to push to your docker hub)
- `make docker-run` - Run the docker image### Running the app in kubernetes with minikube
To run the app in kubernetes cluster use following commands
- First start local kubernetes cluster with minikube
```
minikube start
```- Then create the configmap and secret
```
kubectl apply -f kube-go-secret.yaml
kubectl apply -f kube-go-config.yaml
```- Then Start the deployment with
```
kubectl apply -f kube-go-deployment.yaml
```
This will run the app in kubernetes cluster with 2 replicas.
In order to change it, modify `kube-go-deployment.yaml` and rerun the above command.- To access the server from the browser start the service with
```
minikube service kube-go-service
```
minikube will automatically start your browser in the correct ip and port### Minikube
#### Installinghttps://minikube.sigs.k8s.io/docs/start/
#### Commands
Some of the commands available in minikube
```
minikube start
minikube status
minikube service kube-go-service
```### Kubectl
#### Installing
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#### commands
Some of the commands available in kubectl
```
kubectl get deployments
kubectl create deployment --image= [options]
kubectl delete deploymentkubectl edit deployment
kubectl get pods
kubectl delete podskubectl get replicaset
kubectl delete replicasetkubectl get services
kubectl create services
kubectl delete serviceskubectl logs
kubectl exec -it --
kubectl apply -f
```