Esempio n. 1
0
    def define_options(self) -> Optional[Any]:
        """
        Declare the options for the Loki Stack builder.

        :return: The supported options
        """
        return {
            'basename': OptionDef(required=True, default_value='loki', allowed_types=[str]),
            'namespace': OptionDef(required=True, default_value='loki', allowed_types=[str]),
            'config': {
                'prometheus_annotation': OptionDef(required=True, default_value=False, allowed_types=[bool]),
                'loki_config': OptionDef(allowed_types=[str, ConfigFile]),
                'service_port': OptionDef(required=True, default_value=3100, allowed_types=[int]),
                'authorization': {
                    'serviceaccount_use': OptionDef(allowed_types=[str]),
                },
            },
            'container': {
                'loki': OptionDef(required=True, default_value='grafana/loki:2.0.0', allowed_types=[str]),
            },
            'kubernetes': {
                'volumes': {
                    'data': OptionDef(required=True, format=OptionDefFormat.KDATA_VOLUME,
                                      allowed_types=[Mapping, *KDataHelper_Volume.allowed_kdata()]),
                },
                'resources': {
                    'statefulset': OptionDef(allowed_types=[Mapping]),
                }
            },
        }
Esempio n. 2
0
    def define_options(self) -> Optional[Any]:
        """
        Declare the options for the EFK builder.

        :return: The supported options
        """
        return {
            'basename': OptionDef(required=True, default_value='efk', allowed_types=[str]),
            'namespace': OptionDef(required=True, default_value='default', allowed_types=[str]),
            'config': {
                'probes': OptionDef(required=True, default_value=False, allowed_types=[bool]),
                'elasticsearch': {
                    'replicas': OptionDef(required=True, default_value=3, allowed_types=[int]),
                },
                'kibana': {
                    'service_port': OptionDef(required=True, default_value=80, allowed_types=[int]),
                },
                'authorization': {
                    'serviceaccount_create': OptionDef(required=True, default_value=True, allowed_types=[bool]),
                    'serviceaccount_use': OptionDef(allowed_types=[str]),
                    'roles_create': OptionDef(required=True, default_value=True, allowed_types=[bool]),
                    'roles_bind': OptionDef(required=True, default_value=True, allowed_types=[bool]),
                },
            },
            'enable': {
                'kibana': OptionDef(required=True, default_value=True, allowed_types=[bool]),
            },
            'container': {
                'elasticsearch': OptionDef(required=True, default_value='docker.elastic.co/elasticsearch/elasticsearch:7.9.3', allowed_types=[str]),
                'kibana': OptionDef(required=True, default_value='docker.elastic.co/kibana/kibana:7.9.3', allowed_types=[str]),
                'fluentd': OptionDef(required=True, default_value='fluent/fluentd-kubernetes-daemonset:v1.11.4-debian-elasticsearch7-1.0', allowed_types=[str]),
            },
            'kubernetes': {
                'volumes': {
                    'elasticsearch-data': OptionDef(required=True, format=OptionDefFormat.KDATA_VOLUME,
                                                    allowed_types=[Mapping, *KDataHelper_Volume.allowed_kdata()]),
                },
                'resources': {
                    'elasticsearch-statefulset': OptionDef(allowed_types=[Mapping]),
                    'kibana-deployment': OptionDef(allowed_types=[Mapping]),
                    'fluentd-daemonset': OptionDef(allowed_types=[Mapping]),
                }
            },
        }
Esempio n. 3
0
 def define_options(self):
     return {
         'basename':
         OptionDef(required=True, default_value='bt', allowed_types=[str]),
         'namespace':
         OptionDef(required=True, default_value='btns',
                   allowed_types=[str]),
         'config': {
             'service_port':
             OptionDef(required=True,
                       default_value=3000,
                       allowed_types=[int]),
             'frontend_url':
             OptionDef(allowed_types=[str]),
             'password':
             OptionDef(format=OptionDefFormat.KDATA_ENV,
                       allowed_types=[str, KData_Secret, KData_ConfigMap]),
             'config_file':
             OptionDef(required=True),
         },
         'container': {
             'bt': OptionDef(required=True, default_value='bt/bt:7.2.0'),
         },
         'kubernetes': {
             'volumes': {
                 'data':
                 OptionDef(required=True,
                           format=OptionDefFormat.KDATA_VOLUME,
                           default_value={'emptyDir': {}},
                           allowed_types=[
                               Mapping, *KDataHelper_Volume.allowed_kdata()
                           ]),
             },
             'resources': {
                 'deployment': OptionDef(),
             }
         },
     }
Esempio n. 4
0
    def define_options(self):
        """
        Declare the options for the Prometheus builder.

        :return: The supported options
        """
        return {
            'basename':
            OptionDef(required=True,
                      default_value='prometheus',
                      allowed_types=[str]),
            'namespace':
            OptionDef(required=True,
                      default_value='prometheus',
                      allowed_types=[str]),
            'config': {
                'prometheus_config':
                OptionDef(required=True, allowed_types=[str, ConfigFile]),
                'service_port':
                OptionDef(required=True,
                          default_value=9090,
                          allowed_types=[int]),
                'authorization': {
                    'serviceaccount_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'serviceaccount_use':
                    OptionDef(allowed_types=[str]),
                    'roles_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'roles_bind':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                },
            },
            'container': {
                'init-chown-data':
                OptionDef(required=True,
                          default_value='debian:9',
                          allowed_types=[str]),
                'prometheus':
                OptionDef(required=True,
                          default_value='prom/prometheus:v2.21.0',
                          allowed_types=[str]),
            },
            'kubernetes': {
                'volumes': {
                    'data':
                    OptionDef(required=True,
                              format=OptionDefFormat.KDATA_VOLUME,
                              allowed_types=[
                                  Mapping, *KDataHelper_Volume.allowed_kdata()
                              ]),
                },
                'resources': {
                    'statefulset': OptionDef(allowed_types=[Mapping]),
                }
            },
        }
Esempio n. 5
0
    def define_options(self):
        """
        Declare the options for the RabbitMQ Online builder.

        :return: The supported options
        """
        return {
            'basename':
            OptionDef(required=True,
                      default_value='rabbitmq',
                      allowed_types=[str]),
            'namespace':
            OptionDef(required=True,
                      default_value='rabbitmq',
                      allowed_types=[str]),
            'config': {
                'github':
                OptionDef(required=True,
                          default_value='rabbitmq/diy-kubernetes-examples',
                          allowed_types=[str]),
                'github_commit':
                OptionDef(required=True,
                          default_value='master',
                          allowed_types=[str]),
                'enabled_plugins':
                OptionDef(default_value=['rabbitmq_peer_discovery_k8s'],
                          allowed_types=[Sequence]),
                'rabbitmq_conf':
                OptionDef(allowed_types=[str, ConfigFile]),
                'admin': {
                    'username':
                    OptionDef(
                        required=True,
                        default_value='admin',
                        format=OptionDefFormat.KDATA_ENV,
                        allowed_types=[str, *KDataHelper_Env.allowed_kdata()]),
                    'password':
                    OptionDef(required=True,
                              format=OptionDefFormat.KDATA_ENV,
                              allowed_types=[str, KData_Secret]),
                },
                'erlang_cookie':
                OptionDef(required=True,
                          default_value=str(uuid.uuid4()),
                          format=OptionDefFormat.KDATA_VOLUME,
                          allowed_types=[str, KData_Secret]),
                'loglevel':
                OptionDef(required=True,
                          default_value='info',
                          allowed_types=[str]),
                'enable_prometheus':
                OptionDef(required=True,
                          default_value=True,
                          allowed_types=[bool]),
                'prometheus_annotation':
                OptionDef(required=True,
                          default_value=False,
                          allowed_types=[bool]),
                'load_definitions':
                OptionDef(format=OptionDefFormat.KDATA_VOLUME,
                          allowed_types=[str, KData_Secret]),
                'servicetype':
                OptionDef(required=True,
                          default_value='LoadBalancer',
                          allowed_types=[str]),
                'authorization': {
                    'serviceaccount_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'serviceaccount_use':
                    OptionDef(allowed_types=[str]),
                    'roles_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'roles_bind':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                },
            },
            'container': {
                'busybox': OptionDef(allowed_types=[str]),
                'rabbitmq': OptionDef(allowed_types=[str]),
            },
            'kubernetes': {
                'volumes': {
                    'data':
                    OptionDef(required=True,
                              format=OptionDefFormat.KDATA_VOLUME,
                              allowed_types=[
                                  Mapping,
                                  KDataHelper_Volume.allowed_kdata()
                              ]),
                },
                'resources': {
                    'statefulset': OptionDef(allowed_types=[Mapping]),
                }
            },
        }
Esempio n. 6
0
    def define_options(self) -> Optional[Any]:
        """
        Declare the options for the RabbitMQ builder.

        :return: The supported options
        """
        return {
            'basename':
            OptionDef(required=True,
                      default_value='rabbitmq',
                      allowed_types=[str]),
            'namespace':
            OptionDef(required=True,
                      default_value='rabbitmq',
                      allowed_types=[str]),
            'config': {
                'enabled_plugins':
                OptionDef(default_value=['rabbitmq_peer_discovery_k8s'],
                          allowed_types=[Sequence]),
                'rabbitmq_conf':
                OptionDef(allowed_types=[str, ConfigFile]),
                'erlang_cookie':
                OptionDef(required=True,
                          default_value=str(uuid.uuid4()),
                          format=OptionDefFormat.KDATA_VOLUME,
                          allowed_types=[str, dict, KData_Secret]),
                'loglevel':
                OptionDef(required=True,
                          default_value='info',
                          allowed_types=[str]),
                'enable_prometheus':
                OptionDef(required=True,
                          default_value=True,
                          allowed_types=[bool]),
                'prometheus_annotation':
                OptionDef(required=True,
                          default_value=False,
                          allowed_types=[bool]),
                'load_definitions':
                OptionDef(format=OptionDefFormat.KDATA_VOLUME,
                          allowed_types=[str, KData_Secret]),
                'authorization': {
                    'serviceaccount_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'serviceaccount_use':
                    OptionDef(allowed_types=[str]),
                    'roles_create':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                    'roles_bind':
                    OptionDef(required=True,
                              default_value=True,
                              allowed_types=[bool]),
                },
            },
            'container': {
                'busybox':
                OptionDef(required=True,
                          default_value='busybox:1.32.0',
                          allowed_types=[str]),
                'rabbitmq':
                OptionDef(required=True,
                          default_value='rabbitmq:3.8.9-alpine',
                          allowed_types=[str]),
            },
            'kubernetes': {
                'volumes': {
                    'data':
                    OptionDef(required=True,
                              format=OptionDefFormat.KDATA_VOLUME,
                              allowed_types=[
                                  dict, *KDataHelper_Volume.allowed_kdata()
                              ]),
                },
                'resources': {
                    'statefulset': OptionDef(allowed_types=[dict]),
                }
            },
        }