Skip to main content

j2skaffold

A simple skaffold wrapper with support for jinja2 templating.

Status

https://secure.travis-ci.org/jkozera/j2skaffold.png?branch=master https://coveralls.io/repos/jkozera/j2skaffold/badge.png?branch=master https://img.shields.io/pypi/v/j2skaffold.svg Documentation Status

Requirements

  • Python 2.7 or Python 3.3+ or PyPy 2.4.0+

Setup

$ python -m pip install --user j2skaffold
or
(venv)$ python -m pip install j2skaffold

Usage

$ j2skaffold dev

will run skaffold dev after rendering the skaffold.jinja2 file from the current directory.

$ j2skaffold dev --keep-yaml

will do the same, keeping the rendered skaffold.yaml file. (Useful for debugging.)

The following special variables are available:

  • skaffold_command (dev, build, etc.)

  • current_profile (value of the -p argument)

The following special yaml key can be used:

  • _set_profile: [name] - sets the current profile using the -p argument. Should be always wrapped inside some {% if not current_profile %}, otherwise it will get passed through, and skaffold will fail with:

FATA[0000] creating runner: reading configuration: parsing skaffold config: parsing skaffold config: yaml: unmarshal errors:
line 2: field _set_profile not found in type v1alpha3.SkaffoldConfig

Example skaffold.jinja2 demonstrating all the available features:

{% if skaffold_command == 'dev' and not current_profile %}
_set_profile: dev
{% endif %}
apiVersion: skaffold/v1alpha3
kind: Config
build:
  artifacts:
  - imageName: gcr.io/k8s-skaffold/skaffold-example-{{ current_profile }}
deploy:
  kubectl:
    manifests:
      - k8s-*
profiles:
{% for profile in ['dev', 'production'] %}
  - name: {{ profile }}
    # ... use any jinja2 syntax
{% endfor %}

ChangeLog

0.1.0 (2018-10-08)

  • Initial release.

Metadata

Release files for j2skaffold 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for j2skaffold 0.1.0
File Size Uploaded
j2skaffold-0.1.0.tar.gz 11.4 kB Details

Release files / j2skaffold-0.1.0.tar.gz

Download URL j2skaffold-0.1.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7f091a4a01ee3f6df150afa1ec244562b4b2a75c17615bf7e2edc302895c9efb
BLAKE2b-256 checksum
How to use checksums
1b2c1a52af0607be99872ed3b142998d6ceaf902cb3bfa4735ff5baa3e131c58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page