Kubernetes-Airflow | Setup Apache Airflow on Kubernetes | BPM library

 by   brunocfnba Shell Version: Current License: Apache-2.0

kandi X-RAY | Kubernetes-Airflow Summary

kandi X-RAY | Kubernetes-Airflow Summary

Kubernetes-Airflow is a Shell library typically used in Automation, BPM, Docker applications. Kubernetes-Airflow has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Setup Apache Airflow on Kubernetes
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Kubernetes-Airflow has a low active ecosystem.
              It has 7 star(s) with 5 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              Kubernetes-Airflow has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Kubernetes-Airflow is current.

            kandi-Quality Quality

              Kubernetes-Airflow has 0 bugs and 0 code smells.

            kandi-Security Security

              Kubernetes-Airflow has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Kubernetes-Airflow code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Kubernetes-Airflow is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Kubernetes-Airflow releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              It has 11 lines of code, 0 functions and 1 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Kubernetes-Airflow
            Get all kandi verified functions for this library.

            Kubernetes-Airflow Key Features

            No Key Features are available at this moment for Kubernetes-Airflow.

            Kubernetes-Airflow Examples and Code Snippets

            No Code Snippets are available at this moment for Kubernetes-Airflow.

            Community Discussions

            QUESTION

            How to create kubeconfig for Kubernetes Airflow worker pod launching KubernetesPodOperator
            Asked 2019-Jan-26 at 06:58

            I'm setting up Airflow in Kubernetes Engine, and I now have the following (running) pods:

            • postgres (with a mounted PersistentVolumeClaim)
            • flower
            • web (airflow dashboard)
            • rabbitmq
            • scheduler
            • worker

            From Airflow, I'd like to run a task starting a pod which - in this case - downloads some file from an SFTP server. However, the KubernetesPodOperator in Airflow which should start this new pod can't run, because the kubeconfig cannot be found.

            The Airflow worker is configured as below. The other Airflow pods are exactly the same apart from different args.

            ...

            ANSWER

            Answered 2019-Jan-26 at 06:58

            As is described in The Fine Manual, you will want in_cluster=True to advise KPO that it is, in fact, in-cluster.

            I would actually recommend filing a bug with Airflow because Airflow can trivially detect the fact that it is running inside the cluster, and should have a much more sane default than your experience.

            Source https://stackoverflow.com/questions/54350399

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Kubernetes-Airflow

            This Airflow setup has been implemented on IBM Cloud but you can run the code on any other cloud or even on-premisses or on Minikube. I'll let you know when you need to change code if you are on a different cloud. I'm using Postgres to store all the Airflow metadata. In case you don't have your own postgres or mysql database, all the required files to setup a postgres database on Kubernetes are in the 'postgres' directory. First you need to create persistent volumes to make them available for the deployments which will be created in the following steps. Make sure you are in the same directory as all the yml files provided in this repo. This is the step you may need to make some changes in case you are running on a different cloud provider. You need to check the storage classes they provide and use them instead. For the following steps you need to have Docker instlled on your local machine to be able to build the Airflow image. The image tag here follows the IBM cloud registry directives. Use the correct registry for your environment / cloud. Now it's time to create the Airflow deployments, web and scheduler. At this time your must have your postgres or mysql database up and running. Airflow web is responsible for all the web interface with some GUI controls as well as graphics and dashboards. Airflow scheduler is responsible for runnning a deamon to trigger any scheduled DAG. There are two ways to access the Airflow interface. This way you restrict your access to your local host increasing the setup security. To access the Airflow interface you need to get the Kubernetes cluster IP and the way to get that depends on your cloud provider. To do so on IBM Cloud run bx cs clusters to get your cluster name and then bx cs workers <your cluster name>. The command outputs some info about the cluster including the cluster worker public IP. With that simple open the address ( :30002) on your browser. You may need a more robust setup using Ingress to redirect the access to the correct worker within the cluster. On IBM Cloud, all the PVCs are owned by the "nobody" user and other normal user does not have permission to write on them. The second link in the references session below describe some workarounds for that but I'd like to share an easier way. Create the PVC and then mount it in a simple pod so you can access it (you can find really simple pods on the internet). Access the container in the pod runnin kubectl exec -it <pod name> /bin/bash. In the container as root, go to the mounted volume and create two folders, 'dags' and 'logs', grant them read, write and execute permission for others. If you go to your airflow deployment now and access it, you'll be able to access those folders and write on them being the airflow user. Some links on how to manage volumes on Kubernetes with IBM Cloud.
            To create the persistent volume run kubectl apply -f airflow-pvc.yml
            To check your new persistent volume run claim kubectl get pvc
            Create the Airflow image on your local machine running the following command:
            Make sure your image has been created successfully running docker images to list all the local images.
            Push the image to your cloud provider (in this case IBM Cloud):
            Create the Airflow web running the following command:
            Ensure your deployment is running using the kubectl get deployments command. To view more details run kubectl get pods to view all the pods, copy your dep-airflow-web pod and run the command kubectl describe pod dep-airflow-web-<some code>.
            Create the Airflow scheduler running the following:
            Follow the steps in Airflow web to check the deployment is running.
            A more secure way is port-forwarding the pod port to your local machine. To do so, get the pod name from your deployment running kubectl get pods and then using the pod name run:
            Exposing the port so it can be accessed using the Kubernetes cluster IP.  To do so create the Airflow service running kubectl create -f service-airflow.yml  Check your service has been created running kubectl get services.
            Creating Persistent Volumes on IBM Cloud
            Handling volumes permissions on IBM Cloud

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/brunocfnba/Kubernetes-Airflow.git

          • CLI

            gh repo clone brunocfnba/Kubernetes-Airflow

          • sshUrl

            git@github.com:brunocfnba/Kubernetes-Airflow.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular BPM Libraries

            Try Top Libraries by brunocfnba

            docker-airflow

            by brunocfnbaPython

            docker-kubernetes-workshop

            by brunocfnbaJavaScript

            word-suggestion-tensorflow

            by brunocfnbaPython

            docker-training

            by brunocfnbaJavaScript