added k8s stub adapter for execution environment

This commit is contained in:
Elmar Kresse
2024-09-18 10:43:38 +02:00
parent f9a6ba8f1c
commit 12ff205bd2
119 changed files with 1374 additions and 12549 deletions

View File

@ -13,6 +13,7 @@ import (
"github.com/openHPI/poseidon/pkg/logging"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v3"
"k8s.io/client-go/rest"
"net/url"
"os"
"reflect"
@ -66,6 +67,17 @@ var (
DNS: nil,
},
},
Kubernetes: Kubernetes{
Enabled: false,
KubeConfig: rest.Config{
Host: "",
TLSClientConfig: rest.TLSClientConfig{
Insecure: false,
ServerName: "",
},
BearerToken: "",
},
},
AWS: AWS{
Enabled: false,
Endpoint: "",
@ -134,6 +146,11 @@ type Nomad struct {
Network nomadApi.NetworkResource
}
type Kubernetes struct {
Enabled bool
KubeConfig rest.Config
}
// URL returns the URL for the configured Nomad cluster.
func (n *Nomad) URL() *url.URL {
return parseURL(n.Address, n.Port, n.TLS.Active)
@ -179,13 +196,14 @@ type InfluxDB struct {
// configuration contains the complete configuration of Poseidon.
type configuration struct {
Server server
Nomad Nomad
AWS AWS
Logger Logger
Profiling Profiling
Sentry sentry.ClientOptions
InfluxDB InfluxDB
Server server
Nomad Nomad
Kubernetes Kubernetes
AWS AWS
Logger Logger
Profiling Profiling
Sentry sentry.ClientOptions
InfluxDB InfluxDB
}
// InitConfig merges configuration options from environment variables and