Skip to content

Instantly share code, notes, and snippets.

@zesty
Last active July 17, 2021 05:50
Show Gist options
  • Save zesty/b7792982e91175304ce342962345da4b to your computer and use it in GitHub Desktop.
Save zesty/b7792982e91175304ce342962345da4b to your computer and use it in GitHub Desktop.
helloworld on s3d
# tested on ubuntu 20.04
k3d cluster create mycluster --port 8080:80@loadbalancer --port 8443:443@loadbalancer
kubectl get all
kubectl create -f helloworld.yaml
kubectl expose deployment helloworld
kubectl create -f helloworld-ingress.yaml
kubectl get pod,svc,ing
# http://localhost:8443 the default self-signed traefik cert will cause a browser warning, but it does work
file contents "helloworld-ingress.yaml":
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: helloworldingress
annotations:
ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: helloworld
port:
number: 80
# to remove ingress
# kubectl delete ingress helloworldingress
# references:
# create cluster with port mapping:
# https://en.sokube.ch/post/k3s-k3d-k8s-a-new-perfect-match-for-dev-and-test-1
# ingress config:
# https://k3d.io/usage/guides/exposing_services/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment