etcd-operator
etcd-operator copied to clipboard
installing crd manually
Hello,
I want to run etcd-operator in a multitent fashion. I'd like a service account, role, and role binding all scoped to a tenant dub'd namespace. This involves me telling the operator not to install the CRD. How can the k8s administrator install the CRD manually a head of time, and the namespace scoped operator utilize the installed CRD.
docker run --rm quay.io/coreos/etcd-operator:v0.9.4 etcd-operator --help 2>&1 | grep -i CRD
-create-crd
The operator will not create the EtcdCluster CRD when this flag is set to false. (default true)
I think @ldelossa wants to install the CRD without running etcd-operator, as I do. This is because getting etcd-operator to install the CRD requires that it has a ClusterRole, which we don't want to grant it. Also, there are some environments in which it's necessary to install the CRD in advance.
This is what it installs....
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: etcdclusters.etcd.database.coreos.com
spec:
conversion:
strategy: None
group: etcd.database.coreos.com
names:
kind: EtcdCluster
listKind: EtcdClusterList
plural: etcdclusters
shortNames:
- etcd
singular: etcdcluster
preserveUnknownFields: true
scope: Namespaced
versions:
- name: v1beta2
served: true
storage: true
Yes, as a workaround I've extracted that and install it manually before deploying etcd-operator. However, this isn't foolproof, as any future changes to the CRD wouldn't be included, and so deployment could fail.