forked from wardviaene/kubernetes-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8e5bd6
commit 919dcb6
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# istio | ||
|
||
## download (1.0.1): | ||
``` | ||
cd ~ | ||
wget https://github.com/istio/istio/releases/download/1.0.1/istio-1.0.1-linux.tar.gz | ||
tar -xzvf istio-1.0.1-linux.tar.gz | ||
cd istio-1.0.1 | ||
echo 'export PATH="$PATH:/home/ubuntu/istio-1.0.1/bin"' >> ~/.profile | ||
``` | ||
|
||
## Download (latest): | ||
``` | ||
cd ~ | ||
curl -L https://git.io/getLatestIstio | sh - | ||
echo 'export PATH="$PATH:/home/ubuntu/istio-0.7.1/bin"' >> ~/.profile # change 0.7.1 in your version | ||
cd istio-1.0.1 # change 1.0.1 in your version | ||
``` | ||
|
||
## Kops configuration | ||
``` | ||
kops edit cluster kubernetes.newtech.academy | ||
``` | ||
Add: | ||
``` | ||
kubeAPIServer: | ||
admissionControl: | ||
- NamespaceLifecycle | ||
- LimitRanger | ||
- ServiceAccount | ||
- PersistentVolumeLabel | ||
- DefaultStorageClass | ||
- DefaultTolerationSeconds | ||
- MutatingAdmissionWebhook | ||
- ValidatingAdmissionWebhook | ||
- ResourceQuota | ||
- NodeRestriction | ||
- Priority | ||
``` | ||
|
||
## Istio install | ||
|
||
Apply CRDs: | ||
|
||
``` | ||
kubectl apply -f install/kubernetes/helm/istio/templates/crds.yaml | ||
``` | ||
|
||
Wait a few seconds. | ||
|
||
|
||
Option 1: with no mutual TLS authentication | ||
``` | ||
kubectl apply -f install/kubernetes/istio.yaml | ||
``` | ||
|
||
Option 2: or with mutual TLS authentication | ||
``` | ||
kubectl apply -f install/kubernetes/istio-auth.yaml | ||
``` | ||
|
||
## Example app | ||
|
||
Example app (from istio) | ||
``` | ||
export PATH="$PATH:/home/ubuntu/istio-1.0.1/bin" | ||
kubectl apply -f <(istioctl kube-inject -f samples/bookinfo/platform/kube/bookinfo.yaml) | ||
``` | ||
|
||
|
||
### Traffic management | ||
|
||
Add default route to v1: | ||
``` | ||
istioctl create -f samples/bookinfo/routing/route-rule-all-v1.yaml | ||
``` | ||
|
||
Route traffic to v2 if rule matches | ||
``` | ||
istioctl replace -f samples/bookinfo/routing/route-rule-reviews-test-v2.yaml | ||
``` | ||
|
||
Route 50% of traffic between v1 and v3: | ||
``` | ||
istioctl replace -f samples/bookinfo/routing/route-rule-reviews-50-v3.yaml | ||
``` | ||
|
||
## Distributed tracing | ||
|
||
Enable zipkin: | ||
``` | ||
kubectl apply -f install/kubernetes/addons/zipkin.yaml | ||
``` | ||
|
||
Enable Jaeger: | ||
``` | ||
kubectl delete -f install/kubernetes/addons/zipkin.yaml # if zipkin was installed, delete it first | ||
kubectl apply -n istio-system -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml | ||
``` | ||
|