Skip to content

Commit 0017f09

Browse files
committed
Add service for spire sever-workload and ghostunnel arg descrption
1 parent 183f235 commit 0017f09

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

docs/en/security/workload_security/spire.mdx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Register the client and server workloads with SPIRE:
128128
1. Register the client workload:
129129

130130
```bash
131-
kubectl exec -n spire spire-server-0 -- \
131+
kubectl exec -n spire-server spire-server-0 -- \
132132
/opt/spire/bin/spire-server entry create \
133133
-spiffeID spiffe://example.org/ns/example/sa/client-sa \
134134
-parentID spiffe://example.org/ns/spire/sa/spire-agent \
@@ -138,7 +138,7 @@ Register the client and server workloads with SPIRE:
138138
2. Register the server workload:
139139

140140
```bash
141-
kubectl exec -n spire spire-server-0 -- \
141+
kubectl exec -n spire-server spire-server-0 -- \
142142
/opt/spire/bin/spire-server entry create \
143143
-spiffeID spiffe://example.org/ns/example/sa/server-sa \
144144
-parentID spiffe://example.org/ns/spire/sa/spire-agent \
@@ -162,6 +162,23 @@ metadata:
162162
name: server-sa
163163
namespace: example
164164
---
165+
apiVersion: v1
166+
kind: Service
167+
metadata:
168+
name: server-workload
169+
spec:
170+
internalTrafficPolicy: Cluster
171+
ports:
172+
- appProtocol: tcp
173+
name: web
174+
port: 8443
175+
protocol: TCP
176+
targetPort: 8443
177+
selector:
178+
app: server-workload
179+
sessionAffinity: None
180+
type: ClusterIP
181+
---
165182
apiVersion: apps/v1
166183
kind: Deployment
167184
metadata:
@@ -216,6 +233,8 @@ spec:
216233
name: spiffe-socket
217234
```
218235

236+
* The `--allow-uri` flag in the `ghostunnel` configuration specifies the SPIFFE ID of the client workload that is allowed to connect to the server. In this example, only the client workload with the SPIFFE ID `spiffe://example.org/ns/example/sa/client-sa` is allowed to connect to the server.
237+
219238
Apply with: `kubectl apply -f server-workload.yaml`
220239

221240
#### Deploy Client Workload
@@ -271,6 +290,8 @@ spec:
271290
name: spiffe-socket
272291
```
273292

293+
* The `--verify-uri` flag in the `ghostunnel` configuration specifies the SPIFFE ID of the server workload that the client workload is allowed to connect to. In this example, only the server workload with the SPIFFE ID `spiffe://example.org/ns/example/sa/server-sa` is allowed to connect to the client workload.
294+
274295
Apply with: `kubectl apply -f client-workload.yaml`
275296

276297
### Verification

0 commit comments

Comments
 (0)