2020-11-11 18:40:06 +01:00
|
|
|
package k8s
|
|
|
|
|
|
|
|
import "github.com/TwinProduction/gatus/core"
|
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// Config for Kubernetes auto-discovery
|
2020-11-11 18:40:06 +01:00
|
|
|
type Config struct {
|
2020-11-11 20:46:19 +01:00
|
|
|
// AutoDiscover to discover services to monitor
|
2020-11-11 18:40:06 +01:00
|
|
|
AutoDiscover bool `yaml:"auto-discover"`
|
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// ServiceTemplate Template for auto disocovered services
|
2020-11-11 18:40:06 +01:00
|
|
|
ServiceTemplate core.Service `yaml:"service-template"`
|
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// ExcludeSuffix Ignore services with this suffix
|
|
|
|
ExcludeSuffix []string `yaml:"isExcluded-suffix"`
|
2020-11-11 18:40:06 +01:00
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// ClusterMode to authenticate with kubernetes
|
2020-11-11 18:40:06 +01:00
|
|
|
ClusterMode string `yaml:"cluster-mode"`
|
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// Namespaces from which to discover services
|
|
|
|
Namespaces []NamespaceConfig `yaml:"namespaces"`
|
2020-11-11 18:40:06 +01:00
|
|
|
}
|
|
|
|
|
2020-11-11 20:46:19 +01:00
|
|
|
// NamespaceConfig level config
|
|
|
|
type NamespaceConfig struct {
|
|
|
|
// Name of namespace
|
2020-11-11 18:40:06 +01:00
|
|
|
Name string `yaml:"name"`
|
2020-11-11 20:46:19 +01:00
|
|
|
|
|
|
|
// ServiceSuffix to append to service name
|
2020-11-11 18:40:06 +01:00
|
|
|
ServiceSuffix string `yaml:"service-suffix"`
|
2020-11-11 20:46:19 +01:00
|
|
|
|
|
|
|
// HealthAPI URI to append to service to reach health check API
|
2020-11-11 18:40:06 +01:00
|
|
|
HealthAPI string `yaml:"health-api"`
|
|
|
|
}
|