Skip to main content

Wrapper around kubernetes-clients/python

Project description

Build Status Code style: black Type checker: mypy Packaging: poetry


A small wrapper around which understands Kubernetes charts.


I needed something simple that would read Helm charts and push them to the Kubernetes cluster and be extensible. So something like helm+kubectl with ability to write you own tools around them.

Supported CRDS aka Kubernetes resources

  • Deployment
  • Service
  • Ingress
  • Secret
  • Issuer (cert-manager)
  • PersistentVolumeClaim

Example use

import yaml
from tulips import class_for_resource
from kubernetes import client as k8s
from kubernetes import config

client = config.new_client_from_config('kube.conf')

spec = yaml.load('ingress.yaml')

ingress_cls = class_for_resource(spec['kind'])
ingress = ingress_cls(config.client, namespace='default', spec)
ingress.create()  # Create Ingress resource
ingress.delete()  # Delete Ingress resource


Tulip is a sample client that emulates Helm but without tiller.

$ python tulips push --help                                    06/25/18 -  9:49
Usage: tulips push [OPTIONS] CHART

  You can pass chart variables via foo=bar, for example '$ tulip push
  app.yaml foo=bar'

  --namespace TEXT   Kubernetes namespace
  --release TEXT     Name of the release
  --kubeconfig PATH  Path to kubernetes config
  --help             Show this message and exit.


Let's say that I want to deploy a Secret and Ingress

apiVersion: v1
kind: Secret
  name: <%=release=%>-secrets
type: Opaque
  password: <%=@pwd=%>
apiVersion: extensions/v1beta1
kind: Ingress
  name: <%=release=%>-web-ingress
    app: woocart-<%=release=%>
  annotations: "100" nginx
  - host: <%=domain=%>
        - path: /
            serviceName: <%=release=%>-web
            servicePort: 80

If one runs `tulip --release test push --kubeconf kube.conf app.yaml domain=test.tld'

Spec file is inspected and all <%=variables=%> are replaced with real values. Also special <%=@pwd=%> will generate strong password using passlib library.


  • [ ] Custom container for yaml(eliminates class_for_kind function)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tulips, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size tulips-0.1.4-py3-none-any.whl (13.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size tulips-0.1.4.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page