Skip to content

Commit dfe2111

Browse files
Merge pull request #766 from rabbitmq/side-car
Add a sidecar example
2 parents dba42f2 + e7602a9 commit dfe2111

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

docs/examples/sidecar/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Sidecar Example
2+
3+
This example adds an additional container in the rabbitmq pod using the StatefulSet override. You can add multiple additional containers and add additional containers to `initContainers` as well.
4+
5+
You can deploy this example:
6+
7+
```shell
8+
kubectl apply -f rabbitmq.yaml
9+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: rabbitmq.com/v1beta1
2+
kind: RabbitmqCluster
3+
metadata:
4+
name: sidecar
5+
spec:
6+
replicas: 1
7+
override:
8+
statefulSet:
9+
spec:
10+
template:
11+
spec:
12+
containers:
13+
- name: additional-container
14+
image: busybox
15+
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 5000']

docs/examples/sidecar/test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
kubectl get pod sidecar-server-0 -o jsonpath="{.spec.containers[*].image}" | grep busybox
4+
kubectl get pod sidecar-server-0 | grep 2/2
5+

0 commit comments

Comments
 (0)