Skip to content

Commit b668f74

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

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

docs/en/security/workload_security/spire.mdx

Lines changed: 24 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,24 @@ metadata:
162162
name: server-sa
163163
namespace: example
164164
---
165+
apiVersion: v1
166+
kind: Service
167+
metadata:
168+
name: server-workload
169+
namespace: example
170+
spec:
171+
internalTrafficPolicy: Cluster
172+
ports:
173+
- appProtocol: tcp
174+
name: web
175+
port: 8443
176+
protocol: TCP
177+
targetPort: 8443
178+
selector:
179+
app: server-workload
180+
sessionAffinity: None
181+
type: ClusterIP
182+
---
165183
apiVersion: apps/v1
166184
kind: Deployment
167185
metadata:
@@ -216,6 +234,8 @@ spec:
216234
name: spiffe-socket
217235
```
218236

237+
* 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.
238+
219239
Apply with: `kubectl apply -f server-workload.yaml`
220240

221241
#### Deploy Client Workload
@@ -271,6 +291,8 @@ spec:
271291
name: spiffe-socket
272292
```
273293

294+
* 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.
295+
274296
Apply with: `kubectl apply -f client-workload.yaml`
275297

276298
### Verification

0 commit comments

Comments
 (0)