diff --git a/composer/airflow_1_samples/gke_operator.py b/composer/airflow_1_samples/gke_operator.py index b3638655b20..082d3333f9a 100644 --- a/composer/airflow_1_samples/gke_operator.py +++ b/composer/airflow_1_samples/gke_operator.py @@ -92,7 +92,7 @@ # project-id as the gcr.io images and the service account that Composer # uses has permission to access the Google Container Registry # (the default service account has permission) - image="gcr.io/gcp-runtimes/ubuntu_18_0_4", + image="marketplace.gcr.io/google/ubuntu2204", ) # [END composer_gkeoperator_minconfig_airflow_1] diff --git a/composer/airflow_1_samples/kubernetes_pod_operator.py b/composer/airflow_1_samples/kubernetes_pod_operator.py index 11abdb6b1ec..2799f467ec9 100644 --- a/composer/airflow_1_samples/kubernetes_pod_operator.py +++ b/composer/airflow_1_samples/kubernetes_pod_operator.py @@ -93,7 +93,7 @@ # project-id as the gcr.io images and the service account that Composer # uses has permission to access the Google Container Registry # (the default service account has permission) - image="gcr.io/gcp-runtimes/ubuntu_18_0_4", + image="marketplace.gcr.io/google/ubuntu2204", ) # [END composer_kubernetespodoperator_minconfig_airflow_1] # [START composer_kubernetespodoperator_templateconfig_airflow_1] diff --git a/composer/workflows/gke_operator.py b/composer/workflows/gke_operator.py index 2f1eaa62c8a..31536ba55e7 100644 --- a/composer/workflows/gke_operator.py +++ b/composer/workflows/gke_operator.py @@ -29,7 +29,7 @@ with models.DAG( "example_gcp_gke", - schedule_interval=None, # Override to match your needs + schedule=None, # Override to match your needs start_date=days_ago(1), tags=["example"], ) as dag: @@ -86,7 +86,7 @@ # project-id as the gcr.io images and the service account that Composer # uses has permission to access the Google Container Registry # (the default service account has permission) - image="gcr.io/gcp-runtimes/ubuntu_18_0_4", + image="marketplace.gcr.io/google/ubuntu2204", ) # [END composer_gkeoperator_minconfig] diff --git a/composer/workflows/kubernetes_pod_operator.py b/composer/workflows/kubernetes_pod_operator.py index f679ead81d7..26dcb9d5173 100644 --- a/composer/workflows/kubernetes_pod_operator.py +++ b/composer/workflows/kubernetes_pod_operator.py @@ -96,7 +96,7 @@ # project-id as the gcr.io images and the service account that Composer # uses has permission to access the Google Container Registry # (the default service account has permission) - image="gcr.io/gcp-runtimes/ubuntu_18_0_4", + image="marketplace.gcr.io/google/ubuntu2204", ) # [END composer_kubernetespodoperator_minconfig] # [START composer_kubernetespodoperator_templateconfig] diff --git a/composer/workflows/kubernetes_pod_operator_c2.py b/composer/workflows/kubernetes_pod_operator_c2.py index 65e43289695..0a227058d77 100644 --- a/composer/workflows/kubernetes_pod_operator_c2.py +++ b/composer/workflows/kubernetes_pod_operator_c2.py @@ -17,10 +17,11 @@ import datetime from airflow import models -from airflow.kubernetes.secret import Secret + from airflow.providers.cncf.kubernetes.operators.pod import ( KubernetesPodOperator, ) +from airflow.providers.cncf.kubernetes.secret import Secret from kubernetes.client import models as k8s_models # A Secret is an object that contains a small amount of sensitive data such as @@ -60,7 +61,7 @@ # required to debug. with models.DAG( dag_id="composer_sample_kubernetes_pod", - schedule_interval=datetime.timedelta(days=1), + schedule=datetime.timedelta(days=1), start_date=YESTERDAY, ) as dag: # Only name, image, and task_id are required to create a @@ -88,7 +89,7 @@ # project-id as the gcr.io images and the service account that Composer # uses has permission to access the Google Container Registry # (the default service account has permission) - image="gcr.io/gcp-runtimes/ubuntu_20_0_4", + image="marketplace.gcr.io/google/ubuntu2204", # Specifies path to kubernetes config. The config_file is templated. config_file="/home/airflow/composer_kube_config", # Identifier of connection that should be used @@ -130,7 +131,7 @@ task_id="ex-kube-secrets", name="ex-kube-secrets", namespace="composer-user-workloads", - image="gcr.io/gcp-runtimes/ubuntu_20_0_4", + image="marketplace.gcr.io/google/ubuntu2204", startup_timeout_seconds=300, # The secrets to pass to Pod, the Pod will fail to create if the # secrets you specify in a Secret object do not exist in Kubernetes.