Skip to content

Commit

Permalink
Merge pull request #435 from pych/add-sidecar
Browse files Browse the repository at this point in the history
Add sidecars and initcontainers
  • Loading branch information
ese authored Aug 31, 2022
2 parents a5f0462 + f151b69 commit fa8c5b9
Show file tree
Hide file tree
Showing 5 changed files with 5,043 additions and 259 deletions.
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

0 comments on commit fa8c5b9

Please sign in to comment.