Skip to content

Instantly share code, notes, and snippets.

@kbruner
Created December 1, 2020 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbruner/9861aabae29be2f23bab504385e79200 to your computer and use it in GitHub Desktop.
Save kbruner/9861aabae29be2f23bab504385e79200 to your computer and use it in GitHub Desktop.
root@nucklehead:~ # kubectl expose deployment nginx --port 80 --type NodePort
service/nginx exposed
root@nucklehead:~ # NODE_PORT=$(kubectl get svc nginx \
--output=jsonpath='{range .spec.ports[0]}{.nodePort}')
root@nucklehead:~ # curl -I http://10.10.0.20:${NODE_PORT}/
HTTP/1.1 200 OK
Server: nginx/1.19.5
Date: Tue, 01 Dec 2020 01:30:19 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 24 Nov 2020 13:02:03 GMT
Connection: keep-alive
ETag: "5fbd044b-264"
Accept-Ranges: bytes
root@nucklehead:~ #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment