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
Reconfigures demo so istio install is not expected to fail.
Created ClusterSPIFFEID before install istio. Previously install
would fail because the ingress gateway wasn't registered/
Signed-off-by: jaellio <[email protected]>
### Option 1: Configuration for Workload Registration with the SPIRE Controller Manager
72
72
73
-
1. After [deploying SPIRE](#install-spire) into your environment, and verifying that all deployments are in `Ready` state,
74
-
install Istio with custom patches for the Ingress-gateway as well as for istio-proxy.
73
+
By deploying [SPIRE Controller Manager](https://github.com/spiffe/spire-controller-manager)
74
+
along with a SPIRE Server, new entries can be automatically registered for each new pod that matches the selector defined in a [ClusterSPIFFEID](https://github.com/spiffe/spire-controller-manager/blob/main/docs/clusterspiffeid-crd.md) custom resource.
75
75
76
-
Create Istio configuration:
76
+
A ClusterSPIFFEID must be applied prior to installing Istio in order for the Ingress-gateway to obtain its certificates. Additionally,the Ingress-gateway pod must be configured to match the selector defined in the ClusterSPIFFEID. If a registration entry for the Ingress Gateway workload was not automatically created during install, the workload would not reach a `Ready` state and installation would fail.
77
+
78
+
1. Create example ClusterSPIFFEID:
79
+
80
+
{{< text syntax=bash snip_id=create_clusterspiffeid >}}
{{< text syntax=bash snip_id=define_istio_operator >}}
94
+
The example ClusterSPIFFEID enables automatic workload registration for all workloads with the `spiffe.io/spire-managed-identity: "true"` label. For pods with this label, the values specified in the `spiffeIDTemplate` will be extracted to form the SPIFFE ID.
1. Create the Istio configuration with custom patches for the Ingress-gateway and istio-proxy. The Ingress Gateway component includes the `spiffe.io/spire-managed-identity: "true"` label.
99
+
100
+
{{< text syntax=bash snip_id=define_istio_operator_for_auto_registration >}}
79
101
$ cat <<EOF > ./istio.yaml
80
102
apiVersion: install.istio.io/v1alpha1
81
103
kind: IstioOperator
@@ -109,6 +131,7 @@ Istio will become the Envoy SDS listener if the socket is not created by SPIRE b
109
131
enabled: true
110
132
label:
111
133
istio: ingressgateway
134
+
spiffe.io/spire-managed-identity: "true"
112
135
k8s:
113
136
overlays:
114
137
- apiVersion: apps/v1
@@ -150,63 +173,140 @@ Istio will become the Envoy SDS listener if the socket is not created by SPIRE b
150
173
EOF
151
174
{{< /text >}}
152
175
153
-
Apply the configuration:
176
+
1. Apply the configuration:
154
177
155
-
{{< text bash >}}
178
+
{{< text syntax=bash snip_id=apply_istio_operator_configuration >}}
This will share the `spiffe-csi-driver` with the Ingress Gateway and the sidecars that are going to be injected on workload pods,
160
-
granting them access to the SPIRE Agent's UNIX Domain Socket.
182
+
1. Check Ingress-gateway pod state:
161
183
162
-
This will also add an initContainer to the gateway that will wait for SPIRE to create the UNIX Domain Socket before starting the istio-proxy. If the SPIRE agent is not ready or has not been properly configured with the same socket path, the Ingress Gateway initContainer will wait forever.
The Ingress-gateway pod and data plane containers will only reach `Ready` if a corresponding registration entry is created for them on the SPIRE Server. Then,
174
-
Envoy will be able to fetch cryptographic identities from SPIRE.
175
-
See [Register workloads](#register-workloads) to register entries for services in your mesh.
191
+
The Ingress-gateway pod is `Ready` since the corresponding registration entry is automatically created for it on the SPIRE Server. Envoy is able to fetch cryptographic identities from SPIRE.
176
192
177
-
## Register workloads
193
+
Note that `SPIRE Controller Manager` is used in the [quick start](#option-1:-quick-start) section.
178
194
179
-
This section describes the options available for registering workloads in a SPIRE Server.
195
+
### Option 2: Configuration for Manual Workload Registration with SPIRE
180
196
181
-
### Option 1: Registration using the SPIRE Controller Manager
By deploying [SPIRE Controller Manager](https://github.com/spiffe/spire-controller-manager)
184
-
along with a SPIRE Server, new entries can be automatically registered for each new pod that matches the selector defined in a [ClusterSPIFFEID](https://github.com/spiffe/spire-controller-manager/blob/main/docs/clusterspiffeid-crd.md) custom resource.
199
+
1. After [deploying SPIRE](#install-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.
185
200
186
-
1. Create an example ClusterSPIFFEID:
201
+
Create Istio configuration:
187
202
188
-
{{< text syntax=bash snip_id=create_clusterspiffeid >}}
189
-
$ kubectl apply -f - <<EOF
190
-
apiVersion: spire.spiffe.io/v1alpha1
191
-
kind: ClusterSPIFFEID
203
+
{{< text syntax=bash snip_id=define_istio_operator_for_manual_registration >}}
echo "$(date -Iseconds)" File does not exist: ${CHECK_FILE}
272
+
sleep 15
273
+
done
274
+
ls -l ${CHECK_FILE}
199
275
EOF
200
276
{{< /text >}}
201
277
202
-
The example ClusterSPIFFEID enables automatic workload registration for all workloads with the `spiffe.io/spire-managed-identity: "true"` label. For pods with this label, the values specified in the `spiffeIDTemplate` will be extracted to form the SPIFFE ID.
The Ingress-gateway pod and data plane containers will only reach `Ready` if a corresponding registration entry is created for them on the SPIRE Server. Then,
294
+
Envoy will be able to fetch cryptographic identities from SPIRE.
295
+
See [Register workloads](#register-workloads) to register entries for services in your mesh.
296
+
297
+
The Istio configuration shares the `spiffe-csi-driver` with the Ingress Gateway and the sidecars that are going to be injected on workload pods,
298
+
granting them access to the SPIRE Agent's UNIX Domain Socket.
299
+
300
+
This configuration also adds an initContainer to the gateway that will wait for SPIRE to create the UNIX Domain Socket before starting the istio-proxy. If the SPIRE agent is not ready or has not been properly configured with the same socket path, the Ingress Gateway initContainer will wait forever.
301
+
302
+
## Register workloads
303
+
304
+
This section describes the options available for registering workloads in a SPIRE Server.
305
+
306
+
### Option 1: Registration using the SPIRE Controller Manager
307
+
308
+
New entries will be automatically registered for each new pod that matches the selector defined in a [ClusterSPIFFEID](https://github.com/spiffe/spire-controller-manager/blob/main/docs/clusterspiffeid-crd.md) custom resource. See [Configuration for Workload Registration with the SPIRE Controller Manager](#option-1:-configuration-for-workload-registration-with-the-spire-controller-manager) for the example ClusterSPIFFEID configuration.
0 commit comments