https://github.com/teedjay/k8s-testing-k3d
Checking out k3d instead of kind as my local k8s cluster in docker
https://github.com/teedjay/k8s-testing-k3d
Last synced: 3 months ago
JSON representation
Checking out k3d instead of kind as my local k8s cluster in docker
- Host: GitHub
- URL: https://github.com/teedjay/k8s-testing-k3d
- Owner: teedjay
- Created: 2020-11-22T01:14:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-22T02:06:30.000Z (over 5 years ago)
- Last Synced: 2025-03-03T04:41:56.824Z (over 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to start k3d kubernetes cluster
- have Docker running
- brew install k3d
- brew install kubeclt
## Create a small cluster (name will be `k3s-default` if not specified)
Will start ingress loadbalancer Traefik on port 80, expose it on 10080 on localhost.
```
k3d cluster create -p "10080:80@loadbalancer"
k3d kubeconfig merge k3s-default --switch-context
```
## Start the nginx demo
Will start nginx and expose index.html with a bootstrap welcome page using ingress and inrgess rewrite rules.
```
kubectl apply -f pod.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml
```
## Testing the ingress routing
This should work in your browser with images etc : http://localhost:10080/web/
Here are some other rewrites that will "miss" the correct entrypoint.
```
# should be 404 from traefik ingress
curl -i :10080/
# using Prefix match, all will hit nginx
curl -i http://localhost:10080/web
curl -i http://localhost:10080/web123
curl -i http://localhost:10080/web/
# using Exact match, first should be 404 from ingress ingress, second should hit nginx
curl -i http://localhost:10080/copy
curl -i http://localhost:10080/copy/