From 0f6feff53e602e0ffcd9dcea6a7a5e7e49240896 Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Thu, 31 Aug 2023 15:38:09 +0200 Subject: [PATCH] Service exposition docs (#320) * added document * Updated docs * Added the external-unstable class to the getting started guide * Updated docs * ... * regenerate charts --- deploy/helm/airflow-operator/crds/crds.yaml | 4 ++- .../getting_started/code/airflow.yaml | 1 + .../getting_started/code/airflow.yaml.j2 | 31 ------------------- .../pages/usage-guide/listenerclass.adoc | 15 +++++++++ docs/modules/airflow/partials/nav.adoc | 1 + rust/crd/src/lib.rs | 10 +++--- 6 files changed, 25 insertions(+), 37 deletions(-) delete mode 100644 docs/modules/airflow/examples/getting_started/code/airflow.yaml.j2 create mode 100644 docs/modules/airflow/pages/usage-guide/listenerclass.adoc diff --git a/deploy/helm/airflow-operator/crds/crds.yaml b/deploy/helm/airflow-operator/crds/crds.yaml index 62ebccd9..41b08f23 100644 --- a/deploy/helm/airflow-operator/crds/crds.yaml +++ b/deploy/helm/airflow-operator/crds/crds.yaml @@ -7023,13 +7023,15 @@ spec: listenerClass: default: cluster-internal description: |- - In the future this setting will control, which ListenerClass will be used to expose the service. Currently only a subset of the ListenerClasses are supported by choosing the type of the created Services by looking at the ListenerClass name specified, In a future release support for custom ListenerClasses will be introduced without a breaking change: + This field controls which type of Service the Operator creates for this AirflowCluster: * cluster-internal: Use a ClusterIP service * external-unstable: Use a NodePort service * external-stable: Use a LoadBalancer service + + This is a temporary solution with the goal to keep yaml manifests forward compatible. In the future, this setting will control which ListenerClass will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change. enum: - cluster-internal - external-unstable diff --git a/docs/modules/airflow/examples/getting_started/code/airflow.yaml b/docs/modules/airflow/examples/getting_started/code/airflow.yaml index 325e35a0..c947b9bd 100644 --- a/docs/modules/airflow/examples/getting_started/code/airflow.yaml +++ b/docs/modules/airflow/examples/getting_started/code/airflow.yaml @@ -9,6 +9,7 @@ spec: clusterConfig: loadExamples: true exposeConfig: false + listenerClass: external-unstable credentialsSecret: simple-airflow-credentials webservers: roleGroups: diff --git a/docs/modules/airflow/examples/getting_started/code/airflow.yaml.j2 b/docs/modules/airflow/examples/getting_started/code/airflow.yaml.j2 deleted file mode 100644 index 325e35a0..00000000 --- a/docs/modules/airflow/examples/getting_started/code/airflow.yaml.j2 +++ /dev/null @@ -1,31 +0,0 @@ ---- -apiVersion: airflow.stackable.tech/v1alpha1 -kind: AirflowCluster -metadata: - name: airflow -spec: - image: - productVersion: 2.6.1 - clusterConfig: - loadExamples: true - exposeConfig: false - credentialsSecret: simple-airflow-credentials - webservers: - roleGroups: - default: - replicas: 1 - celeryExecutors: - roleGroups: - default: - replicas: 2 - config: - resources: - cpu: - min: 400m - max: 800m - memory: - limit: 2Gi - schedulers: - roleGroups: - default: - replicas: 1 diff --git a/docs/modules/airflow/pages/usage-guide/listenerclass.adoc b/docs/modules/airflow/pages/usage-guide/listenerclass.adoc new file mode 100644 index 00000000..fa0a52c9 --- /dev/null +++ b/docs/modules/airflow/pages/usage-guide/listenerclass.adoc @@ -0,0 +1,15 @@ += Service exposition with ListenerClasses + +Airflow offers a web UI and an API, both are exposed by the webserver process under the `webserver` role. The Operator deploys a service called `-webserver` (where `` is the name of the AirflowCluster) through which Airflow can be reached. + +This service can have three different types: `cluster-internal`, `external-unstable` and `external-stable`. Read more about the types in the xref:concepts:service-exposition.adoc[service exposition] documentation at platform level. + +This is how the listener class is configured: + +[source,yaml] +---- +spec: + clusterConfig: + listenerClass: cluster-internal # <1> +---- +<1> The default `cluster-internal` setting. diff --git a/docs/modules/airflow/partials/nav.adoc b/docs/modules/airflow/partials/nav.adoc index 66879add..b65482f2 100644 --- a/docs/modules/airflow/partials/nav.adoc +++ b/docs/modules/airflow/partials/nav.adoc @@ -5,6 +5,7 @@ ** xref:airflow:usage-guide/pod-placement.adoc[] ** xref:airflow:usage-guide/mounting-dags.adoc[] ** xref:airflow:usage-guide/applying-custom-resources.adoc[] +** xref:airflow:usage-guide/listenerclass.adoc[] ** xref:airflow:usage-guide/storage-resources.adoc[] ** xref:airflow:usage-guide/security.adoc[] ** xref:airflow:usage-guide/logging.adoc[] diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 0599050f..0e297bb3 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -169,17 +169,17 @@ pub struct AirflowClusterConfig { pub expose_config: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub load_examples: Option, - /// In the future this setting will control, which ListenerClass - /// will be used to expose the service. - /// Currently only a subset of the ListenerClasses are supported by choosing the type of the created Services - /// by looking at the ListenerClass name specified, - /// In a future release support for custom ListenerClasses will be introduced without a breaking change: + /// This field controls which type of Service the Operator creates for this AirflowCluster: /// /// * cluster-internal: Use a ClusterIP service /// /// * external-unstable: Use a NodePort service /// /// * external-stable: Use a LoadBalancer service + /// + /// This is a temporary solution with the goal to keep yaml manifests forward compatible. + /// In the future, this setting will control which ListenerClass + /// will be used to expose the service, and ListenerClass names will stay the same, allowing for a non-breaking change. #[serde(default)] pub listener_class: CurrentlySupportedListenerClasses, /// Name of the Vector aggregator discovery ConfigMap.