Skip to content

Commit 50e9509

Browse files
Merge pull request aws-samples#295 from scottmalkie/master
Fix aws-samples#293, aws-samples#294, aws-samples#296; Change kubectl port-forward command port and add sentence regarding use of 'open'
2 parents 9ea7302 + 87958cb commit 50e9509

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

developer-concepts/readme.adoc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,12 @@ Get the list of pod:
4242
NAME READY STATUS RESTARTS AGE
4343
nginx-pod 1/1 Running 0 22s
4444

45-
Verify that the pod came up fine:
45+
Verify that the pod came up fine (ensure nothing else is running on port 8088):
4646

47-
kubectl -n default port-forward $(kubectl -n default get pod -l name=nginx-pod -o jsonpath='{.items[0].metadata.name}') 8080:80 & open http://localhost:8080/
47+
$ kubectl -n default port-forward $(kubectl -n default get pod -l name=nginx-pod -o jsonpath='{.items[0].metadata.name}') 8088:80
48+
$ open http://localhost:8088/
49+
50+
If you are running a Linux distribution that doesn't support `open`, try `xdg-open`, `gnome-open`, or `gvfs-open` instead.
4851

4952
This opens up a browser window and shows the NGINX main page:
5053

@@ -1244,17 +1247,17 @@ The main change is the addition of `namespace: dev`.
12441247
. Create the Deployment:
12451248

12461249
$ kubectl apply -f templates/deployment-namespace.yaml
1247-
deployment "nginx-deployment" created
1250+
deployment "nginx-deployment-ns" created
12481251

12491252
. Deployment in a Namespace can be queried by providing an additional switch `-n` as shown:
12501253

12511254
$ kubectl get deployments -n dev
12521255
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
1253-
nginx-deployment 3 3 3 3 1m
1256+
nginx-deployment-ns 3 3 3 3 1m
12541257

12551258
. Query the Namespace for this Deployment:
12561259

1257-
$ kubectl get deployments/nginx-deployment -n dev -o jsonpath={.metadata.namespace}
1260+
$ kubectl get deployments/nginx-deployment-ns -n dev -o jsonpath={.metadata.namespace}
12581261
dev
12591262

12601263
Alternatively, a namespace can be created using `kubectl` as well.
@@ -1267,21 +1270,21 @@ Alternatively, a namespace can be created using `kubectl` as well.
12671270
. Create a Deployment:
12681271

12691272
$ kubectl -n dev2 apply -f templates/deployment.yaml
1270-
deployment "nginx-deployment" created
1273+
deployment "nginx-deployment-ns" created
12711274

12721275
. Get Deployments in the newly created Namespace:
12731276

12741277
$ kubectl get deployments -n dev2
12751278
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
1276-
nginx-deployment 3 3 3 3 1m
1279+
nginx-deployment-ns 3 3 3 3 1m
12771280

12781281
. Get Deployments in all Namespaces:
12791282

12801283
$ kubectl get deployments --all-namespaces
12811284
NAMESPACE NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
12821285
default nginx-deployment 3 3 3 3 1h
1283-
dev nginx-deployment 3 3 3 3 1h
1284-
dev2 nginx-deployment 3 3 3 3 1m
1286+
dev nginx-deployment-ns 3 3 3 3 1h
1287+
dev2 nginx-deployment-ns 3 3 3 3 1m
12851288
kube-system dns-controller 1 1 1 1 5h
12861289
kube-system kube-dns 2 2 2 2 5h
12871290
kube-system kube-dns-autoscaler 1 1 1 1 5h

developer-concepts/templates/deployment-namespace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: extensions/v1beta1
22
kind: Deployment
33
metadata:
4-
name: nginx-deployment
4+
name: nginx-deployment-ns
55
namespace: dev
66
spec:
77
replicas: 3

developer-concepts/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: extensions/v1beta1
22
kind: Deployment
33
metadata:
4-
name: nginx-deployment
4+
name: nginx-deployment-ns
55
spec:
66
replicas: 3
77
template:

images/nginx-pod-default-page.png

8.48 KB
Loading

0 commit comments

Comments
 (0)