koolbox

command module
v0.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

koolbox

This is a command line tool that helps to configure Kubernetes pods.

Quick start

Create a .koolbox file

output:
# Enable sending logs via forward protocol
- type: forward
  enabled: true
  filters:
  - ^CEF \d3\d
  config:
    address: 'localhost:5170'

# Enable sending logs via syslog protocol
- type: syslog
  enabled: true
  filters:
  - ^CEF \d3\d
  config:
    severity: debug
    tag: hello
    address: 'localhost:514'

tasks:
- action: nc
  config:
    addr: localhost:8080 # Templating allowed
    timeout: 60s
  on_error: skip
- action: nc
  config:
    addr: google.com:80 # Templating allowed
    timeout: 60s
- name: set_vars
  action: data
  config:
    src:
    - type: manual
      config:
        data:
          FIRSTNAME: John # Templating allowed
          LASTNAME: Doe # Templating allowed
    dst:
    - type: env
- name: set_fullname
  action: data
  config:
    src:
    - type: manual
      config:
        data:
          FULLNAME: "{{ .Tasks.set_vars.FIRSTNAME }} {{ .Tasks.set_vars.LASTNAME }}" # Templating allowed
    - type: env
      config:
        filters:
        - KUBERNETES_.*
    dst:
    - type: env
    - type: dotenv
      config:
        dst: /tmp/koolbox/.env # Templating allowed
        filters:
        - FULLNAME
        - LC_.*
- action: data
  config:
    src:
    - type: k8s
      config:
        from: configmap
        name: test # Templating allowed
    dst:
    - type: log
- name: Render template N1
  action: render
  config:
    src: /tmp/index.html.tpl # Templating allowed
    dst: /tmp/koolbox/index.html # Templating allowed
    create_dir: false
- name: Render template N2
  action: render
  config:
    src: /tmp/config.json.tpl # Templating allowed
    dst: /tmp/koolbox/config.json # Templating allowed
    create_dir: false
- action: download
  config:
    src: http://www.africau.edu/images/default/sample.pdf # Templating allowed
    dst: /tmp/koolbox/some.pdf # Templating allowed
- action: exec
  config:
    cmd: printenv
- action: exec
  config:
    cmd: echo
    args: ['Hello', '{{ .Tasks.set_fullname.FULLNAME }}'] # Templating allowed
- action: debug

Define templates

// index.html.tpl
<html>
    <body>
        <h1>{{ env "PAGE_TITLE" }}</h1>
        <p>{{ env "PAGE_TEXT" }}</p>
        <p>Hello, {{ env "FULLNAME" }}!</p>
        <p>DATA: {{ .Values.SomeKey }}</p>
    </body>
</html>
{{- $obj := dict "config" .Tasks.task_s -}}
{{- toJson $obj -}}

Run

koolbox run

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
run

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL