|
17 | 17 | import datetime |
18 | 18 |
|
19 | 19 | from airflow import models |
20 | | -from airflow.kubernetes.secret import Secret |
| 20 | + |
21 | 21 | from airflow.providers.cncf.kubernetes.operators.pod import ( |
22 | 22 | KubernetesPodOperator, |
23 | 23 | ) |
| 24 | +from airflow.providers.cncf.kubernetes.secret import Secret |
24 | 25 | from kubernetes.client import models as k8s_models |
25 | 26 |
|
26 | 27 | # A Secret is an object that contains a small amount of sensitive data such as |
|
60 | 61 | # required to debug. |
61 | 62 | with models.DAG( |
62 | 63 | dag_id="composer_sample_kubernetes_pod", |
63 | | - schedule_interval=datetime.timedelta(days=1), |
| 64 | + schedule=datetime.timedelta(days=1), |
64 | 65 | start_date=YESTERDAY, |
65 | 66 | ) as dag: |
66 | 67 | # Only name, image, and task_id are required to create a |
|
88 | 89 | # project-id as the gcr.io images and the service account that Composer |
89 | 90 | # uses has permission to access the Google Container Registry |
90 | 91 | # (the default service account has permission) |
91 | | - image="gcr.io/gcp-runtimes/ubuntu_20_0_4", |
| 92 | + image="marketplace.gcr.io/google/ubuntu2204", |
92 | 93 | # Specifies path to kubernetes config. The config_file is templated. |
93 | 94 | config_file="/home/airflow/composer_kube_config", |
94 | 95 | # Identifier of connection that should be used |
|
130 | 131 | task_id="ex-kube-secrets", |
131 | 132 | name="ex-kube-secrets", |
132 | 133 | namespace="composer-user-workloads", |
133 | | - image="gcr.io/gcp-runtimes/ubuntu_20_0_4", |
| 134 | + image="marketplace.gcr.io/google/ubuntu2204", |
134 | 135 | startup_timeout_seconds=300, |
135 | 136 | # The secrets to pass to Pod, the Pod will fail to create if the |
136 | 137 | # secrets you specify in a Secret object do not exist in Kubernetes. |
|
0 commit comments