django_kubernetes_manager package — Django Kubernetes Manager 0.1.0 documentation

# django_kubernetes_manager package

## Subpackages

- django_kubernetes_manager.migrations package
  - Submodules
  - django_kubernetes_manager.migrations.0001_initial module
  - Module contents
- django_kubernetes_manager.models package
  - Submodules
  - django_kubernetes_manager.models.base module
  - django_kubernetes_manager.models.target_cluster module
  - Module contents

## Submodules

## django_kubernetes_manager.admin module

## django_kubernetes_manager.serializers module

class `django_kubernetes_manager.serializers.` `KubernetesBaseSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `rest_framework.serializers.HyperlinkedModelSerializer`

  class `Meta`

    Bases: `object`

    `abstract` = True
    `fields` = ['title', 'description', 'cluster', 'config']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesBase`

class `django_kubernetes_manager.serializers.` `KubernetesContainerSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'image_name', 'image_tag', 'image_pull_policy', 'command', 'args', 'port', 'volume_mount']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesContainer`

class `django_kubernetes_manager.serializers.` `KubernetesDeploymentSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesNetworkingBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'port', 'namespace', 'kuid', 'selector', 'replicas', 'pod_template']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesDeployment`

class `django_kubernetes_manager.serializers.` `KubernetesIngressSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesNetworkingBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'port', 'namespace', 'kuid', 'hostname', 'path', 'target_service']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesIngress`

class `django_kubernetes_manager.serializers.` `KubernetesJobSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesNetworkingBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'port', 'namespace', 'kuid', 'backoff_limit', 'pod_template']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesJob`

class `django_kubernetes_manager.serializers.` `KubernetesMetadataObjBaseSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesBaseSerializer`

  class `Meta`

    Bases: `object`

    `abstract` = True
    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesMetadataObjBase`

class `django_kubernetes_manager.serializers.` `KubernetesNamespaceSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesMetadataObjBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'exists']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesNamespace`

class `django_kubernetes_manager.serializers.` `KubernetesNetworkingBaseSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesMetadataObjBaseSerializer`

  class `Meta`

    Bases: `object`

    `abstract` = True
    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'port', 'namespace', 'kuid']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesNetworkingBase`

class `django_kubernetes_manager.serializers.` `KubernetesPodTemplateSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesMetadataObjBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'volume', 'primary_container', 'secondary_container', 'restart_policy']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesPodTemplate`

class `django_kubernetes_manager.serializers.` `KubernetesServiceSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `django_kubernetes_manager.serializers.KubernetesNetworkingBaseSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'description', 'cluster', 'config', 'labels', 'annotations', 'api_version', 'kind', 'port', 'namespace', 'kuid', 'selector', 'target_port']
    `model`

      alias of `django_kubernetes_manager.models.base.KubernetesService`

class `django_kubernetes_manager.serializers.` `TargetClusterSerializer`(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)

  Bases: `rest_framework.serializers.HyperlinkedModelSerializer`

  class `Meta`

    Bases: `object`

    `fields` = ['title', 'api_endpoint', 'telemetry_endpoint', 'config']
    `model`

      alias of `django_kubernetes_manager.models.target_cluster.TargetCluster`

## django_kubernetes_manager.urls module

## django_kubernetes_manager.utils module

`django_kubernetes_manager.utils.` `coalesce_dicts`(target={}, source={})

`django_kubernetes_manager.utils.` `find_namespaced_pods`(namespace, job_name, api_client)

  find pod by namespace and job name

  Args:

    namespace (str) - job_name (str) - api_client (CoreV1Api) -

  Returns:

    str - Name of the pod if found

`django_kubernetes_manager.utils.` `generate_kubeconfig`(context, cluster, user, default_name='k8s-job-runner')

  Format helper for generating individual cluster kubeconfigs

  Args:

    context (dict) - cluster (dict) - user (dict) -

  Returns:

    dict -

`django_kubernetes_manager.utils.` `get_command_output`(cmd)

  retrieve command output for a given command provided

`django_kubernetes_manager.utils.` `get_dict_hash`(data)

`django_kubernetes_manager.utils.` `run_command`(cmd, log_method=<bound method Logger.info of <Logger django_kubernetes_manager.utils (WARNING)>>)

  Subprocess wrapper for capturing output of processes to logs

`django_kubernetes_manager.utils.` `split_kubeconfig`(kubeconfig)

  Helper method to split a kubeconfig into separate, per-cluster configurations

  Args:

    kubeconfig (dict or str) -

  Returns:

    list(dict)

## django_kubernetes_manager.views module

class `django_kubernetes_manager.views.` `KubernetesContainerViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows containers to be edited or deleted.

  `basename` = None
  `description` = None
  `detail` = None
  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet [<KubernetesContainer: KubernetesContainer object (a9df17e5-b520-4ce9-b5a4-d822c462ab6a)>]>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesContainerSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesDeploymentViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows deployments to be edited or deleted.

  `basename` = None
  `deploy`(request, *args, **kwargs)

    Action to deploy the kubernetes resource to target cluster.

  `description` = None
  `detail` = None
  `k_delete`(request, *args, **kwargs)

    Action to delete the kubernetes resource from the cluster/namespaces

  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `pod_usage`(request, *args, **kwargs)

    Action to fetch point-in-time cpu and memory usage of pod.

  `queryset` = <QuerySet [<KubernetesDeployment: KubernetesDeployment object (e8193aba-2944-4451-96d5-7390e11c06fb)>]>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesDeploymentSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesIngressViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows ingress to be edited or deleted.

  `basename` = None
  `deploy`(request, *args, **kwargs)

    Action to deploy the kubernetes resource to target cluster.

  `description` = None
  `detail` = None
  `k_delete`(request, *args, **kwargs)

    Action to delete the kubernetes resource from the cluster/namespace.

  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet []>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesIngressSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesJobViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows jobs to be edited or deleted.

  `basename` = None
  `deploy`(request, *args, **kwargs)

    Action to deploy the kubernetes resource to target cluster.

  `description` = None
  `detail` = None
  `k_delete`(request, *args, **kwargs)

    Action to delete the kubernetes resource from the target cluster/ns.

  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `pod_usage`(request, *args, **kwargs)

    Action to fetch point-in-time cpu and memory usage of pod.

  `queryset` = <QuerySet []>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesJobSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesNamespaceViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows namespaces to be created or deleted

  `basename` = None
  `deploy`(request, *args, **kwargs)

    Action to deploy the namespace resource to target cluster.

  `description` = None
  `detail` = None
  `k_delete`(request, *args, **kwargs)

    Action to delete the kubernetes namespace from the cluster.

  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet []>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesNamespaceSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesPodTemplateViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows pod templates to be edited or deleted.

  `basename` = None
  `description` = None
  `detail` = None
  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet [<KubernetesPodTemplate: KubernetesPodTemplate object (b4424410-ba70-4856-9c14-59d73b2847d5)>]>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesPodTemplateSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `KubernetesServiceViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows services to be edited or deleted.

  `basename` = None
  `deploy`(request, *args, **kwargs)

    Action to deploy the kubernetes resource to target cluster.

  `description` = None
  `detail` = None
  `k_delete`(request, *args, **kwargs)

    Action to delete the kubernetes resource from the cluster/namespace.

  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet []>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.KubernetesServiceSerializer`

  `suffix` = None

class `django_kubernetes_manager.views.` `TargetClusterViewSet`(**kwargs)

  Bases: `rest_framework.viewsets.ModelViewSet`

  API endpoint that allows cluster configs to be edited or deleted

  `basename` = None
  `description` = None
  `detail` = None
  `name` = None
  `permission_classes` = [<class 'rest_framework.permissions.IsAuthenticated'>]
  `queryset` = <QuerySet [<TargetCluster: TargetCluster object (6)>, <TargetCluster: TargetCluster object (7)>, <TargetCluster: TargetCluster object (8)>, <TargetCluster: TargetCluster object (9)>]>
  `serializer_class`

    alias of `django_kubernetes_manager.serializers.TargetClusterSerializer`

  `suffix` = None

## Module contents