You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will install SPIRE into your cluster, along with two additional components: the SPIFFE CSI Driver and the SPIRE Kubernetes **Controller manager** which facilitate the registration of workloads and establishment of federation relationships.
70
70
71
-
Verify installation of SPIRE by checking if all pods are running and containers within them are up. Specifically, you are looking for agent and SPIRE server.
71
+
Verify installation of SPIRE by checking if all pods are running and containers within them are up. Specifically, you should look for the agent and SPIRE server.
72
72
73
-
**Note:**Number of agents depends on number of nodes you are working with. Here we are working with three worker nodes, so three agents are assigned for each node.
73
+
**Note:**The number of agents depends on number of nodes you are working with. Here, we are working with three worker nodes, so three agents are assigned for each node.
74
74
75
75
Use the command given below, and you will get the output as shown.
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
+
You can download the latest release using the official Istio repository or just copy the following command (which would do the same thing for you).
91
91
92
92
```shellsession
93
93
curl -L https://istio.io/downloadIstio | sh -
94
94
```
95
95
96
-
For details reach out to **[ISTIO download page](https://istio.io/latest/docs/setup/getting-started/#download)**.
96
+
For details, reach out to **[ISTIO download page](https://istio.io/latest/docs/setup/getting-started/#download)**.
97
97
98
-
cd into the Istio directory and set the path by command:
98
+
Get into the Istio directory and set the path by command:
99
99
100
100
```shellsession
101
101
export PATH=$PWD/bin:$PATH
102
102
```
103
103
104
-
After exporting get out of directory.
104
+
After exporting, get out of directory.
105
105
106
106
```shellsession
107
107
cd ..
108
108
```
109
109
110
-
**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.
110
+
**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 the Istio directory.
111
111
112
112
#### **Install Istio with patches:**
113
113
@@ -127,7 +127,7 @@ This will share the spiffe-csi-driver with the Ingress Gateway and the sidecars
127
127
128
128

129
129
130
-
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.
130
+
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.
131
131
132
132
Create a ClusterSPIFFEID CRD to generate registration entries in SPIRE server for all workloads with the label **`spiffe.io/spire-managed-identity: true`**.
133
133
@@ -137,33 +137,33 @@ This will share the spiffe-csi-driver with the Ingress Gateway and the sidecars
137
137
kubectl apply -f cluster-spiffeID-crd.yaml
138
138
```
139
139
140
-
**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.
140
+
**Note:** You can create your own custom clusterSPIFFEID CRD with your own match label and own selector. For now, we have created a simple CRD with one pod selector and one match label.
141
141
142
-
Now simply patch the ingress-gateway with spiffe.io/spire managed-identity: true label.
142
+
Now, simply patch the ingress-gateway with spiffe.io/spire managed-identity: true label.
143
143
144
144
This will register your ingress-gateway pod into the server.
After patching, confirm the working of your ingress-gateway pod, istiod, and all their containers.
150
+
After patching, confirm that your ingress-gateway pod, istiod, and all their containers work.
151
151
152
152
## Step 4: Deploying Sample Application
153
153
154
154
Now that our SPIRE and Istio are integrated, the identities to workloads must be issued by SPIRE.
155
155
156
-
For our case, we will create a namespace “bookinfo” and will add a label **“spiffe.io/spire-managed-identity: true”** to it, then we will create a new ClusterSPIFFEID CRD with **namespace selector** with match label as “spiffe.io/spire-managed-identity: true.”
156
+
For our case, we will create a namespace “bookinfo” and will add a label **“spiffe.io/spire-managed-identity: true”** to it. Then, we will create a new ClusterSPIFFEID CRD with **namespace selector** with match label as “spiffe.io/spire-managed-identity: true.”
157
157
158
-
Now when the new workload is added to this namespace or any other namespace which has the label mentioned above, then automatically it will get registered in the server.
158
+
When the new workload is added to this namespace or any other namespace that has the lable mentioned above, it will now automatically get registered in the server.
After all edits to your namespace, the namespace would look similar as shown below.
178
+
After all edits to your namespace, the namespace should look similar as shown below.
179
179
180
-
**Note:**You can edit further if you want using following command, but take care that your resulting yaml is not invalid. You can validate your yaml using any online validator available.
180
+
**Note:**If you want to, you can edit further using the following command. But take care that your resulting yaml is not invalid. You can validate your yaml using any online validator available.
181
181
182
182
```shellsession
183
183
kubectl edit ns <namespace_name>
@@ -207,7 +207,7 @@ status:
207
207
208
208
**4.4** Create and apply a ClusterSPIFFEID CRD with namespace selector.
209
209
210
-
Copy the clusterSPIFFEID from **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/spire/clusterspiffeid-example.yaml)** and just change the selector to **namespace selector** and make sure that the correct match label is there like shown below.
210
+
Copy the clusterSPIFFEID from **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/spire/clusterspiffeid-example.yaml)** and just change the selector to **namespace selector**. Make sure that the correct match label is there like shown below.
211
211
212
212
```yaml
213
213
apiVersion: spire.spiffe.io/v1alpha1
@@ -227,20 +227,20 @@ After editing your clusterSPIFFEID, apply it using kubectl.
227
227
kubectl apply -f <your_clusterSPIFFEID_name>
228
228
```
229
229
230
-
**4.5** After successfully creating namespace and applying CRD, deploy your application in the namespace you created. But before you deploy your application, the workloads will need the SPIFFE CSI Driver volume to access the SPIRE Agent socket. To accomplish this, we can leverage the SPIRE pod annotation template:
230
+
**4.5** After successfully creating namespace and applying CRD, deploy your application in the namespace you created. But before you deploy your application, the workloads will need to have the SPIFFE CSI Driver volume be able to access the SPIRE Agent socket. To accomplish this, we can leverage the SPIRE pod annotation template:
231
231
232
232
```yaml
233
233
annotations:
234
234
inject.istio.io/templates: "sidecar,spire"
235
235
```
236
236
237
-
You can patch it to workload or just add this to your deployment manifest at **{spec:{template:{metadata:{ annotation:}}}}** as shown below.
237
+
You can patch it to the workload or just add this to your deployment manifest at **{spec:{template:{metadata:{ annotation:}}}}** as shown below.
238
238
239
239

240
240
241
241
You can get the sample bookinfo application manifest from **[this link](https://raw.githubusercontent.com/cxteamtrials/caas-trials-content/main/services/istio/release-1.16/samples/bookinfo/bookinfo.yaml)**.
242
242
243
-
**Note:** This manifest is annotation free, so you need to add annotation to its deployments by following above shown steps.
243
+
**Note:** This manifest is annotation free, so you need to add annotation to its deployments by following the steps shown above.
244
244
245
245
After editing the manifest, apply it in a newly created namespace.
0 commit comments