Kubernetes Simple on Microk8s
Jump to navigation
Jump to search
microk8s enable ingress microk8s enable dns kubectl create deployment exampleservice --image=gcr.io/google-samples/hello-app:2.0 -n ingress-nginx kubectl expose deployment exampleservice --type=NodePort --port=8080 apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: minimal-ingress annotations: # nginx.ingress.kubernetes.io/rewrite-target: / # nginx.ingress.kubernetes.io/rewrite-target: /$1 nginx.ingress.kubernetes.io/ssl-redirect: "false" spec: rules: - host: minimal.uvoo.io http: paths: - path: / pathType: Prefix backend: service: name: exampleservice port: number: 8080 kubectl apply -f minimal.yaml kubectl get ingress | grep minimal curl -H "Host: minimal.uvoo.io" 127.0.0.1 kubectl apply -f https://raw.githubusercontent.com/compumike/hairpin-proxy/v0.1.2/deploy.yml Add spec: tls: - hosts: - minimal.uvoo.io secretName: minimal-uvoo-io kubectl apply -f minimal.yaml kubectl run my-test-container --image=alpine -it --rm -- /bin/sh apk add bind-tools curl host minimal.uvoo.io host ingress-nginx-controller.ingress-nginx.svc.cluster.local