Difference between revisions of "Kubernetes Hairpin-Proxy"
Line 36: | Line 36: | ||
``` | ``` | ||
− | + | ||
root@km1:~/src/hairpin-proxy# k get svc --all-namespaces | grep hair | root@km1:~/src/hairpin-proxy# k get svc --all-namespaces | grep hair | ||
Line 43: | Line 43: | ||
/ # host minimal.uvoo.io | / # host minimal.uvoo.io | ||
minimal.uvoo.io has address 10.152.183.106 | minimal.uvoo.io has address 10.152.183.106 | ||
+ | |||
+ | Works from outside host | ||
+ | ~$ curl -L -k -H "Host: minimal.uvoo.io" https://km1 | ||
+ | Hello, world! | ||
+ | Version: 2.0.0 | ||
+ | Hostname: exampleservice-7b8db6b8b-qs6mz | ||
+ | |||
+ | |||
+ | but curl hangs in test container | ||
+ | curl -k http://minimal.uvoo.io |
Revision as of 00:20, 15 February 2021
Trying to get this to work on microk8s
https://github.com/compumike/hairpin-proxy
kubectl apply -f https://raw.githubusercontent.com/compumike/hairpin-proxy/v0.1.2/deploy.yml
kubectl get configmap -n kube-system coredns -o=jsonpath='{.data.Corefile}'
Still doesn't work
kubectl get svc -n ingress | grep ingress output: nginx-ingress-microk8s-controller-86rjl.ingress.svc.cluster.local kubectl edit deploy hairpin-proxy-haproxy -n hairpin-proxy # Modify with below spec: containers: - env: - name: TARGET_SERVER value: nginx-ingress-microk8s-controller-86rjl.ingress.svc.cluster.local image: compumike/hairpin-proxy-haproxy:0.1.2 kubectl expose pod nginx-ingress-microk8s-controller-86rjl --type=NodePort --port=8080 -n ingress
Pods are up
root@km1:~/src/hairpin-proxy# k get pods -n hairpin-proxy NAME READY STATUS RESTARTS AGE hairpin-proxy-controller-7b48d47458-xlzrt 1/1 Running 5 163m hairpin-proxy-haproxy-5c8b4c9cf-84n6j 1/1 Running 0 7m51s
root@km1:~/src/hairpin-proxy# k get svc --all-namespaces | grep hair
hairpin-proxy hairpin-proxy ClusterIP 10.152.183.106
/ # host minimal.uvoo.io minimal.uvoo.io has address 10.152.183.106
Works from outside host ~$ curl -L -k -H "Host: minimal.uvoo.io" https://km1 Hello, world! Version: 2.0.0 Hostname: exampleservice-7b8db6b8b-qs6mz
but curl hangs in test container curl -k http://minimal.uvoo.io