Skip to content

Commit 3e7f930

Browse files
author
jmanuelcorral
committed
Added support to istio with nginx-ingress
1 parent 6926bbe commit 3e7f930

15 files changed

Lines changed: 614 additions & 31 deletions

k8s/istio/JourneyToIstio.md

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@ You need the eshopsOnContainers configured on your local, with this
44
in a powershell console, we need to enter in /k8s/istio and execute
55
```
66
>kubectl get pods
7-
NAME READY STATUS RESTARTS AGE
8-
eshop-apigwmm-54ccc6c589-557fn 0/1 Running 26 3h
9-
eshop-apigwms-7d5f86cf7c-2j2zp 0/1 CrashLoopBackOff 30 3h
10-
eshop-apigwwm-7794b6d879-7j4mt 0/1 CrashLoopBackOff 39 3h
11-
eshop-apigwws-8585f6899f-7kkg2 0/1 Running 11 3h
12-
eshop-basket-api-8bfc5c5f6-8xxcv 0/1 Running 41 3h
13-
eshop-basket-data-66fbc788cc-dmkgb 1/1 Running 0 3h
14-
eshop-catalog-api-c77747b76-4gp6c 0/1 CrashLoopBackOff 40 3h
15-
eshop-identity-api-7574f6b458-4rbp6 0/1 CrashLoopBackOff 44 3h
16-
eshop-keystore-data-5c9c85cb99-s5qz7 1/1 Running 0 3h
17-
eshop-locations-api-64847646d-5wv52 0/1 CrashLoopBackOff 36 3h
18-
eshop-marketing-api-745f9546b8-krjqq 0/1 Running 33 3h
19-
eshop-mobileshoppingagg-7d467f86bd-bw9c7 0/1 Running 22 3h
20-
eshop-nosql-data-579c9d89f8-x4z2k 1/1 Running 0 3h
21-
eshop-ordering-api-5c55bd5464-7hnjx 0/1 CrashLoopBackOff 38 3h
22-
eshop-ordering-backgroundtasks-f6dcb7db4-xq7gr 1/1 Running 22 3h
23-
eshop-ordering-signalrhub-6664868779-dphxm 1/1 Running 0 3h
24-
eshop-payment-api-7988db5f76-z76tc 1/1 Running 17 3h
25-
eshop-rabbitmq-6b68647bc4-qjjrb 1/1 Running 0 3h
26-
eshop-sql-data-5c4fdcccf4-2z5dm 1/1 Running 0 3h
27-
eshop-webhooks-api-588b58bb66-lmx5c 1/1 Running 0 3h
28-
eshop-webhooks-web-565c68b59c-dk8hp 1/1 Running 0 3h
29-
eshop-webmvc-55c596544b-9fqsj 1/1 Running 0 3h
30-
eshop-webshoppingagg-f8547f45b-4mjvp 0/1 CrashLoopBackOff 16 3h
31-
eshop-webspa-84fd54466d-hzrlb 1/1 Running 0 3h
32-
eshop-webstatus-775b487d4d-tbfbn 1/1 Running 0 3h
7+
NAME READY STATUS RESTARTS AGE
8+
eshop-apigwmm-54ccc6c589-557fn 0/1 Running 31 4h
9+
eshop-apigwms-7d5f86cf7c-2j2zp 0/1 Running 32 4h
10+
eshop-apigwwm-7794b6d879-7j4mt 0/1 Running 44 4h
11+
eshop-apigwws-8585f6899f-7kkg2 0/1 Running 13 4h
12+
eshop-basket-api-8bfc5c5f6-8xxcv 1/1 Running 47 4h
13+
eshop-basket-data-66fbc788cc-dmkgb 1/1 Running 1 4h
14+
eshop-catalog-api-c77747b76-4gp6c 0/1 Running 48 4h
15+
eshop-identity-api-7574f6b458-4rbp6 0/1 Running 55 4h
16+
eshop-keystore-data-5c9c85cb99-s5qz7 1/1 Running 1 4h
17+
eshop-locations-api-64847646d-5wv52 1/1 Running 42 4h
18+
eshop-marketing-api-745f9546b8-krjqq 1/1 Running 40 4h
19+
eshop-mobileshoppingagg-7d467f86bd-bw9c7 0/1 Running 24 4h
20+
eshop-nosql-data-579c9d89f8-x4z2k 1/1 Running 1 4h
21+
eshop-ordering-api-5c55bd5464-7hnjx 0/1 Running 46 4h
22+
eshop-ordering-backgroundtasks-f6dcb7db4-xq7gr 0/1 Running 24 4h
23+
eshop-ordering-signalrhub-6664868779-dphxm 1/1 Running 1 4h
24+
eshop-payment-api-7988db5f76-z76tc 0/1 Running 19 4h
25+
eshop-rabbitmq-6b68647bc4-qjjrb 1/1 Running 1 4h
26+
eshop-sql-data-5c4fdcccf4-2z5dm 1/1 Running 1 4h
27+
eshop-webhooks-api-588b58bb66-lmx5c 1/1 Running 2 4h
28+
eshop-webhooks-web-565c68b59c-dk8hp 1/1 Running 1 4h
29+
eshop-webmvc-55c596544b-9fqsj 1/1 Running 2 4h
30+
eshop-webshoppingagg-f8547f45b-4mjvp 0/1 Running 21 4h
31+
eshop-webspa-84fd54466d-hzrlb 1/1 Running 2 4h
32+
eshop-webstatus-775b487d4d-tbfbn 1/1 Running 1 4h
3333
```
3434

3535
```ps1
@@ -71,3 +71,15 @@ enter in k8s/istio/kiali and execute:
7171
```
7272
this script will prompt for a valid account/password and setups the secret in kubernetes
7373
(at the moment account/password will be admin/admin we need to modify the yml)
74+
75+
After enter in /k8s/istio/nginx-ingress that execute, we need to apply the istio integration with nginx-ingress for service-upstream.
76+
77+
```
78+
> ./update-nginx-ingress.ps1
79+
```
80+
81+
And After that, we only need to activate the sidecar injection in the default namespace for the eshops deployments, for doing that you must go the folder /k8s/istio
82+
and run:
83+
```
84+
> ./apply-injection.ps1
85+
````

k8s/istio/apply-injection.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kubectl label namespace default istio-injection=enabled
2+
kubectl get namespace -L istio-injection

k8s/istio/delete-istio.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
helm delete --purge istio
2+
kubectl delete -f install/kubernetes/helm/istio/templates/crds.yaml -n istio-system

k8s/istio/deploy-istio-helm.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
$ISTIO_VERSION="1.0.6"
22
cd istio-$ISTIO_VERSION
3-
helm install install/kubernetes/helm/istio --name istio --namespace istio-system --set global.controlPlaneSecurityEnabled=true --set grafana.enabled=true --set tracing.enabled=true --set kiali.enabled=true
3+
helm install install/kubernetes/helm/istio --wait --name istio --namespace istio-system --set global.controlPlaneSecurityEnabled=true --set grafana.enabled=true --set tracing.enabled=true --set kiali.enabled=true --set ingress.enabled=false --set gateways.istio-ingressgateway.enabled=false
4+
cd ..

k8s/istio/kiali/secrets.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ metadata:
77
app: kiali
88
type: Opaque
99
data:
10-
username: YQBkAG0AaQBuAA==
11-
passphrase: YQBkAG0AaQBuAA==
10+
username: YWRtaW4=
11+
passphrase: MWYyZDFlMmU2N2Rm

k8s/istio/kiali/set-kiali-credentials.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ $KIALIUSERNAME = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($us
3232
$plainpassword = Get-PlainText $password;
3333
$KIALIPASSWORD = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($plainpassword))
3434

35-
Write-Host "setting username [$KIALIUSERNAME] and password [$KIALIPASSWORD]" -ForegroundColor Blue
36-
kubectl apply -f secrets.yml
35+
Write-Host "Creating Kiali Secret in namespace [$NAMESPACE]" -ForegroundColor Blue
36+
kubectl -n $NAMESPACE create secret generic kiali --from-literal=username=$KIALIUSERNAME --from-literal=passphrase=$KIALIPASSWORD
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
name: ingress-nginx
5+
namespace: ingress-nginx
6+
labels:
7+
app.kubernetes.io/name: ingress-nginx
8+
app.kubernetes.io/part-of: ingress-nginx
9+
spec:
10+
externalTrafficPolicy: Local
11+
type: LoadBalancer
12+
selector:
13+
app.kubernetes.io/name: ingress-nginx
14+
app.kubernetes.io/part-of: ingress-nginx
15+
ports:
16+
- name: http
17+
port: 80
18+
targetPort: http
19+
- name: https
20+
port: 443
21+
targetPort: https

k8s/istio/nginx-ingress/cm.yaml

526 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data:
2+
mvc_e: http://10.0.75.1/webmvc
3+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data:
2+
urls__IdentityUrl: http://10.0.75.1/identity
3+
urls__mvc: http://10.0.75.1/webmvc

0 commit comments

Comments
 (0)