package config

type Observability struct {
	ChartRef      string        `yaml:"chart_ref" env-default:"kube-forge/observability"`
	ChartVersion  string        `yaml:"chart_version" env-default:"0.1.0"`
	Enabled       bool          `yaml:"enabled"`
	Logging       Logging       `yaml:"logging"`
	Tracing       Tracing       `yaml:"tracing"`
	Monitoring    Monitoring    `yaml:"monitoring"`
	Visualization Visualization `yaml:"visualization"`
}

type Logging struct {
	Enabled  bool `yaml:"enabled"`
	Operator struct {
		ChartRef      string `yaml:"chart_ref" env-default:"kube-forge/fluent-operator"`
		ChartVersion  string `yaml:"chart_version" env-default:"2.7.0"`
		Image         string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/kubesphere/fluent-operator"`
		Tag           string `yaml:"tag" env-default:"v2.7.0"`
		InitContainer struct {
			Image string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/docker"`
			Tag   string `yaml:"tag" env-default:"20.10"`
		} `yaml:"initcontainer"`
	} `yaml:"operator"`
	Fluentd struct {
		Image string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/kubesphere/fluentd"`
		Tag   string `yaml:"tag" env-default:"v1.15.3"`
	} `yaml:"fluentd"`
	FluentBit struct {
		Image string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/kubesphere/fluent-bit"`
		Tag   string `yaml:"tag" env-default:"v2.2.2"`
	} `yaml:"fluent_bit"`
	Loki struct {
		ChartRef     string `yaml:"chart_ref" env-default:"kube-forge/loki"`
		ChartVersion string `yaml:"chart_version" env-default:"5.47.2"`
		Registry     string `yaml:"registry" env-default:"harbor.kvazaric.ru"`
		Image        string `yaml:"image" env-default:"kube-forge/grafana/loki"`
		Tag          string `yaml:"tag" env-default:"latest"`
		Persistence  struct {
			StorageClass string `yaml:"storage_class" env-default:"local-path"`
			StorageSize  string `yaml:"storage_size" env-default:"10Gi"`
			Retention    string `yaml:"retention" env-default:"168h"`
		} `yaml:"persistence"`
		AlertManagerUrl       string `yaml:"alert_manager_u	rl" env-default:"http://observability-alert-manager:9093"`
		AdditionalRulesGroups string `yaml:"additional_rules_groups" env-default:""`
	} `yaml:"loki"`
	Events struct {
		Enabled  bool `yaml:"enabled"`
		Exporter struct {
			Image string `yaml:"image" env-default:"ghcr.io/resmoio/kubernetes-event-exporter"`
			Tag   string `yaml:"tag" env-default:"v1.4"`
		} `yaml:"exporter"`
		Cron struct {
			Image    string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/bitnami/kubectl"`
			Tag      string `yaml:"tag" env-default:"1.27.5-debian-11-r8"`
			Schedule string `yaml:"schedule" env-default:"*/2 * * * *"`
		} `yaml:"cron"`
	} `yaml:"events"`
}

type Tracing struct {
	Enabled  bool `yaml:"enabled"`
	Operator struct {
		ChartRef     string `yaml:"chart_ref" env-default:"kube-forge/opentelemetry-operator"`
		ChartVersion string `yaml:"chart_version" env-default:"0.55.0"`
		Image        string `yaml:"image" env-default:"ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator"`
		Tag          string `yaml:"tag" env-default:""`
	} `yaml:"operator"`
	Collector struct {
		Image string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/otel/opentelemetry-collector-contrib"`
		Tag   string `yaml:"tag" env-default:"0.95.0"`
	} `yaml:"collector"`
	Tempo struct {
		ChartRef     string `yaml:"chart_ref" env-default:"kube-forge/tempo"`
		ChartVersion string `yaml:"chart_version" env-default:"1.7.2"`
		Image        string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/grafana/tempo"`
		Tag          string `yaml:"tag" env-default:"2.3.1"`
		Retention    string `yaml:"retention" env-default:"24h"`
		ListenPort   int    `yaml:"listen_port" env-default:"3100"`
		Persistence  struct {
			StorageClass string `yaml:"storage_class" env-default:"local-path"`
			StorageSize  string `yaml:"storage_size" env-default:"10Gi"`
		} `yaml:"persistence"`
		TempoQuery struct {
			Image      string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/grafana/tempo-query"`
			Tag        string `yaml:"tag" env-default:"2.3.1"`
			ListenPort int    `yaml:"listen_port" env-default:"16686"`
		} `yaml:"tempo_query"`
	} `yaml:"tempo"`
}

type Monitoring struct {
	Enabled    bool `yaml:"enabled"`
	Prometheus struct {
		Image          string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/prom/prometheus"`
		Tag            string `yaml:"tag" env-default:"v2.45.0"`
		ScrapeInterval string `yaml:"scrape_interval" env-default:"15s"`
		Persistence    struct {
			StorageClass string `yaml:"storage_class" env-default:"local-path"`
			StorageSize  string `yaml:"storage_size" env-default:"3Gi"`
			Retention    string `yaml:"retention" env-default:"7d"`
		} `yaml:"persistence"`
		Operator struct {
			Image          string `yaml:"image" env-default:"ghcr.io/prometheus-operator/prometheus-operator"`
			Tag            string `yaml:"tag" env-default:"v0.65.2"`
			ConfigReloader struct {
				Image string `yaml:"image" env-default:"ghcr.io/prometheus-operator/prometheus-config-reloader"`
				Tag   string `yaml:"tag" env-default:"v0.65.2"`
			} `yaml:"config_reloader"`
			KubeRbacProxy struct {
				Image string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/bitnami/kube-rbac-proxy"`
				Tag   string `yaml:"tag" env-default:"0.14.1"`
			} `yaml:"kube_rbac_proxy"`
		} `yaml:"operator"`
	} `yaml:"prometheus"`
	AlertManager struct {
		Enabled                    bool        `yaml:"enabled"`
		Image                      string      `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/prom/alertmanager"`
		Tag                        string      `yaml:"tag" env-default:"v0.26.0"`
		AdditionalMessageTemplates interface{} `yaml:"additionalMessageTemplates"`
		Route                      interface{} `yaml:"route"`
		Receivers                  interface{} `yaml:"receivers"`
	} `yaml:"alert_manager"`
	Blackbox struct {
		Enabled           bool   `yaml:"enabled"`
		Image             string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/prom/blackbox-exporter"`
		Tag               string `yaml:"tag" env-default:"v0.24.0"`
		AdditionalModules string `yaml:"routes" env-default:""`
	} `yaml:"blackbox"`
	KubeState struct {
		Enabled bool   `yaml:"enabled"`
		Image   string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/bitnami/kube-state-metrics"`
		Tag     string `yaml:"tag" env-default:"2.9.2"`
	} `yaml:"kube_state"`
	Node struct {
		Enabled bool   `yaml:"enabled"`
		Image   string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/prom/node-exporter"`
		Tag     string `yaml:"tag" env-default:"v1.5.0"`
	} `yaml:"node"`
	MetricsServer struct {
		ChartRef     string `yaml:"chart_ref" env-default:"kube-forge/metrics-server"`
		ChartVersion string `yaml:"chart_version" env-default:"3.12.1"`
		Image        string `yaml:"image" env-default:"registry.k8s.io/metrics-server/metrics-server"`
		Tag          string `yaml:"tag" env-default:""`
	}
}

type Visualization struct {
	Enabled bool `yaml:"enabled"`
	Grafana struct {
		Enabled bool   `yaml:"enabled"`
		Image   string `yaml:"image" env-default:"harbor.kvazaric.ru/kube-forge/grafana"`
		Tag     string `yaml:"tag" env-default:"10.4.1-v2"`
		Expose  struct {
			Type         string `yaml:"type" env-default:"ingress"`
			Domain       string `yaml:"domain" env-default:""`
			Path         string `yaml:"path" env-default:"/"`
			NodePortHttp int    `yaml:"node_port_http" env-default:"30007"`
			Tls          struct {
				Enabled bool `yaml:"enabled"`
			}
		} `yaml:"expose"`
		Persistence struct {
			StorageClass string `yaml:"storage_class" env-default:"local-path"`
			StorageSize  string `yaml:"storage_size" env-default:"2Gi"`
		} `yaml:"persistence"`
		Config struct {
			Auth                  string      `yaml:"auth" env-default:""`
			AuthGenericAuth       string      `yaml:"auth_generic_auth" env-default:""`
			AdditionalDatasources interface{} `yaml:"additional_datasources"`
		} `yaml:"config"`
	} `yaml:"grafana"`
}
