Add A New Etcd Cluster Component¶
etcd-druid
defines an Operator which is responsible for creation, deletion and update of a resource that is created for an Etcd
cluster. If you want to introduce a new resource for an Etcd
cluster then you must do the following:
-
Add a dedicated
package
for the resource under component. -
Implement
Operator
interface. -
Define a new Kind for this resource in the operator Registry.
-
Every resource a.k.a
Component
needs to have the following set of default labels: -
app.kubernetes.io/name
- value of this label is the name of this component. Helper functions are defined here to create the name of each component using the parentEtcd
resource. Please define a new helper function to generate the name of your resource using the parentEtcd
resource. app.kubernetes.io/component
- value of this label is the type of the component. All component type label values are defined here where you can add an entry for your component.- In addition to the above component specific labels, each resource/component should have default labels defined on the
Etcd
resource. You can use GetDefaultLabels function.
These labels are also part of recommended labels by kubernetes. NOTE: Constants for the label keys are already defined here.
-
Ensure that there is no
wait
introduced in anyOperator
method implementation in your component. In case there are multiple steps to be executed in a sequence then re-queue the event with a special error code in case there is an error or if the pre-conditions check to execute the next step are not yet satisfied. -
All errors should be wrapped with a custom DruidError.