Skip to content

Commit bca0a5b

Browse files
committed
Update Blog “integrating-istio-and-spire”
1 parent e60dede commit bca0a5b

File tree

1 file changed

+33
-39
lines changed

1 file changed

+33
-39
lines changed

content/blog/integrating-istio-and-spire.md

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ spire-server-574474c7dc-42kln 2/2 Running 4 (4d1h ago) 31d
8585

8686
### Step 3: Install Istio
8787

88-
1. #### Download the latest release:
88+
#### Download the latest release:
8989

90-
\
91-
You can download the latest release using the official Istio repository or just copy the following command, which would do the same for you.
90+
\
91+
You can download the latest release using the official Istio repository or just copy the following command, which would do the same for you.
9292

93-
```shellsession
94-
curl -L https://istio.io/downloadIstio | sh -
95-
```
93+
```shellsession
94+
curl -L https://istio.io/downloadIstio | sh -
95+
```
9696

9797
For details reach out to **[ISTIO download page](https://istio.io/latest/docs/setup/getting-started/#download)**.
9898

@@ -110,56 +110,50 @@ cd ..
110110

111111
**Note:** In the future, a case might occur when your cluster does not recognize istioctl. In this case, export the path again after getting into istio directory.
112112

113-
2. #### Install Istio with patches:
113+
#### **Install Istio with patches:**
114114

115-
After deploying SPIRE into your environment and verifying that all deployments are in Ready state, install Istio with custom patches for the Ingress-gateway as well as for Istio-proxy.
115+
After deploying SPIRE into your environment and verifying that all deployments are in Ready state, install Istio with custom patches for the Ingress-gateway as well as for Istio-proxy.
116116

117-
Get the istio-spire-config patch using **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/istio/release-1.17/spire/spire-patch.yaml)** and copy that patch into your cluster. Install that patch using following command.
117+
Get the istio-spire-config patch using **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/istio/release-1.17/spire/spire-patch.yaml)** and copy that patch into your cluster. Install that patch using following command.
118118

119-
```shellsession
120-
istioctl install -f istio-spire-config.yaml
121-
```
119+
```shellsession
120+
istioctl install -f istio-spire-config.yaml
121+
```
122122

123-
This will share the spiffe-csi-driver with the Ingress Gateway and the sidecars that are going to be injected on workload pods, granting them access to the SPIRE Agent’s UNIX Domain Socket.
124-
3. #### Patching Istio-Ingress gateways
123+
This will share the spiffe-csi-driver with the Ingress Gateway and the sidecars that are going to be injected on workload pods, granting them access to the SPIRE Agent’s UNIX Domain Socket.
125124

126-
If you receive the error shown below, your ingress-gateway is not patched yet and is not being registered onto the server.
125+
* #### Patching Istio-Ingress gateways
127126

128-
![](/img/patch-error-ingress.jpg)
127+
If you receive the error shown below, your ingress-gateway is not patched yet and is not being registered onto the server.
129128

130-
**3.1** For patching, the first step is to get and apply one of SPIRE controller manager’s [CRD(Custom Resource Definition)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) ClusterSPIFFEID. It is a cluster-wide resource used to register workloads with SPIRE. The ClusterSPIFFEID can target all workloads in the cluster or can be optionally scoped to specific pods or namespaces via label selectors.
129+
![](/img/patch-error-ingress.jpg)
131130

132-
Create a ClusterSPIFFEID CRD to generate registration entries in SPIRE server for all workloads with the label **`spiffe.io/spire-managed-identity: true`**.
131+
For patching, the first step is to get and apply one of SPIRE controller manager’s [CRD(Custom Resource Definition)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) ClusterSPIFFEID. It is a cluster-wide resource used to register workloads with SPIRE. The ClusterSPIFFEID can target all workloads in the cluster or can be optionally scoped to specific pods or namespaces via label selectors.
133132

134-
\
135-
Get the ClusterSPIFFEID used by us for this demo using **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/spire/clusterspiffeid-example.yaml)**, copy that into your cluster, and apply it.
133+
Create a ClusterSPIFFEID CRD to generate registration entries in SPIRE server for all workloads with the label **`spiffe.io/spire-managed-identity: true`**.
136134

137-
```shellsession
138-
kubectl apply -f cluster-spiffeID-crd.yaml
139-
```
135+
\
136+
Get the ClusterSPIFFEID used by us for this demo using **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/spire/clusterspiffeid-example.yaml)**, copy that into your cluster, and apply it.
137+
138+
```shellsession
139+
kubectl apply -f cluster-spiffeID-crd.yaml
140+
```
140141

141-
**Note:** You can create your own custom clusterSPIFFEID CRD with your own match label and own selector. For now, we have created simple CRD with one pod selector and one match label.
142+
**Note:** You can create your own custom clusterSPIFFEID CRD with your own match label and own selector. For now, we have created simple CRD with one pod selector and one match label.
142143

143-
**3.2** Now simply patch the ingress-gateway with spiffe.io/spire managed-identity: true label.
144+
Now simply patch the ingress-gateway with spiffe.io/spire managed-identity: true label.
144145

145-
This will register your ingress-gateway pod into the server.
146+
This will register your ingress-gateway pod into the server.
146147

147-
```shellsession
148-
kubectl patch deployment istio-ingressgateway -n istio-system -p '{"spec":{"template":{"metadata":{"labels":{"spiffe.io/spire-managed-identity": "true"}}}}}'
149-
```
148+
```shellsession
149+
kubectl patch deployment istio-ingressgateway -n istio-system -p '{"spec":{"template":{"metadata":{"labels":{"spiffe.io/spire-managed-identity": "true"}}}}}'
150+
```
151+
152+
After patching, confirm the working of your ingress-gateway pod, istiod, and all their containers.
150153

151-
After patching, confirm the working of your ingress-gateway pod, istiod, and all their containers.
152154

153-
```shellsession
154-
k8s-spiffe-integ-master-7j7fh-m67q9:~ kubectl get pods -n istio-system
155-
NAME READY STATUS RESTARTS AGE
156-
istio-ingressgateway-6448bcfb6-d7gcw 1/1 Running 0 31d
157-
istiod-d5bc8669c-jhstc 1/1 Running 0 31d
158-
kiali-648847c8c4-h5nmh 1/1 Running 0 31d
159-
prometheus-7b8b9dd44c-s76kc 2/2 Running 0 31d
160-
```
161155

162-
#### Step 4: Deploying Sample Application
156+
## Step 4: Deploying Sample Application
163157

164158
Now that our SPIRE and Istio are integrated, the identities to workloads must be issued by SPIRE.
165159

0 commit comments

Comments
 (0)