diff --git a/manifests/base/deployment.yaml b/manifests/base/api/deployment.yaml similarity index 100% rename from manifests/base/deployment.yaml rename to manifests/base/api/deployment.yaml diff --git a/manifests/base/api/kustomization.yaml b/manifests/base/api/kustomization.yaml new file mode 100644 index 0000000..8684cdb --- /dev/null +++ b/manifests/base/api/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - service-account.yaml + - secret.yaml + - role.yaml + - rolebinding.yaml + - service.yaml + - deployment.yaml diff --git a/manifests/base/role.yaml b/manifests/base/api/role.yaml similarity index 100% rename from manifests/base/role.yaml rename to manifests/base/api/role.yaml diff --git a/manifests/base/rolebinding.yaml b/manifests/base/api/rolebinding.yaml similarity index 100% rename from manifests/base/rolebinding.yaml rename to manifests/base/api/rolebinding.yaml diff --git a/manifests/base/secret.yaml b/manifests/base/api/secret.yaml similarity index 100% rename from manifests/base/secret.yaml rename to manifests/base/api/secret.yaml diff --git a/manifests/base/service-account.yaml b/manifests/base/api/service-account.yaml similarity index 100% rename from manifests/base/service-account.yaml rename to manifests/base/api/service-account.yaml diff --git a/manifests/base/service.yaml b/manifests/base/api/service.yaml similarity index 100% rename from manifests/base/service.yaml rename to manifests/base/api/service.yaml diff --git a/manifests/base/executionspace/deployment.yaml b/manifests/base/executionspace/deployment.yaml index 839abe5..55b1397 100644 --- a/manifests/base/executionspace/deployment.yaml +++ b/manifests/base/executionspace/deployment.yaml @@ -34,9 +34,9 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /executionspace/v1alpha/selftest/ping port: http readinessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /executionspace/v1alpha/selftest/ping port: http diff --git a/manifests/base/ingress.yaml b/manifests/base/ingress.yaml new file mode 100644 index 0000000..a50f3b8 --- /dev/null +++ b/manifests/base/ingress.yaml @@ -0,0 +1,47 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: etos + labels: + app.kubernetes.io/name: etos + app.kubernetes.io/part-of: etos + app.kubernetes.io/component: etos-api +spec: + rules: + - http: + paths: + - path: /api + pathType: Prefix + backend: + service: + name: etos-api + port: + number: 80 + - path: /sse + pathType: Prefix + backend: + service: + name: etos-sse + port: + number: 80 + - path: /logarea + pathType: Prefix + backend: + service: + name: etos-logarea + port: + number: 80 + - path: /iut + pathType: Prefix + backend: + service: + name: etos-iut + port: + number: 80 + - path: /executionspace + pathType: Prefix + backend: + service: + name: etos-executionspace + port: + number: 80 diff --git a/manifests/base/iut/deployment.yaml b/manifests/base/iut/deployment.yaml index d002194..ef7c787 100644 --- a/manifests/base/iut/deployment.yaml +++ b/manifests/base/iut/deployment.yaml @@ -31,9 +31,9 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /v1alpha1/selftest/ping + path: /iut/v1alpha1/selftest/ping port: http readinessProbe: httpGet: - path: /v1alpha1/selftest/ping + path: /iut/v1alpha1/selftest/ping port: http diff --git a/manifests/base/kustomization.yaml b/manifests/base/kustomization.yaml index c598bec..2a9eb71 100644 --- a/manifests/base/kustomization.yaml +++ b/manifests/base/kustomization.yaml @@ -1,16 +1,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - service-account.yaml - - secret.yaml - - role.yaml - - rolebinding.yaml - - service.yaml - - deployment.yaml + - ./api - ./sse - ./logarea - ./iut - ./executionspace + - ./ingress.yaml # By generating the configmap it will get a unique name on each apply diff --git a/manifests/base/logarea/deployment.yaml b/manifests/base/logarea/deployment.yaml index 12d6383..a303774 100644 --- a/manifests/base/logarea/deployment.yaml +++ b/manifests/base/logarea/deployment.yaml @@ -31,9 +31,9 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /logarea/v1alpha/selftest/ping port: http readinessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /logarea/v1alpha/selftest/ping port: http diff --git a/manifests/base/sse/deployment.yaml b/manifests/base/sse/deployment.yaml index aa35020..3b1c709 100644 --- a/manifests/base/sse/deployment.yaml +++ b/manifests/base/sse/deployment.yaml @@ -31,9 +31,9 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /sse/v1alpha/selftest/ping port: http readinessProbe: httpGet: - path: /v1alpha/selftest/ping + path: /sse/v1alpha/selftest/ping port: http diff --git a/pkg/executionspace/v1alpha/provider.go b/pkg/executionspace/v1alpha/provider.go index 0bbfd69..fadfd85 100644 --- a/pkg/executionspace/v1alpha/provider.go +++ b/pkg/executionspace/v1alpha/provider.go @@ -162,12 +162,12 @@ func New(cfg config.Config, log *logrus.Entry, provider provider.Provider, ctx c // LoadRoutes loads all the v1alpha1 routes. func (a ProviderServiceApplication) LoadRoutes(router *httprouter.Router) { handler := &ProviderServiceHandler{a.logger, a.cfg, a.provider, a.wg} - router.GET("/v1alpha/selftest/ping", handler.Selftest) - router.POST("/start", handler.panicRecovery(handler.timeoutHandler(handler.Start))) - router.GET("/status", handler.panicRecovery(handler.timeoutHandler(handler.Status))) - router.POST("/stop", handler.panicRecovery(handler.timeoutHandler(handler.Stop))) + router.GET("/executionspace/v1alpha/selftest/ping", handler.Selftest) + router.POST("/executionspace/start", handler.panicRecovery(handler.timeoutHandler(handler.Start))) + router.GET("/executionspace/status", handler.panicRecovery(handler.timeoutHandler(handler.Status))) + router.POST("/executionspace/stop", handler.panicRecovery(handler.timeoutHandler(handler.Stop))) - router.POST(fmt.Sprintf("/v1alpha/executor/%s", a.provider.Executor().Name()), handler.panicRecovery(handler.timeoutHandler(handler.ExecutorStart))) + router.POST(fmt.Sprintf("/executionspace/v1alpha/executor/%s", a.provider.Executor().Name()), handler.panicRecovery(handler.timeoutHandler(handler.ExecutorStart))) a.initTracer() } diff --git a/pkg/iut/v1alpha1/v1alpha1.go b/pkg/iut/v1alpha1/v1alpha1.go index 53f356c..7152a4e 100644 --- a/pkg/iut/v1alpha1/v1alpha1.go +++ b/pkg/iut/v1alpha1/v1alpha1.go @@ -49,8 +49,7 @@ type V1Alpha1Handler struct { wg *sync.WaitGroup } -type Dataset struct { -} +type Dataset struct{} // RespondWithJSON writes a JSON response with a status code to the HTTP ResponseWriter. func RespondWithJSON(w http.ResponseWriter, code int, payload interface{}) { @@ -84,10 +83,10 @@ func New(cfg config.Config, log *logrus.Entry, ctx context.Context, cli *clientv // LoadRoutes loads all the v1alpha1 routes. func (a V1Alpha1Application) LoadRoutes(router *httprouter.Router) { handler := &V1Alpha1Handler{a.logger, a.cfg, a.database, a.wg} - router.GET("/v1alpha1/selftest/ping", handler.Selftest) - router.POST("/start", handler.panicRecovery(handler.timeoutHandler(handler.Start))) - router.GET("/status", handler.panicRecovery(handler.timeoutHandler(handler.Status))) - router.POST("/stop", handler.panicRecovery(handler.timeoutHandler(handler.Stop))) + router.GET("/iut/v1alpha1/selftest/ping", handler.Selftest) + router.POST("/iut/start", handler.panicRecovery(handler.timeoutHandler(handler.Start))) + router.GET("/iut/status", handler.panicRecovery(handler.timeoutHandler(handler.Status))) + router.POST("/iut/stop", handler.panicRecovery(handler.timeoutHandler(handler.Stop))) } // Selftest is a handler to just return 204. diff --git a/pkg/logarea/v1alpha/logarea.go b/pkg/logarea/v1alpha/logarea.go index 3b016c3..b1c5619 100644 --- a/pkg/logarea/v1alpha/logarea.go +++ b/pkg/logarea/v1alpha/logarea.go @@ -81,8 +81,8 @@ func New(cfg config.Config, log *logrus.Entry) application.Application { // LoadRoutes loads all the v1alpha routes. func (a LogAreaApplication) LoadRoutes(router *httprouter.Router) { handler := &LogAreaHandler{a.logger, a.cfg, a.client, a.regex} - router.GET("/v1alpha/selftest/ping", handler.Selftest) - router.GET("/v1alpha/logarea/:identifier", handler.panicRecovery(handler.timeoutHandler(handler.GetFileURLs))) + router.GET("/logarea/v1alpha/selftest/ping", handler.Selftest) + router.GET("/logarea/v1alpha/logarea/:identifier", handler.panicRecovery(handler.timeoutHandler(handler.GetFileURLs))) } // Selftest is a handler to just return 204. diff --git a/pkg/sse/v1/sse.go b/pkg/sse/v1/sse.go index b9ab450..8053749 100644 --- a/pkg/sse/v1/sse.go +++ b/pkg/sse/v1/sse.go @@ -67,9 +67,9 @@ func New(cfg config.Config, log *logrus.Entry, ctx context.Context) application. func (a SSEApplication) LoadRoutes(router *httprouter.Router) { kube := kubernetes.New(a.cfg, a.logger) handler := &SSEHandler{a.logger, a.cfg, a.ctx, kube} - router.GET("/v1/selftest/ping", handler.Selftest) - router.GET("/v1/events/:identifier", handler.GetEvents) - router.GET("/v1/event/:identifier/:id", handler.GetEvent) + router.GET("/sse/v1/selftest/ping", handler.Selftest) + router.GET("/sse/v1/events/:identifier", handler.GetEvents) + router.GET("/sse/v1/event/:identifier/:id", handler.GetEvent) } // Selftest is a handler to just return 204. diff --git a/pkg/sse/v1alpha/sse.go b/pkg/sse/v1alpha/sse.go index aaf50b2..20f9e89 100644 --- a/pkg/sse/v1alpha/sse.go +++ b/pkg/sse/v1alpha/sse.go @@ -69,8 +69,8 @@ func New(cfg config.Config, log *logrus.Entry, ctx context.Context) application. func (a SSEApplication) LoadRoutes(router *httprouter.Router) { kube := kubernetes.New(a.cfg, a.logger) handler := &SSEHandler{a.logger, a.cfg, a.ctx, kube} - router.GET("/v1alpha/selftest/ping", handler.Selftest) - router.GET("/v1alpha/logs/:identifier", handler.GetEvents) + router.GET("/sse/v1alpha/selftest/ping", handler.Selftest) + router.GET("/sse/v1alpha/logs/:identifier", handler.GetEvents) } // Selftest is a handler to just return 204.