Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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