From 48e7211b51d7e4e5240e9aed1b5d1b156bddca21 Mon Sep 17 00:00:00 2001 From: Ayanendu De Date: Sat, 11 Jan 2020 09:24:15 -0500 Subject: [PATCH] Update services-and-networking.md In question 1, expose was missing. --- services-and-networking.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/services-and-networking.md b/services-and-networking.md index 8c15d0e..5c3703a 100644 --- a/services-and-networking.md +++ b/services-and-networking.md @@ -12,15 +12,31 @@

``` -kubectl run nginx --image=nginx --restart=Never --port=80 --dry-run -o yaml > nginx.yaml +kubectl run nginx --image=nginx --restart=Never --port=80 --expose --dry-run -o yaml > nginx.yaml // edit the label app: my-nginx and create the pod apiVersion: v1 +kind: Service +metadata: + creationTimestamp: null + name: nginx +spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + run: nginx +status: + loadBalancer: {} +--- +--- +apiVersion: v1 kind: Pod metadata: creationTimestamp: null labels: - app: my-nginx + run: nginx name: nginx spec: containers: