Skip to content

Commit abb108e

Browse files
author
José Corral
committed
Enabling istio on local kubernetes and first pod configuration, needs more work, unstable
1 parent f9388c5 commit abb108e

5 files changed

Lines changed: 139 additions & 0 deletions

File tree

k8s/istio/JourneyToIstio.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# ISTIO on Local
2+
## Prerequisites on local
3+
You need the eshopsOnContainers configured on your local, with this
4+
in a powershell console, we need to enter in /k8s/istio and execute
5+
```
6+
>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
33+
```
34+
35+
```ps1
36+
> ./install-istio-local.ps1
37+
38+
```
39+
This will install the cli utility and register to the path, you can test this phase launching
40+
41+
```ps1
42+
> istioctl
43+
```
44+
45+
Afterthat you can install Istio on your cluster executing
46+
```ps1
47+
> ./deploy-istio-helm.ps1
48+
```
49+
50+
the result should be like:
51+
```
52+
NAME READY STATUS RESTARTS AGE
53+
grafana-774bf8cb47-clqkp 1/1 Running 0 2h
54+
istio-citadel-548f4cdd9-dbrbn 1/1 Running 0 2h
55+
istio-egressgateway-5f77f6c979-8922g 1/1 Running 0 2h
56+
istio-galley-8f6585898-7c7wq 1/1 Running 0 2h
57+
istio-ingressgateway-8484579cdb-7tw8n 1/1 Running 0 2h
58+
istio-pilot-7c5c5778fb-r987v 2/2 Running 0 2h
59+
istio-policy-7d67d47c65-rdqwj 2/2 Running 15 2h
60+
istio-sidecar-injector-6fb6845cdd-nnhks 1/1 Running 0 2h
61+
istio-telemetry-8b9fc7769-pwx5m 2/2 Running 24 2h
62+
istio-tracing-ff94688bb-xnhnd 1/1 Running 4 2h
63+
kiali-8644dbcdbc-pb627 0/1 CrashLoopBackOff 7 2h
64+
prometheus-f556886b8-mr6wb 1/1 Running 13 2h
65+
```
66+
67+
Is a common error that kiali-pod have errors, because it needs a credentials for working.
68+
enter in k8s/istio/kiali and execute:
69+
```
70+
> ./set-kiali-credentials.ps1
71+
```
72+
this script will prompt for a valid account/password and setups the secret in kubernetes
73+
(at the moment account/password will be admin/admin we need to modify the yml)

k8s/istio/deploy-istio-helm.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$ISTIO_VERSION="1.0.6"
2+
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

k8s/istio/install-istio-local.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Specify the Istio version that will be leveraged throughout these instructions
2+
$ISTIO_VERSION="1.0.6"
3+
4+
# Windows
5+
6+
$ProgressPreference = 'SilentlyContinue';
7+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
8+
Invoke-WebRequest -URI "https://github.com/istio/istio/releases/download/$ISTIO_VERSION/istio-$ISTIO_VERSION-win.zip" -OutFile "istio-$ISTIO_VERSION.zip"
9+
Expand-Archive -Path "istio-$ISTIO_VERSION.zip" -DestinationPath .
10+
11+
cd istio-$ISTIO_VERSION
12+
New-Item -ItemType Directory -Force -Path "C:\Program Files\Istio"
13+
mv ./bin/istioctl.exe "C:\Program Files/Istio/"
14+
$PATH = [environment]::GetEnvironmentVariable("PATH", "User")
15+
[environment]::SetEnvironmentVariable("PATH", $PATH + "; C:\Program Files\Istio", "User")
16+

k8s/istio/kiali/secrets.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: kiali
5+
namespace: istio-system
6+
labels:
7+
app: kiali
8+
type: Opaque
9+
data:
10+
username: YQBkAG0AaQBuAA==
11+
passphrase: YQBkAG0AaQBuAA==
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Param([parameter(Mandatory,HelpMessage="Enter a valid username for Kiali Administration")][string]$username,
2+
[parameter(Mandatory,HelpMessage="Enter your super secret password")][securestring]$password,
3+
[parameter(Mandatory=$false)][string]$NAMESPACE="istio-system"
4+
)
5+
6+
function Get-PlainText()
7+
{
8+
[CmdletBinding()]
9+
param
10+
(
11+
[parameter(Mandatory = $true)]
12+
[securestring]$SecureString
13+
)
14+
BEGIN { }
15+
PROCESS
16+
{
17+
$bstr = [Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString);
18+
19+
try
20+
{
21+
return [Runtime.InteropServices.Marshal]::PtrToStringBSTR($bstr);
22+
}
23+
finally
24+
{
25+
[Runtime.InteropServices.Marshal]::FreeBSTR($bstr);
26+
}
27+
}
28+
END { }
29+
}
30+
31+
$KIALIUSERNAME = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($username))
32+
$plainpassword = Get-PlainText $password;
33+
$KIALIPASSWORD = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($plainpassword))
34+
35+
Write-Host "setting username [$KIALIUSERNAME] and password [$KIALIPASSWORD]" -ForegroundColor Blue
36+
kubectl apply -f secrets.yml

0 commit comments

Comments
 (0)