You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/01/20 05:13:08 UTC

[GitHub] [airflow] VBhojawala commented on a change in pull request #13405: KubernetesPodOperator Guide

VBhojawala commented on a change in pull request #13405:
URL: https://github.com/apache/airflow/pull/13405#discussion_r560683866



##########
File path: docs/apache-airflow-providers-cncf-kubernetes/operators.rst
##########
@@ -15,114 +15,1015 @@
     specific language governing permissions and limitations
     under the License.
 
+###########################
+KubernetesPodOperator Guide
+###########################
+
+.. contents:: :local:
 
 
 .. _howto/operator:KubernetesPodOperator:
 
-KubernetesPodOperator
-=====================
+Kubernetes Pod Operator "Hello World!"
+======================================
+
+- Creating Task using KubernetesPodOperator which prints "Hello World [HOSTNAME]".  Add ``in_cluster=False`` to

Review comment:
       Ok , I will put that example of top.

##########
File path: docs/apache-airflow-providers-cncf-kubernetes/operators.rst
##########
@@ -15,114 +15,1015 @@
     specific language governing permissions and limitations
     under the License.
 
+###########################
+KubernetesPodOperator Guide
+###########################
+
+.. contents:: :local:
 
 
 .. _howto/operator:KubernetesPodOperator:
 
-KubernetesPodOperator
-=====================
+Kubernetes Pod Operator "Hello World!"
+======================================
+
+- Creating Task using KubernetesPodOperator which prints "Hello World [HOSTNAME]".  Add ``in_cluster=False`` to
+  KubernetesPodOperator constructor when running examples with minikube.

Review comment:
       ok.

##########
File path: docs/apache-airflow-providers-cncf-kubernetes/operators.rst
##########
@@ -15,114 +15,1015 @@
     specific language governing permissions and limitations
     under the License.
 
+###########################
+KubernetesPodOperator Guide
+###########################
+
+.. contents:: :local:
 
 
 .. _howto/operator:KubernetesPodOperator:
 
-KubernetesPodOperator
-=====================
+Kubernetes Pod Operator "Hello World!"
+======================================
+
+- Creating Task using KubernetesPodOperator which prints "Hello World [HOSTNAME]".  Add ``in_cluster=False`` to
+  KubernetesPodOperator constructor when running examples with minikube.
+
+
+.. code-block:: python
+
+  with DAG(dag_id="example_k8s_operator", start_date=days_ago(1),
+           schedule_interval='@once', tags=["example"]) as dag:
+      task1 = KubernetesPodOperator(task_id='k8s_pod_operator_task',
+                                    name='airflow_pod_operator',
+                                    namespace='default',
+                                    image='alpine',
+                                    cmds=["sh", "-c",
+                                          'echo "Hello World from pod [$HOSTNAME]"'],
+                                    startup_timeout_seconds=60,
+                                    )
+
+- Executing / Debugging example and checking the logs

Review comment:
       I meant after executing the dag with configuration, i will update the line.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org