https://0xdata.atlassian.net/browse/PUBDEV-7847
What is not present
- Release pipeline for the operator. There will probably be an official docker image based on Red Hat's UBI (as this is required for the certification process)
- Integration with www.operatorhub.io
These will be done in next iteration, as it would make such a complex PR even more complex. Let's build the operator first, then do the integration part.
What was done & guide to review
Previously, this repository served only for the command line interface. There was only one binary with multiple modules. Now, there are three projects: cli
, operator
and deployment
. As mentioned in the documentation, the deployment
module contains common functions and modules for deployment
of H2O into Kubernetes.
Looking at the diff is not recommended, as basically everything changed. Let me suggest reviewing the whole project from scratch as if it was just commited :octocat: One way to do that is to view the repository from this PR's point of view: https://github.com/h2oai/h2o-kubernetes/tree/pubdev-7847 and follow the instructions on how to build the project and develop. This could also reveal any mistakes done in the documentation.
What was done, it's purpose and means should be sufficiently explained in the in-code documentation and READMEs. Let me put that into a test by NOT repeating it here.
Logging
Example of logging template used for you to review:
~/.../target/release >>> ./h2o-operator
2020-11-07 19:24:55,748 INFO [h2o_operator] Kubeconfig found. Using default namespace: default
2020-11-07 19:24:55,768 INFO [h2o_operator] Detected H2O CustomResourceDefinition already present in the cluster.
2020-11-07 19:28:54,869 INFO [h2o_operator::controller] Deployed H2O 'h2o-test'.
2020-11-07 19:28:54,869 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
2020-11-07 19:28:54,873 INFO [h2o_operator::controller] No action taken for:
H2O { api_version: "h2o.ai/v1", kind: "H2O", metadata: ObjectMeta { annotations: Some({"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"h2o.ai/v1\",\"kind\":\"H2O\",\"metadata\":{\"annotations\":{},\"name\":\"h2o-test\",\"namespace\":\"default\"},\"spec\":{\"nodes\":3,\"resources\":{\"cpu\":1,\"memory\":\"512Mi\",\"memoryPercentage\":90},\"version\":\"3.32.0.1\"}}\n"}), cluster_name: None, creation_timestamp: Some(Time(2020-11-07T18:28:54Z)), deletion_grace_period_seconds: None, deletion_timestamp: None, finalizers: Some(["h2o3.h2o.ai"]), generate_name: None, generation: Some(1), labels: None, managed_fields: Some([ManagedFieldsEntry { api_version: Some("h2o.ai/v1"), fields_type: Some("FieldsV1"), fields_v1: Some(FieldsV1(Object({"f:metadata": Object({"f:annotations": Object({".": Object({}), "f:kubectl.kubernetes.io/last-applied-configuration": Object({})})}), "f:spec": Object({".": Object({}), "f:nodes": Object({}), "f:resources": Object({".": Object({}), "f:cpu": Object({}), "f:memory": Object({}), "f:memoryPercentage": Object({})}), "f:version": Object({})})}))), manager: Some("kubectl"), operation: Some("Update"), time: Some(Time(2020-11-07T18:28:54Z)) }, ManagedFieldsEntry { api_version: Some("h2o.ai/v1"), fields_type: Some("FieldsV1"), fields_v1: Some(FieldsV1(Object({"f:metadata": Object({"f:finalizers": Object({".": Object({}), "v:\"h2o3.h2o.ai\"": Object({})})})}))), manager: Some("unknown"), operation: Some("Update"), time: Some(Time(2020-11-07T18:28:54Z)) }]), name: Some("h2o-test"), namespace: Some("default"), owner_references: None, resource_version: Some("19334"), self_link: Some("/apis/h2o.ai/v1/namespaces/default/h2os/h2o-test"), uid: Some("084ea47e-7d8c-439f-abd4-953b521729c1") }, spec: H2OSpec { nodes: 3, version: Some("3.32.0.1"), resources: Resources { cpu: 1, memory: "512Mi", memory_percentage: Some(90) }, custom_image: None } }
2020-11-07 19:28:54,873 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
2020-11-07 19:29:30,519 INFO [h2o_operator::controller] Deleted H2O 'h2o-test'.
2020-11-07 19:29:30,519 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
2020-11-07 19:30:21,428 INFO [h2o_operator::controller] Deployed H2O 'h2o-test'.
2020-11-07 19:30:21,428 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
2020-11-07 19:30:21,430 INFO [h2o_operator::controller] No action taken for:
H2O { api_version: "h2o.ai/v1", kind: "H2O", metadata: ObjectMeta { annotations: Some({"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"h2o.ai/v1\",\"kind\":\"H2O\",\"metadata\":{\"annotations\":{},\"name\":\"h2o-test\",\"namespace\":\"default\"},\"spec\":{\"nodes\":3,\"resources\":{\"cpu\":1,\"memory\":\"512Mi\",\"memoryPercentage\":90},\"version\":\"3.32.0.1\"}}\n"}), cluster_name: None, creation_timestamp: Some(Time(2020-11-07T18:30:21Z)), deletion_grace_period_seconds: None, deletion_timestamp: None, finalizers: Some(["h2o3.h2o.ai"]), generate_name: None, generation: Some(1), labels: None, managed_fields: Some([ManagedFieldsEntry { api_version: Some("h2o.ai/v1"), fields_type: Some("FieldsV1"), fields_v1: Some(FieldsV1(Object({"f:metadata": Object({"f:annotations": Object({".": Object({}), "f:kubectl.kubernetes.io/last-applied-configuration": Object({})})}), "f:spec": Object({".": Object({}), "f:nodes": Object({}), "f:resources": Object({".": Object({}), "f:cpu": Object({}), "f:memory": Object({}), "f:memoryPercentage": Object({})}), "f:version": Object({})})}))), manager: Some("kubectl"), operation: Some("Update"), time: Some(Time(2020-11-07T18:30:21Z)) }, ManagedFieldsEntry { api_version: Some("h2o.ai/v1"), fields_type: Some("FieldsV1"), fields_v1: Some(FieldsV1(Object({"f:metadata": Object({"f:finalizers": Object({".": Object({}), "v:\"h2o3.h2o.ai\"": Object({})})})}))), manager: Some("unknown"), operation: Some("Update"), time: Some(Time(2020-11-07T18:30:21Z)) }]), name: Some("h2o-test"), namespace: Some("default"), owner_references: None, resource_version: Some("19501"), self_link: Some("/apis/h2o.ai/v1/namespaces/default/h2os/h2o-test"), uid: Some("7c527027-11ee-4e24-a5b3-292a6085a80d") }, spec: H2OSpec { nodes: 3, version: Some("3.32.0.1"), resources: Resources { cpu: 1, memory: "512Mi", memory_percentage: Some(90) }, custom_image: None } }
2020-11-07 19:30:21,430 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
2020-11-07 19:30:39,728 INFO [h2o_operator::controller] Deleted H2O 'h2o-test'.
2020-11-07 19:30:39,728 INFO [h2o_operator::controller] Reconciled (ObjectRef { kind: (), name: "h2o-test", namespace: Some("default") }, ReconcilerAction { requeue_after: None })
:pray: Thank you for reviewing such a big PR. :pray:
type/feature