apiVersion: v1
kind: ReplicationController
metadata:
  name: couchbase-controller
  annotations:
    sidecar.istio.io/inject: "false"
spec:
  replicas: 1
  # selector identifies the set of Pods that this
  # replicaController is responsible for managing
  selector:
    name: couchbase-server
    role: nodes
  # podTemplate defines the 'cookie cutter' used for creating
  # new pods when necessary
  template:
    metadata:
      labels:
        # Important: these labels need to match the selector above
        # The api server enforces this constraint.
        name: couchbase-server
        role: nodes
      annotations:
        sidecar.istio.io/inject: "false"
    spec:
      containers:
        - name: couchbase-server
          image: couchbase/server:community-4.5.1
          ports:
            - name: admin
              containerPort: 8091
            - name: views
              containerPort: 8092
        - name: couchbase-sidekick
          image: tleyden5iwx/couchbase-cluster-go:latest
          command:
            - /bin/sh
            - -c
            - update-wrapper --skip-etcd-check couchbase-cluster start-couchbase-sidekick --discover-local-ip --etcd-servers http://PODNAME-etcd-cluster-client:2379
            # Can also use http://app-etcd-service.kubernetes.local
