Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sidecars and initcontainers #435

Merged
merged 5 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
kubernetes-version: ${{ matrix.kubernetes }}
driver: none
- name: Add redisfailover CRD
run: kubectl apply -f manifests/databases.spotahome.com_redisfailovers.yaml
run: kubectl create -f manifests/databases.spotahome.com_redisfailovers.yaml
- run: make ci-integration-test

chart-test:
Expand Down
4 changes: 4 additions & 0 deletions api/redisfailover/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ type RedisSettings struct {
Command []string `json:"command,omitempty"`
ShutdownConfigMap string `json:"shutdownConfigMap,omitempty"`
Storage RedisStorage `json:"storage,omitempty"`
InitContainers []corev1.Container `json:"initContainers,omitempty"`
Exporter RedisExporter `json:"exporter,omitempty"`
ExtraContainers []corev1.Container `json:"extraContainers,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty"`
SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
Expand Down Expand Up @@ -79,7 +81,9 @@ type SentinelSettings struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
InitContainers []corev1.Container `json:"initContainers,omitempty"`
Exporter SentinelExporter `json:"exporter,omitempty"`
ExtraContainers []corev1.Container `json:"extraContainers,omitempty"`
ConfigCopy SentinelConfigCopy `json:"configCopy,omitempty"`
HostNetwork bool `json:"hostNetwork,omitempty"`
DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty"`
Expand Down
44 changes: 44 additions & 0 deletions example/redisfailover/sidecars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: sc
---
apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
name: sidecars
namespace: sc
spec:
sentinel:
initContainers:
- name: echo
image: busybox
command:
- "/bin/sh"
- "-c"
- "echo 'init container sentinel'"
replicas: 3
extraContainers:
- name: busybox
image: busybox
command:
- "/bin/sh"
- "-c"
- "sleep infinity"
redis:
replicas: 3
initContainers:
- name: echo
image: busybox
command:
- "/bin/sh"
- "-c"
- "echo 'init container redis'"
extraContainers:
- name: busybox
image: busybox
command:
- "/bin/sh"
- "-c"
- "sleep infinity"
Loading