(templated) :type env_vars: dict :param secrets: Kubernetes secrets to inject in the container. :type name: str :param env_vars: Environment variables initialized in the container. :type startup_timeout_seconds: int :param name: name of the pod in which the task will run, will be used to generate a pod id (DNS-1123 subdomain, containing only ). :type labels: dict :param startup_timeout_seconds: timeout in seconds to startup the pod. :type volumes: list :param labels: labels to apply to the Pod. ![]() Includes ConfigMaps and PersistentVolumes. :type volume_mounts: list :param volumes: volumes for launched pod. :type ports: list :param volume_mounts: volumeMounts for launched pod. If more than one secret is required, provide a comma separated list: secret_a,secret_b :type image_pull_secrets: str :param ports: ports for launched pod. :type image_pull_policy: str :param image_pull_secrets: Any image pull secrets to be given to the pod. :type arguments: list :param image_pull_policy: Specify a policy to cache or always pull an image. (templated) The docker image's CMD is used if this is not provided. :type cmds: list :param arguments: arguments of the entrypoint. (templated) The docker images's entrypoint is used if this is not provided. :type name: str :param cmds: entrypoint of the container. :type image: str :param name: name of the pod in which the task will run, will be used (plus a random suffix) to generate a pod id (DNS-1123 subdomain, containing only ). Defaults to, but fully qualified URLS will point to custom repositories. :param image: Docker image you wish to launch. note:: If you use `Google Kubernetes Engine `_, use :class:`~_engine.GKEPodOperator`, which simplifies the authorization process. class KubernetesPodOperator ( BaseOperator ): # pylint: disable=too-many-instance-attributes """ Execute a task in a Kubernetes Pod. """Executes task in a Kubernetes POD""" import re import yaml from airflow.exceptions import AirflowException from 8s_model import append_to_pod from airflow.kubernetes import kube_client, pod_generator, pod_launcher from import Resources from airflow.models import BaseOperator from import apply_defaults from import validate_key from import State from airflow.version import version as airflow_version from _generator import PodGenerator from kubernetes.client import models as k8s See the License for the # specific language governing permissions and limitations # under the License. You may obtain a copy of the License at # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License") you may not use this file except in compliance # with the License. ![]() See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements.
0 Comments
Leave a Reply. |