Skip to content

Commit c66a7d7

Browse files
committed
Updated helm chart readme
1 parent 953fd33 commit c66a7d7

File tree

9 files changed

+1030
-264
lines changed

9 files changed

+1030
-264
lines changed

Labs/09-StatefulSet/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,29 @@
6868

6969
---
7070
## Lab Highlights:
71-
- [01. Create namespace and clear previous data if there is any](#01-Create-namespace-and-clear-previous-data-if-there-is-any)
72-
- [02. Create and test the Stateful application](#02-Create-and-test-the-Stateful-application)
73-
- [03. Test the Stateful application](#03-Test-the-Stateful-application)
74-
- [04. Scale down the StatefulSet and check that its down](#04-Scale-down-the-StatefulSet-and-check-that-its-down)
75-
- [04.01. Scale down the `Statefulset` to 0](#0401-Scale-down-the-Statefulset-to-0)
76-
- [04.02. Verify that the pods Terminated](#0402-Verify-that-the-pods-Terminated)
77-
- [04.03. Verify that the DB is not reachable](#0403-Verify-that-the-DB-is-not-reachable)
78-
- [05. Scale up again and verify that we still have the prevoius data](#05-Scale-up-again-and-verify-that-we-still-have-the-prevoius-data)
79-
- [05.01. scale up the `Statefulset` to 1 or more](#0501-scale-up-the-Statefulset-to-1-or-more)
80-
- [05.02. Verify that the pods is in Running status](#0502-Verify-that-the-pods-is-in-Running-status)
81-
- [05.03. Verify that the pods is using the previous data](#0503-Verify-that-the-pods-is-using-the-previous-data)
71+
- [K8S Hands-on](#k8s-hands-on)
72+
- [StatefulSets](#statefulsets)
73+
- [The Difference Between a `Statefulset` And a `Deployment`](#the-difference-between-a-statefulset-and-a-deployment)
74+
- [`Stateless` application](#stateless-application)
75+
- [`Stateful` application](#stateful-application)
76+
- [`Stateful` Notes](#stateful-notes)
77+
- [Stable Network Identity](#stable-network-identity)
78+
- [Start and Termination Order](#start-and-termination-order)
79+
- [StatefulSet Volumes](#statefulset-volumes)
80+
- [To address all those requirements, Kubernetes offers the StatefulSet primitive.](#to-address-all-those-requirements-kubernetes-offers-the-statefulset-primitive)
81+
- [Pre-Requirements](#pre-requirements)
82+
- [Lab Highlights:](#lab-highlights)
83+
- [01. Create namespace and clear previous data if there is any](#01-create-namespace-and-clear-previous-data-if-there-is-any)
84+
- [02. Create and test the Stateful application](#02-create-and-test-the-stateful-application)
85+
- [03. Test the Stateful application](#03-test-the-stateful-application)
86+
- [04. Scale down the StatefulSet and check that its down](#04-scale-down-the-statefulset-and-check-that-its-down)
87+
- [04.01. Scale down the `Statefulset` to 0](#0401-scale-down-the-statefulset-to-0)
88+
- [04.02. Verify that the pods Terminated](#0402-verify-that-the-pods-terminated)
89+
- [04.03. Verify that the DB is not reachable](#0403-verify-that-the-db-is-not-reachable)
90+
- [05. Scale up again and verify that we still have the prevoius data](#05-scale-up-again-and-verify-that-we-still-have-the-prevoius-data)
91+
- [05.01. scale up the `Statefulset` to 1 or more](#0501-scale-up-the-statefulset-to-1-or-more)
92+
- [05.02. Verify that the pods is in Running status](#0502-verify-that-the-pods-is-in-running-status)
93+
- [05.03. Verify that the pods is using the previous data](#0503-verify-that-the-pods-is-using-the-previous-data)
8294

8395
---
8496

@@ -222,7 +234,7 @@ namespace/codewizard created
222234
223235
```sh
224236
# Generate and apply the required resources using kustomization
225-
kubectl kustomize PostgreSQL/ . | kubectl apply -f -
237+
kubectl kustomize PostgreSQL/ | kubectl apply -f -
226238
```
227239

228240
---

Labs/10-Istio/README.md

Lines changed: 291 additions & 152 deletions
Large diffs are not rendered by default.

Labs/10-Istio/install.sh

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/bash
2+
3+
# Step 1: Install Istio using istioctl
4+
echo "Installing Istio..."
5+
curl -L https://istio.io/downloadIstio | sh -
6+
cd istio-*
7+
export PATH=$PWD/bin:$PATH
8+
istioctl install --set profile=demo -y
9+
10+
# Step 2: Install Kiali using Helm
11+
echo "Installing Kiali..."
12+
helm repo add kiali https://kiali.org/helm-charts
13+
helm repo update
14+
helm install kiali-server kiali/kiali-server --namespace istio-system --set auth.strategy="anonymous"
15+
helm install \
16+
--namespace kiali-operator \
17+
--create-namespace \
18+
kiali-operator \
19+
kiali/kiali-operator
20+
21+
22+
# Step 3: Enable Istio sidecar injection for all namespaces
23+
echo "Enabling Istio sidecar injection for default namespace..."
24+
kubectl label namespace default istio-injection=enabled
25+
kubectl label namespace codewizard istio-injection=enabled
26+
kubectl label namespace monitoring istio-injection=enabled
27+
28+
29+
# Step 4: Deploy the Bookinfo demo application
30+
echo "Deploying Bookinfo sample app..."
31+
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
32+
33+
# Step 5: Expose the Bookinfo app through Istio gateway
34+
echo "Exposing Bookinfo app through Istio gateway..."
35+
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
36+
37+
# Step 6: Apply VirtualService to route traffic to v2 of ratings
38+
echo "Creating VirtualService for ratings..."
39+
cat <<EOF | kubectl apply -f -
40+
apiVersion: networking.istio.io/v1alpha3
41+
kind: VirtualService
42+
metadata:
43+
name: ratings-vs
44+
namespace: default
45+
spec:
46+
hosts:
47+
- ratings
48+
http:
49+
- route:
50+
- destination:
51+
host: ratings
52+
subset: v2
53+
EOF
54+
cat <<EOF | kubectl apply -f -
55+
apiVersion: kiali.io/v1alpha1
56+
kind: Kiali
57+
metadata:
58+
namespace: istio-system
59+
name: kiali
60+
spec:
61+
istio_namespace: istio-system
62+
auth:
63+
strategy: anonymous
64+
deployment:
65+
view_only_mode: true
66+
external_services:
67+
prometheus:
68+
url: http://prometheus-operated:9090
69+
EOF
70+
71+
sleep 10
72+
73+
# Step 7: Deploy addons
74+
echo "Deploying Istio addons..."
75+
kubectl apply -f samples/addons
76+
77+
78+
# Step 8: Port-forward Kiali for access
79+
echo "Port forwarding Kiali to http://localhost:20001..."
80+
kubectl port-forward -n istio-system svc/kiali 20001:20001 &
81+
82+
echo "Installation complete. Access Kiali at http://localhost:20001."
83+
84+
85+
cat << EOF | kubectl apply -f -
86+
apiVersion: security.istio.io/v1beta1
87+
kind: PeerAuthentication
88+
metadata:
89+
name: mtls-strict
90+
namespace: default
91+
spec:
92+
mtls:
93+
mode: STRICT
94+
EOF
95+
96+
cat << EOF | kubectl apply -f -
97+
apiVersion: networking.istio.io/v1alpha3
98+
kind: DestinationRule
99+
metadata:
100+
name: mtls-destination-rule
101+
namespace: default
102+
spec:
103+
host: "*.default.svc.cluster.local"
104+
trafficPolicy:
105+
tls:
106+
mode: ISTIO_MUTUAL
107+
EOF

0 commit comments

Comments
 (0)