Skip to content

Commit 5d239dc

Browse files
committed
Added labs
1 parent d7d6ad0 commit 5d239dc

114 files changed

Lines changed: 6370 additions & 5303 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mkdocs-1.swp

12 KB
Binary file not shown.

Labs/00-VerifyCluster/a.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: codewizard
5+
---
6+
apiVersion: apps/v1
7+
kind: Deployment
8+
metadata:
9+
name: secrets-app
10+
namespace: codewizard
11+
spec:
12+
replicas: 1
13+
selector:
14+
matchLabels:
15+
name: secrets-app
16+
template:
17+
metadata:
18+
labels:
19+
name: secrets-app
20+
spec:
21+
containers:
22+
- name: secrets-app
23+
image: nirgeier/k8s-secrets-sample
24+
imagePullPolicy: Always
25+
ports:
26+
- containerPort: 5000
27+
env:
28+
- name: LANGUAGE
29+
value: Hebrew
30+
- name: TOKEN
31+
value: Hard-To-Guess2
32+
resources:
33+
limits:
34+
cpu: "500m"
35+
memory: "256Mi"
36+
---
37+
apiVersion: v1
38+
kind: Service
39+
metadata:
40+
name: codewizard-secrets
41+
namespace: codewizard
42+
spec:
43+
selector:
44+
app: codewizard-secrets
45+
ports:
46+
- protocol: TCP
47+
port: 5000
48+
targetPort: 5000
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
# Colors for output
4+
RED='\033[0;31m'
5+
GREEN='\033[0;32m'
6+
YELLOW='\033[1;33m'
7+
BLUE='\033[0;34m'
8+
NC='\033[0m' # No Color
9+
10+
echo -e "${BLUE}Starting Kubernetes Cluster Verification Lab Script${NC}"
11+
echo -e "${BLUE}====================================================${NC}"
12+
13+
# Step 1: Installing Kind
14+
echo -e "${YELLOW}Step 1: Installing Kind${NC}"
15+
echo -e "${GREEN}Installing Kind using Homebrew...${NC}"
16+
brew install kind
17+
echo -e "${GREEN}Verifying Kind installation...${NC}"
18+
kind version
19+
echo -e "${GREEN}Kind installation completed.${NC}"
20+
echo ""
21+
22+
# Step 2: Create Kind cluster
23+
echo -e "${YELLOW}Step 2: Creating Kind cluster${NC}"
24+
echo -e "${GREEN}Running: kind create cluster${NC}"
25+
kind create cluster
26+
echo -e "${GREEN}Kind cluster creation completed.${NC}"
27+
echo ""
28+
29+
# Step 3: Check the Kind cluster status
30+
echo -e "${YELLOW}Step 3: Checking Kind cluster status${NC}"
31+
echo -e "${GREEN}Running: kubectl cluster-info${NC}"
32+
kubectl cluster-info
33+
echo -e "${GREEN}Cluster status check completed.${NC}"
34+
echo ""
35+
36+
# Step 4: Verify that the cluster is up and running (kubectl cluster-info again)
37+
echo -e "${YELLOW}Step 4: Verifying cluster is up and running${NC}"
38+
echo -e "${GREEN}Running: kubectl cluster-info${NC}"
39+
kubectl cluster-info
40+
echo -e "${GREEN}Cluster verification completed.${NC}"
41+
echo ""
42+
43+
# Step 5: Verify kubectl configuration
44+
echo -e "${YELLOW}Step 5: Verifying kubectl configuration${NC}"
45+
echo -e "${GREEN}Running: kubectl config view${NC}"
46+
kubectl config view
47+
echo -e "${GREEN}Kubectl configuration verified.${NC}"
48+
echo ""
49+
50+
# Step 6: Verify that you can "talk" to your cluster
51+
echo -e "${YELLOW}Step 6: Checking nodes in the cluster${NC}"
52+
echo -e "${GREEN}Running: kubectl get nodes${NC}"
53+
kubectl get nodes
54+
echo -e "${GREEN}Node check completed.${NC}"
55+
echo ""
56+
57+
echo -e "${BLUE}All steps completed successfully!${NC}"

Labs/06-DataStore/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const
4747

4848
require("http")
4949
.createServer((request, response) => {
50-
response.write(`Language: ${language}`);
50+
response.write(`Language: ${language}\n`);
5151
response.write(`Token : ${token}\n`);
5252
response.end(`\n`);
5353
})
@@ -139,7 +139,7 @@ Successfully tagged nirgeier/k8s-secrets-sample:latest
139139
# replace the name if you used your own name
140140
# and check the response from the server.
141141
# It should print out the variables which were defined inside the DockerFile
142-
$ docker run -d -p5000:5000 nirgeier/k8s-secrets-sample --name server
142+
$ docker run -d -p5000:5000 --name server nirgeier/k8s-secrets-sample
143143

144144
# Get the response from the container
145145
# The port is the one which we exposed inside the DockerFile
@@ -373,7 +373,7 @@ service/codewizard-secrets unchanged
373373
- To update existing secrets or ConfigMap:
374374

375375
```
376-
$ kubectl create secret generic token -n codewizard --from-literal=Token=Token3 -o yaml --dry-run=client | kubectl replace -f -
376+
$ kubectl create secret generic token -n codewizard --from-literal=TOKEN=Token3 -o yaml --dry-run=client | kubectl replace -f -
377377
secret/token replaced
378378
```
379379

Labs/10-Istio/01-demo-services/.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

Labs/10-Istio/01-demo-services/.env

Lines changed: 0 additions & 11 deletions
This file was deleted.

Labs/10-Istio/01-demo-services/K8S/AuthorizationPolicy.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

Labs/10-Istio/01-demo-services/K8S/kiali-service.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Labs/10-Istio/01-demo-services/K8S/kustomization.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

Labs/10-Istio/01-demo-services/K8S/proxy-deployment.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)