Skip to content

Instantly share code, notes, and snippets.

@0xAhmed
Last active October 10, 2017 13:06
Show Gist options
  • Save 0xAhmed/750cc0c29575630083ce38b7c9a883cd to your computer and use it in GitHub Desktop.
Save 0xAhmed/750cc0c29575630083ce38b7c9a883cd to your computer and use it in GitHub Desktop.
Applying a k8s Ingress
$ kubectl --namespace=production apply -f app-ingress-production.yml
ingress "app-ingress" created
$ kubectl --namespace=production describe ingress
Name: app-ingress
Namespace: production
Address: 35.201.88.154
Default backend: kubeapp-production-service:80 (10.44.0.12:8080,10.44.1.9:8080,10.44.2.8:8080)
Rules:
Host Path Backends
---- ---- --------
* * kubeapp-production-service:80 (10.44.0.12:8080,10.44.1.9:8080,10.44.2.8:8080)
Annotations:
target-proxy: k8s-tp-production-app-ingress--148e223a5ddc229a
url-map: k8s-um-production-app-ingress--148e223a5ddc229a
backends: {"k8s-be-30848--148e223a5ddc229a":"HEALTHY"}
forwarding-rule: k8s-fw-production-app-ingress--148e223a5ddc229a
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
11m 11m 1 loadbalancer-controller Normal ADD production/app-ingress
10m 10m 1 loadbalancer-controller Normal CREATE ip: 35.201.88.154
10m 4m 4 loadbalancer-controller Normal Service default backend set to kubeapp-production-service:30848
$ export SERVICE_IP=$(kubectl --namespace=production get ingress/app-ingress --output=json | jq -r '.status.loadBalancer.ingress[0].ip')
$ curl http://$SERVICE_IP/
Congratulations! Version 1.0 of your application is running on Kubernetes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment