Skip to main content

A dead simple Kubernetes Resources installer

Project description

Kubeler

Simple Kubernetes Resources installer

Dependencies

  • Python >= 3.12

Installation

pip install kubeler

Usage

kubeler install --installer=./examples/installer.yaml

Configuration

You can use your existing K8s manifest files. For a simple setup, just add cmd: [kubectl/helm command] to your manifest file. For example, you can take a look at some examples in the examples directory.

#cmd: kubectl apply -f namespace.yaml
---
kind: Namespace
apiVersion: v1
metadata:
  name: staging
  labels:
    name: staging
---

Then, create an installer YAML file to define your K8s resources. For example:

init:
  cmd: 
    - apt update -y
    - apt upgrade

group:
  name: k8s
  steps:
    - name: cluster
      dir: ./cluster
    - name: cert-manager
      dir: ./cert

Please note that when you create installer.yml, Kubeler will execute commands in order. So, make sure to place dependent resources before any resources that rely on them.

If you have multiple files inside a directory and want to define the execution order, you can list your files in the desired sequence.

...
- name: argocd
    dir: ./tools/argocd
    files:
        - manifest.yaml
        - ingress.yaml

You can also use variables to dynamically insert values into your manifest file.

...
spec:
  ingressClassName: {{ ingress_class }}
  rules:
    - host: {{ host_url }}
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service: 
                name: argocd-server
                port: 
                  name: https

Then, define the variables in installer.yaml.

- name: argocd
    dir: ./tools/argocd
    files:
        - manifest.yaml
        - ingress.yaml
    vars:
        - name: ingress_class
          value: nginx
        - name: host_url
          value: argocd.example.com

You can also reference variables from a previous step using ref..

- name: redis
    dir: ./tools/redis
    vars:
        - name: password
          value: Password01

- name: harbor
    dir: ./tools/harbor
    vars:
        - name: redis_password  
          value: ref.redis.vars.password

You can also reference variables from environment variables using env.. In addition, using .env file defined in the same directory with installer.yaml also works for this case.

- name: harbor
    dir: ./tools/harbor
    vars:
        - name: redis_password  
          value: env.REDIS_PASSWORD

Attributes

  • name: Name of the step.
  • dir: Directory where the manifest files reside.
  • files: List of files in the directory that will be executed in order.
  • vars: Variables for dynamic values inside the manifest file.

Options

There are some options available with installing Kubernetes Resources using Kubeler.

Exclude Steps

Use attributes exclude=yes or argument --excludes if you want to skip some steps from execution

steps:
  - name: cluster
    dir: ./cluster
    exclude: yes

or

--installer=./../examples/installer.yaml --excludes=argocd,redis

Define starting point

Use argument --start-from if you want to execute steps from a certain point

--installer=./../examples/installer.yaml --start-from=argocd

Execute only some steps

Use argument --steps if you want to only execute some steps and exclude the other

--installer=./../examples/installer.yaml --steps=argocd,redis

Watching for file changes

Use the --watch argument to monitor a directory and automatically apply changes when they occur.

Update installer.yaml to set watch attribute

group:
  name: k8s
  watch:
    enabled: true
    dir: 
      - ./applications
      - ./cluster

and then, run

kubeler install --installer=./examples/installer.yaml --watch=true

Project details


Download files

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

Source Distribution

kubeler-0.1.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubeler-0.1.4-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file kubeler-0.1.4.tar.gz.

File metadata

  • Download URL: kubeler-0.1.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for kubeler-0.1.4.tar.gz
Algorithm Hash digest
SHA256 30ab6aa9aca8efa2bdeead325ab415bccc6941cc43ad6969fae6f98391a4be68
MD5 d9f8ecf1c9a63f8fd303fda159f99411
BLAKE2b-256 c5962dccc5d28aa6c5502369df8aa31c3e718e1e9dc8003830266ce6c63769b0

See more details on using hashes here.

File details

Details for the file kubeler-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: kubeler-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for kubeler-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 595583550f08d748f4f05c071043feaaeab010933924633326a36d54933d9c6d
MD5 29a74c5e2ab193a53b436675d59fa71f
BLAKE2b-256 c0b70f2485b831d326ec8b8d35c58919283eadd376b6a4d71dd85044b0de976f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page