Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

Update k8s manifest and Labs Document for steps #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion kubernetes/deployments/auth.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth
spec:
replicas: 1
selector:
matchLabels:
app: auth
track: stable
template:
metadata:
labels:
Expand Down
6 changes: 5 additions & 1 deletion kubernetes/deployments/frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
track: stable
template:
metadata:
labels:
Expand Down
7 changes: 6 additions & 1 deletion kubernetes/deployments/hello-canary.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-canary
spec:
replicas: 1
selector:
matchLabels:
app: hello
track: canary
version: 2.0.0
template:
metadata:
labels:
Expand Down
7 changes: 6 additions & 1 deletion kubernetes/deployments/hello-green.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-green
spec:
replicas: 3
selector:
matchLabels:
app: hello
track: stable
version: 2.0.0
template:
metadata:
labels:
Expand Down
7 changes: 6 additions & 1 deletion kubernetes/deployments/hello.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello
spec:
replicas: 3
selector:
matchLabels:
app: hello
track: stable
version: 1.0.0
template:
metadata:
labels:
Expand Down
8 changes: 4 additions & 4 deletions labs/creating-and-managing-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You will also define internal services for the `auth` and `hello` deployments an
### Create and Expose the Auth Deployment

```
kubectl create -f deployments/auth.yaml
kubectl apply -f deployments/auth.yaml --record
```

```
Expand All @@ -31,7 +31,7 @@ kubectl create -f services/auth.yaml
### Create and Expose the Hello Deployment

```
kubectl create -f deployments/hello.yaml
kubectl apply -f deployments/hello.yaml --record
```

```
Expand All @@ -50,7 +50,7 @@ kubectl create configmap nginx-frontend-conf --from-file=nginx/frontend.conf
```

```
kubectl create -f deployments/frontend.yaml
kubectl apply -f deployments/frontend.yaml --record
```

```
Expand Down Expand Up @@ -111,4 +111,4 @@ curl -k https://<EXTERNAL-IP>

## Summary

Deployments are the preferred way to manage application deployments. You learned how to create, expose and scale deployments.
Deployments are the preferred way to manage application deployments. You learned how to create, expose and scale deployments.
18 changes: 18 additions & 0 deletions labs/install-and-configure-kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@ sudo cp kubectl /usr/local/bin/kubectl

### Configure kubectl

Configure alias and autocomplete Bash:
```.bash
echo "alias k=kubectl" >> ~/.bashrc
echo "source <(kubectl completion bash)" >> ~/.bashrc
echo "complete -F __start_kubectl k" >> ~/.bashrc

source ~/.bashrc
```

Configure alias and autocomplete Zsh:
```.zsh
echo "alias k=kubectl" >> ~/.zshrc
echo "[[ $commands[kubectl] ]] && source <(kubectl completion zsh)" >> ~/.zshrc
echo "complete -F __start_kubectl k" >> ~/.zshrc

source ~/.zshrc
```

Download the client credentials and CA cert:

```
Expand Down