kapicorp/kapitan-reference

Allow generators to create DaemonSets

Moep90 opened this issue · 1 comments

Statefulset

parameters:
  filebeat:
    image: docker.elastic.co/beats/filebeat
    version: "1.9"
    component: go

  # Component/s
  components:
    filebeat:
      name: filebeat
      type: statefulset

Success

$ ./kapitan compile -t filebeat
Compiled filebeat (0.66s)

Daemonset

parameters:
  filebeat:
    image: docker.elastic.co/beats/filebeat
    version: "1.9"
    component: go

  # Component/s
  components:
    filebeat:
      name: filebeat
      type: daemonset

Failure

$ ./kapitan compile -t filebeat
Unknown (Non-Kapitan) Error occurred
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/opt/venv/lib/python3.7/site-packages/kapitan/targets.py", line 466, in compile_target
    input_compiler.compile_obj(comp_obj, ext_vars, **kwargs)
  File "/opt/venv/lib/python3.7/site-packages/kapitan/inputs/base.py", line 55, in compile_obj
    self.compile_input_path(input_path, comp_obj, ext_vars, **kwargs)
  File "/opt/venv/lib/python3.7/site-packages/kapitan/inputs/base.py", line 77, in compile_input_path
    **kwargs,
  File "/opt/venv/lib/python3.7/site-packages/kapitan/inputs/kadet.py", line 120, in compile_file
    output_obj = kadet_module.main(input_params).to_dict()
  File "/src/components/generators/kubernetes/__init__.py", line 908, in main
    return globals()[function](input_params)
  File "/src/components/generators/kubernetes/__init__.py", line 826, in generate_manifests
    workload = Workload(name=name, component=component)
  File "/opt/venv/lib/python3.7/site-packages/kapitan/inputs/kadet.py", line 188, in __init__
    self.body()
  File "/src/components/generators/kubernetes/__init__.py", line 508, in body
    raise ()
TypeError: exceptions must derive from BaseException
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/venv/lib/python3.7/site-packages/kapitan/targets.py", line 136, in compile_targets
    [p.get() for p in pool.imap_unordered(worker, target_objs) if p]
  File "/opt/venv/lib/python3.7/site-packages/kapitan/targets.py", line 136, in <listcomp>
    [p.get() for p in pool.imap_unordered(worker, target_objs) if p]
  File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 748, in next
    raise value
TypeError: exceptions must derive from BaseException


exceptions must derive from BaseException

fixed by #86