ECD Patch is meant to provide a flexible option for users to define and provision Kubernetes objects that suits their system architecture or to tailor the ECD to their preferred flavour.
...
Example below shows how to add a host alias to the deployment (pod), which will basically add an entry into /etc/hosts.
Code Block |
---|
apiVersion: mz.digitalroute.com/v1alpha1 kind: ECDeployment metadata: ... spec: ... ... patchType: "application/strategic-merge-patch+json" patch: | spec: template: spec: hostAliases: - ip: "127.0.0.1" hostnames: - "dummy" |
...
Code Block |
---|
services: - spec: type: ClusterIP ports: - port: 9092 protocol: TCP targetPort: 9092 ... ... patchType: "application/strategic-merge-patch+json" patch: | spec: ports: - name: "port-1" port: 9093 protocol: TCP targetPort: 9093 - name: "port-2" port: 9094 protocol: UDP targetPort: 9094 ... |
Samples
To help users to understand better, below are some Below are samples that can get help users getting started using with ECD patch. Do note that “Before” is based on the ECD - which is the definition file for the desired state. while “After” is based on the conversion and logic processing done by Operator - which is the actual objects provisioning yaml to be applied to the cluster. As you might notice, there are a lot more objects that will be provisioned and handled by Operator itself.
...
Before ECD Patch | After ECD Patch | ||||
---|---|---|---|---|---|
|
|
Setting Toleration
In the example below, assuming a 3 nodes implementation K8S cluster, 2 nodes are tainted color=blue and 1 node is tainted color=red, the test is to add toleration to ECD so that it will get deployed into node tainted with color=red.
...
We may also use ECD Patch to remove a provisioned K8S object. From mounting a storage example, now we can use the directive marker ($patch: delete) to remove the volume and volumeMount.
...
Before ECD Patch
...
Before ECD Patch | After ECD Patch | ||||
---|---|---|---|---|---|
|
|