-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Sidecar Example | ||
|
||
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. | ||
|
||
You can deploy this example: | ||
|
||
```shell | ||
kubectl apply -f rabbitmq.yaml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: rabbitmq.com/v1beta1 | ||
kind: RabbitmqCluster | ||
metadata: | ||
name: sidecar | ||
spec: | ||
replicas: 1 | ||
override: | ||
statefulSet: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: additional-container | ||
image: busybox | ||
command: ['sh', '-c', 'echo "Hello, Kubernetes!" && sleep 5000'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
kubectl get pod sidecar-server-0 -o jsonpath="{.spec.containers[*].image}" | grep busybox | ||
kubectl get pod sidecar-server-0 | grep 2/2 | ||
|