aenix-io / etcd-operator

New generation community-driven etcd-operator!
https://etcd.aenix.io
Apache License 2.0
90 stars 13 forks source link

Add the ability to specify volumes and containers #113

Closed kvaps closed 7 months ago

kvaps commented 7 months ago

As part of #109

containers and volumes specified in a template should be merged using strategic merge patch, for example:

apiVersion: etcd.aenix.io/v1alpha1
kind: EtcdCluster
metadata:
  name: test
  namespace: default
spec:
  replicas: 3
  options: # map[string]string
    arg1: "value1"
    arg2: "value2"
  podTemplate:
    spec:
      containers: # []v1.Container
      - name: etcd
        volumeMounts:
        - name: test
          mountPath: /data/demo
      - name: exporter
        image: alpine
        args:
        - sleep
        - infinity
        volumeMounts:
        - name: test
          mountPath: /data/demo
      volumes: # []v1.Volume
      - name: test
        emptyDir: {}

should create a Pod with two containers: etcd and exporter and the same volume shared between them

kvaps commented 7 months ago

Internally agreed to merge podTemplate as lower level and generated object as upper layer. Currently it looks like more safe design. We can always change this behavior later.