Category : kubernetes

I’m running into an issue where it seems I can only run a python command in either the dockerfile or Kubernetes. Right now I have two python scripts, the first script setting up keys and tokens so the second script can run properly. My dockerfile looks something like this: FROM python:3.8.0-alpine WORKDIR /code COPY script1.py ..

Read more

I want to consume kubernetes API to get information from an EKS cluster. Right now I am using kubeconfig to connect to the cluster and here is my code: from kubernetes import client, config import json from jsonpath_ng import parse kube_config = os.getcwd() + "/kube_config" config.load_kube_config(kube_config) def get_result(): """ """ res = {} res["ds_name"] = ..

Read more

I’m trying to convert v1Ingress object to standard yaml file. However comparing the saved file with it’s manifest file using kubectl get ing example -o yaml shows different files. Any pointers to solve this from kubernetes import client, config import kubernetes.client from kubernetes.client.rest import ApiException import yaml config.load_kube_config("k8s.yml") v1 = client.NetworkingV1Api() api_client = client.ApiClient() namespace ..

Read more

How can I create connection hook to connect to Kubernetes from Airflow? I have seen the docs, but the example is really unclear as to how to use it in practice. For example I have: kubernetes_hook = KubernetesHook( conn_id="kubernetes://?extra__kubernetes__in_cluster=True&extra__kubernetes__namespace=my_namespace" ) response = kubernetes_hook.create_custom_object( plural="sparkapplications", body=application_file, **kube_args, ) Locally, in Docker, when I have ~/.kube/config, it ..

Read more