Skip to content

Commit 743029f

Browse files
committed
update docs and drop the sharedRootSocket
1 parent 72eb1f8 commit 743029f

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

docker-compose/nested-spire/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,34 @@ Before proceeding, review the following system requirements:
3434

3535
This tutorial's `nested-spire` main directory contains three subdirectories, one for each of the SPIRE deployments: `root`, `nestedA` and `nestedB`. These directories hold the configuration files for the SPIRE Servers and Agents. They will also contain the private keys and certificates created to attest the Agents on the Servers with the [x509pop Node Attestor](https://github.com/spiffe/spire/blob/main/doc/plugin_server_nodeattestor_x509pop.md) plugin. Private keys and certificates are created at the initialization of the scenario using a Go application, the details of which are out of the scope of this tutorial.
3636

37-
## Create a Shared Directory
37+
## The Shared Socket Directory
3838

39-
The first thing needed is a local directory that will be volume mounted on the services to share the Workload API between the root SPIRE Agent and its nested SPIRE Servers. This tutorial uses `.../spire-tutorials/docker-compose/nested-spire/sharedRootSocket` as the shared directory.
39+
We use a shared directory that will be volume mounted on the services to share the Workload API between the root SPIRE Agent and its nested SPIRE Servers. This tutorial uses a named volume in its docker-compose configuration to share the Workload API socket.
4040

4141
## Configuring Root SPIRE Deployment
4242

4343
Configuration files for [root-server](root/server/server.conf) and [root-agent](root/agent/agent.conf) have not been changed from the default `server.conf` and `agent.conf` files, but it's worth noting the location defined to bind the workload API socket by the SPIRE Agent: `socket_path ="/opt/spire/sockets/workload_api.sock"`. This path will be used later to configure a volume to share the Workload API with the nested SPIRE Servers.
4444

45-
We define all the services for the tutorial in the [docker-compose.yaml](docker-compose.yaml) file. In the `root-agent` service definition we mount the `/opt/spire/sockets` directory from the SPIRE Agent container on the new local directory `sharedRootSocket`. In the next section, when defining the nested SPIRE Server services, we'll use this directory to mount the `root-agent` socket on the SPIRE Server containers.
45+
We define all the services for the tutorial in the [docker-compose.yaml](docker-compose.yaml) file. In the `root-agent` service definition we mount the `/opt/spire/sockets` directory from the SPIRE Agent container on the named `spire-sockets` volume. In the next section, when defining the nested SPIRE Server services, we'll use this directory to mount the `root-agent` socket on the SPIRE Server containers.
4646

4747
```console
4848
services:
4949
# Root
5050
root-server:
51-
image: ghcr.io/spiffe/spire-server:1.5.1
51+
image: ghcr.io/spiffe/spire-server:1.11.2
5252
hostname: root-server
5353
volumes:
5454
- ./root/server:/opt/spire/conf/server
5555
command: ["-config", "/opt/spire/conf/server/server.conf"]
5656
root-agent:
5757
# Share the host pid namespace so this agent can attest the nested servers
5858
pid: "host"
59-
image: ghcr.io/spiffe/spire-agent:1.5.1
59+
image: ghcr.io/spiffe/spire-agent:1.11.2
6060
depends_on: ["root-server"]
6161
hostname: root-agent
6262
volumes:
6363
# Share root agent socket to be accessed by nestedA and nestedB servers
64-
- ./sharedRootSocket:/opt/spire/sockets
64+
- spire-sockets:/opt/spire/sockets
6565
- ./root/agent:/opt/spire/conf/agent
6666
- /var/run/:/var/run/
6767
command: ["-config", "/opt/spire/conf/agent/agent.conf"]
@@ -85,7 +85,7 @@ The configuration file for the [nestedA-server](./nestedA/server/server.conf) in
8585
}
8686
```
8787

88-
The Docker Compose definition for the `nestedA-server` service in the [docker-compose.yaml](docker-compose.yaml) file mounts the new local directory `sharedRootSocket` as a volume. Remember from the previous section that the `root-agent` socket is mounted on that directory. That way the `nestedA-server` can access the `root-agent` workload API and fetch its SVID.
88+
The Docker Compose definition for the `nestedA-server` service in the [docker-compose.yaml](docker-compose.yaml) file mounts the `spire-sockets` named volume. Remember from the previous section that the `root-agent` socket is mounted on that directory. That way the `nestedA-server` can access the `root-agent` workload API and fetch its SVID.
8989

9090
```console
9191
nestedA-server:
@@ -97,8 +97,8 @@ The Docker Compose definition for the `nestedA-server` service in the [docker-co
9797
# label to attest nestedA-server against root-agent
9898
- org.example.name=nestedA
9999
volumes:
100-
# Add root agent socket
101-
- ./shared/rootSocket:/opt/spire/sockets
100+
# Add root agent socket
101+
- spire-sockets:/opt/spire/sockets
102102
- ./nestedA/server:/opt/spire/conf/server
103103
command: ["-config", "/opt/spire/conf/server/server.conf"]
104104
```

docker-compose/nested-spire/scripts/set-env.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ fi
7171
sed -i.bak "s#\#container_id_cgroup_matchers#container_id_cgroup_matchers#" "${PARENT_DIR}"/root/agent/agent.conf
7272
sed -i.bak "s#CGROUP_MATCHERS#$CGROUP_MATCHERS#" "${PARENT_DIR}"/root/agent/agent.conf
7373

74-
# create a shared folder for root agent socket to be accessed by nestedA and nestedB servers
75-
mkdir -p "${PARENT_DIR}"/sharedRootSocket
76-
77-
7874
# Starts root SPIRE deployment
7975
log "Generate certificates for the root SPIRE deployment"
8076
setup "${PARENT_DIR}"/root/server "${PARENT_DIR}"/root/agent

0 commit comments

Comments
 (0)