Skip to content

Instantly share code, notes, and snippets.

@krotkiewicz
Last active October 10, 2017 17:40
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 krotkiewicz/e61b21e5aa84e7b8c1c326586caac4a7 to your computer and use it in GitHub Desktop.
Save krotkiewicz/e61b21e5aa84e7b8c1c326586caac4a7 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
run: nginx
spec:
type: NodePort
ports:
- name: http
port: 80
nodePort: 30073
selector:
run: nginx
root@node:~$ kube-proxy --master=http://localhost:8080 &> /tmp/proxy.log &
root@node:~$ kubectl create -f nginx-svc.yaml
service "nginx" created
root@node:~$ kubectl get svc
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes 10.0.0.1 <none> 443/TCP 2h
nginx 10.0.167.201 <nodes> 80:30073/TCP 7s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment