Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcopalomo/routing-handlers-golang-k8s
https://github.com/marcopalomo/routing-handlers-golang-k8s
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/marcopalomo/routing-handlers-golang-k8s
- Owner: MarcoPalomo
- Created: 2023-01-31T23:35:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-04T17:20:23.000Z (about 2 years ago)
- Last Synced: 2024-11-19T12:27:16.864Z (3 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Routing handlers golang k8s
### What it does ?
`app`uses gorilla mux library for routing. Get your /health and /readiness endpoints apart from the '/' endpoint.
## RUN
You will need a minikube (or kind, microk8s...) to deploy your app locally. Using minikube, you can do :
```bash
$ minikube start
```Deployment will be made applying the manifest with kubectl.
```bash
$ kubectl apply -f manifests/deploy.yaml
deployment.apps/go-hello-world created
```Done! You can get the deployments like this:
```bash
$ kubectl get deployments
NAME READY UP-TO-DATE AVAILABLE AGE
go-hello-world 3/3 3 3 25s
```Pods are allocated a private IP address by default and cannot be reached outside of the cluster. You can use the kubectl port-forward command to map a local port to a port inside the pod like this:
```bash
$ kubectl port-forward go-hello-world-69b45499fb-7fh87 8080:8080
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
```...And interact with the Pod on the forwarded port:
```bash
$ curl localhost:8080
Hello, Guest
$ curl localhost:8080?name=Marco
Hello, Marco
```