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
Run this command from the `antithesis/test-template` directory:
62
69
@@ -71,140 +78,42 @@ Both commands build etcd-server and etcd-client from the current branch. To buil
71
78
make antithesis-build-etcd-image REF=${GIT_REF}
72
79
```
73
80
74
-
### 2. (Optional) Check the Image Locally
75
-
76
-
You can verify your new image is built:
77
-
78
-
```bash
79
-
docker images | grep etcd-client
80
-
```
81
-
82
-
It should show something like:
83
-
84
-
```
85
-
etcd-client latest <IMAGE_ID> <DATE>
86
-
```
87
-
88
-
### 3. Use in Docker Compose
81
+
#### 2. Set up the Kubernetes cluster
89
82
90
83
Run the following command from the root directory for Antithesis tests (`tests/antithesis`):
91
84
92
85
```bash
93
-
make antithesis-docker-compose-up
86
+
make antithesis-k8s-up
94
87
```
95
88
96
-
The command uses the etcd client and server images built from step 1.
89
+
This command will:
97
90
98
-
The client will continuously check the health of the etcd nodes and print logs similar to:
91
+
* Create a local `kind` cluster named `etcd-antithesis`.
92
+
* Load the built `etcd-client` and `etcd-server` images into the cluster.
93
+
* Deploy the Kubernetes manifests from `config/manifests`.
99
94
100
-
```
101
-
[+] Running 4/4
102
-
✔ Container etcd0 Created 0.0s
103
-
✔ Container etcd2 Created 0.0s
104
-
✔ Container etcd1 Created 0.0s
105
-
✔ Container client Recreated 0.1s
106
-
Attaching to client, etcd0, etcd1, etcd2
107
-
etcd2 | {"level":"info","ts":"2025-04-14T07:23:25.134294Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_ADVERTISE_CLIENT_URLS","variable-value":"http://etcd2.etcd:2379"}
108
-
etcd2 | {"level":"info","ts":"2025-04-14T07:23:25.138501Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_INITIAL_ADVERTISE_PEER_URLS","variable-value":"http://etcd2:2380"}
109
-
etcd2 | {"level":"info","ts":"2025-04-14T07:23:25.138646Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_INITIAL_CLUSTER","variable-value":"etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380"}
110
-
etcd0 | {"level":"info","ts":"2025-04-14T07:23:25.138434Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_ADVERTISE_CLIENT_URLS","variable-value":"http://etcd0.etcd:2379"}
111
-
etcd0 | {"level":"info","ts":"2025-04-14T07:23:25.138582Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_INITIAL_ADVERTISE_PEER_URLS","variable-value":"http://etcd0:2380"}
112
-
etcd0 | {"level":"info","ts":"2025-04-14T07:23:25.138592Z","caller":"flags/flag.go:113","msg":"recognized and used environment variable","variable-name":"ETCD_INITIAL_CLUSTER","variable-value":"etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380"}
etcd1 | {"level":"info","ts":"2025-04-14T07:23:25.484092Z","caller":"embed/serve.go:210","msg":"serving client traffic insecurely; this is strongly discouraged!","traffic":"grpc+http","address":"[::]:2379"}
etcd2 | {"level":"info","ts":"2025-04-14T07:23:25.485101Z","caller":"v3rpc/health.go:61","msg":"grpc service status changed","service":"","status":"SERVING"}
etcd2 | {"level":"info","ts":"2025-04-14T07:23:25.485782Z","caller":"embed/serve.go:210","msg":"serving client traffic insecurely; this is strongly discouraged!","traffic":"grpc+http","address":"[::]:2379"}
client | Client [entrypoint]: connection successful with etcd0
130
-
client | Client [entrypoint]: connection successful with etcd1
131
-
client | Client [entrypoint]: connection successful with etcd2
132
-
client | Client [entrypoint]: cluster is healthy!
133
-
```
95
+
The client pod will continuously check the health of the etcd nodes and wait for the cluster to be healthy.
134
96
135
-
And it will stay running indefinitely.
97
+
#### 3. Running the tests
136
98
137
-
### 4. Running the tests
99
+
To run the tests locally against the deployed cluster:
138
100
139
101
```bash
140
-
make antithesis-run-container-traffic
141
-
make antithesis-run-container-validation
102
+
make antithesis-run-k8s-traffic
103
+
make antithesis-run-k8s-validation
142
104
```
143
105
144
-
Alternatively, with the etcd cluster from step 3, to run the tests locally without rebuilding the client image:
145
-
146
-
```bash
147
-
make antithesis-run-local-traffic
148
-
make antithesis-run-local-validation
149
-
```
106
+
#### 4. Prepare for next run
150
107
151
-
### 5. Prepare for next run
152
-
153
-
Unfortunatelly robustness tests don't support running on non empty database.
108
+
Unfortunately robustness tests don't support running on a non-empty database.
154
109
So for now you need to cleanup the storage before repeating the run or you will get "non empty database at start, required by model used for linearizability validation" error.
155
110
156
111
```bash
157
112
make antithesis-clean
158
113
```
159
114
160
-
## Troubleshooting
161
-
162
-
-**Image Pull Errors**: If Docker can’t pull `etcd-client:latest`, make sure you built it locally (see the “Build and Tag” step) or push it to a registry that Compose can access.
163
-
164
-
# Running Tests with Kubernetes (WIP)
165
-
166
-
## Prerequisites
167
-
168
-
Please make sure that you have the following tools installed on your local:
### Setting up the cluster and deploying the images
176
-
177
-
#### 1. Ensure your access to a test kubernetes cluster
178
-
179
-
You can use `kind` to create a local cluster to deploy the etcd-server and test client. Once you have `kind` installed, you can use the following command to create a local cluster:
180
-
181
-
```bash
182
-
kind create cluster
183
-
```
184
-
185
-
Alternatively, you can use any existing kubernetes cluster you have access to.
186
-
187
-
#### 2. Build and load the images
188
-
189
-
Please [build the client and server images](#1-build-and-tag-the-docker-image) first. Then load the images into the `kind` cluster:
115
+
This command will delete the `kind` cluster and remove the local data directories.
190
116
191
-
If you use `kind`, the cluster will need to have access to the images using the following commands:
117
+
### Troubleshooting
192
118
193
-
```bash
194
-
kind load docker-image etcd-client:latest
195
-
kind load docker-image etcd-server:latest
196
-
```
197
-
198
-
If you use something other than `kind`, please make sure the images are accessible to your cluster. This might involve pushing the images to a container registry that your cluster can pull from.
199
-
200
-
#### 3. Deploy the kubernetes manifests
201
-
202
-
```bash
203
-
kubectl apply -f ./config/manifests
204
-
```
205
-
206
-
### Tearing down the cluster
207
-
208
-
```bash
209
-
kind delete cluster --name kind
210
-
```
119
+
***Image Pull Errors**: If Kubernetes can’t pull `etcd-client:latest`, make sure you built it locally and that it was successfully loaded into the `kind` cluster.
0 commit comments