Skip to content

Commit 083f99f

Browse files
committed
Merge branch 'master' of github.com:ganrad/aks-aspnet-sqldb-rest
Pulling latest from the master branch.
2 parents 4c2823a + ad2478d commit 083f99f

File tree

3 files changed

+68
-11
lines changed

3 files changed

+68
-11
lines changed

Diff for: extensions/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The extensions below explore advanced features of AKS (Kubernetes) and additiona
77

88
- [Inject Azure Key Vault Secrets using AAD Pod Identity](./use-pod-identity)
99

10-
In this sub-project, secrets stored in Azure **Key Vault** are fetched and mounted on a volume inside the Claims Web API application container image. The project makes use of two open source projects - [AAD Pod Identity](https://github.com/Azure/aad-pod-identity) and [Azure Key Vault Kubernetes Flex Volume](https://github.com/Azure/kubernetes-keyvault-flexvol). Storing application secrets in Azure Key Vault provides a secure alternative to storing them in standard Kubernetes *Secret* API objects on the etcd server. The secrets stored in Key Vault never come to reside on the nodes and are directly mounted as a volume on a local directory within the container.
10+
In this sub-project, secrets stored in Azure **Key Vault** are fetched and injected inside the Claims Web API application container at runtime. The project makes use of two open source projects - [AAD Pod Identity](https://github.com/Azure/aad-pod-identity) and [Azure Key Vault Kubernetes Flex Volume](https://github.com/Azure/kubernetes-keyvault-flexvol). Storing application secrets in Azure Key Vault provides a secure alternative to storing them in standard Kubernetes *Secret* API objects on the etcd server. The secrets stored in Key Vault never come to reside on the nodes and are directly injected into the application container at runtime.
1111

1212
- [Explore advanced features of **Istio** Service Mesh](./istio-service-mesh)
1313

Diff for: extensions/istio-service-mesh/README.md

+64-7
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In this project, we will reuse the Claims Web API microservice and Azure Functio
3838
Refer to the architecture diagram [here](https://istio.io/docs/ops/deployment/architecture/)
3939

4040
**Prerequisites:**
41-
1. Readers are required to complete Sections A thru I in the [parent project](https://github.com/ganrad/aks-aspnet-sqldb-rest) before proceeding with the hands-on labs in this project.
41+
1. Readers are required to complete Sections **A** thru **I** in the [parent project](https://github.com/ganrad/aks-aspnet-sqldb-rest) before proceeding with the hands-on labs in this project.
4242

4343
Readers are advised to go thru the following on-line resources before proceeding with the hands-on sections.
4444
- [Istio Service Mesh](https://istio.io/docs/concepts/what-is-istio/)
@@ -105,8 +105,8 @@ Login (ssh) to the Linux VM (Bastion Host) via a terminal window. Follow the st
105105
#
106106
```
107107

108-
## B. Deploy the Claims API microservice on Istio
109-
**Approx. time to complete this section: 10 minutes**
108+
## B. Deploy the Claims API microservice on Istio Service Mesh
109+
**Approx. time to complete this section: 20 minutes**
110110

111111
Before proceeding, make sure you are logged into the Linux VM via a terminal window.
112112

@@ -115,18 +115,75 @@ Follow the steps below to deploy the Claims API microservice application in a ne
115115
1. Create an Istio enabled namespace.
116116

117117
```bash
118-
# Create the k8s namespace 'dev-exp-istio`.
119-
$ kubectl create namespace dev-exp-istio
118+
# Create the k8s namespace 'dev-claims-istio`.
119+
$ kubectl create namespace dev-claims-istio
120120
#
121121
# Label the namespace so that the sidecar container (Envoy proxy) is automatically injected
122122
# when a Pod is deployed in this namespace.
123-
$ kubectl label namespace dev-exp-istio istio-injection=enabled
123+
$ kubectl label namespace dev-claims-istio istio-injection=enabled
124+
#
125+
```
126+
127+
2. Update the **claims-api** Helm chart.
128+
129+
Edit the Helm chart values (`./extensions/istio-service-mesh/values.yaml`) file and specify correct values for the application configuration parameters. Refer to the table below.
130+
131+
Parameter Name | Value | Description
132+
-------------- | ----- | -----------
133+
image.repository | xyz.azurecr.io/claims-api | Specify the name of the ACR instance
134+
image.tag-v1 | 1..N | **Build ID number** of version **v1** of Claims API microservice
135+
image.tag-v2 | 1..N | **Build ID number** of version **v2** of Claims API microservice
136+
image.tag-v3 | 1..N | **Build ID number** of version **v3** of Claims API microservice
137+
sqldb.connectionString | NA | Specify the Azure SQL Database connection string value
138+
139+
3. Deploy the Claims API microservice application.
140+
141+
Use Helm to deploy the Claims API microservice in the **dev-claims-istio** namespace. Execute the CLI commands as shown in the snippet below.
142+
143+
```bash
144+
# Switch to the './extensions/istio-service-mesh' directory
145+
$ cd $HOME/git-repos/aks-aspnet-sqldb-rest/extensions/istio-service-mesh
146+
#
147+
# Use Helm to deploy the Claims API service and pod.
148+
$ helm install ./claims-api --name claims-api-istio --namespace dev-claims-istio
149+
```
150+
4. Confirm the service is defined and the Claims API pod is running.
151+
152+
```bash
153+
# List the service
154+
$ kubectl get svc -n dev-claims-istio
155+
#
156+
# Confirm the claims-api pod is up and running
157+
$ kubectl get pods -n dev-claims-istio
124158
#
125159
```
126160

127-
2. Deploy the Claims API microservice application.
161+
5. Define the ingress gateway for the Claims API microservice
162+
163+
To access the Claims API REST end-points from outside the AKS cluster, an **Ingress Gateway** resource has to be created on the cluster. Also, to route the request from the gateway to the service end-point, an **Virtual Service** resource has to be deployed.
128164

129165
```bash
166+
# Deploy the ingress gateway and the virtual service for the Claims API microservice
167+
$ kubectl apply -f ./k8s-resources/ingress-gateway.yaml -n dev-claims-istio
168+
#
169+
# Confirm the gateway resource got created
170+
$ kubectl get gateway -n dev-claims-istio
171+
#
172+
```
173+
174+
6. Access the Claims Web API from outside the cluster
175+
176+
```bash
177+
# Determine the Ingress Gateway ALB Public IP and port
178+
#
179+
$ INGRESS_HOST=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
180+
$ INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')
181+
$ GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
182+
#
183+
# Access the Claims Web API using curl or via a browser.
184+
# Curl usage below
185+
$ curl -s http://$GATEWAY_URL/api/v1/claims
186+
#
130187
```
131188

132189
## C. Explore Istio Service Mesh features

Diff for: extensions/istio-service-mesh/claims-api/values.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ app:
99

1010
image:
1111
repository: xyztest.azurecr.io/claims-api
12-
v1-tag: 276
13-
v2-tag: 277
14-
v3-tag: 278
12+
tag-v1: 276
13+
tag-v2: 277
14+
tag-v3: 278
1515
pullPolicy: Always
1616

1717
service:

0 commit comments

Comments
 (0)