From 8be9aee7cf32b8a46003bd85523396eb77593d3d Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Sun, 28 Nov 2021 10:54:51 -0800 Subject: [PATCH 1/3] use port list --- controller/spawn/base.yaml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/controller/spawn/base.yaml b/controller/spawn/base.yaml index edb6ae6..63a40ce 100644 --- a/controller/spawn/base.yaml +++ b/controller/spawn/base.yaml @@ -57,14 +57,13 @@ application: name: dealbot secrets: [] configMaps: [] - service: - enabled: true - type: ClusterIP - ports: - - protocol: TCP - port: 8764 - targetPort: 8764 - name: dealbot + services: + - type: ClusterIP + ports: + - protocol: TCP + port: 8764 + targetPort: 8764 + name: dealbot ingress: enabled: false storage: From d5dc5b7246517a6b99d12aa8e14a2159a63dfcda Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Wed, 1 Dec 2021 00:32:58 -0800 Subject: [PATCH 2/3] include namespace --- controller/spawn/kubernetes.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/controller/spawn/kubernetes.go b/controller/spawn/kubernetes.go index cbf5e3f..7ebc639 100644 --- a/controller/spawn/kubernetes.go +++ b/controller/spawn/kubernetes.go @@ -25,7 +25,7 @@ type KubernetesSpawner struct { } func (s *KubernetesSpawner) Spawn(d *Daemon) error { - actionConfig, err := s.actionConfig(d.Region) + actionConfig, namespace, err := s.actionConfig(d.Region) if err != nil { log.Infow("could not create actionConfig during Spawn", "err", err) return err @@ -52,6 +52,7 @@ func (s *KubernetesSpawner) Spawn(d *Daemon) error { client.ReleaseName = d.Id client.UseReleaseName = true client.CreateNamespace = false + client.Namespace = namespace vals, err := dealbotValues(d) if err != nil { @@ -67,7 +68,7 @@ func (s *KubernetesSpawner) Spawn(d *Daemon) error { } func (s *KubernetesSpawner) Get(regionid string, daemonid string) (daemon *Daemon, err error) { - actionConfig, err := s.actionConfig(regionid) + actionConfig, _, err := s.actionConfig(regionid) if err != nil { log.Infow("could not create actionConfig during daemon Get", "err", err) return daemon, err @@ -82,7 +83,7 @@ func (s *KubernetesSpawner) Get(regionid string, daemonid string) (daemon *Daemo } func (s *KubernetesSpawner) Shutdown(regionid string, daemonid string) error { - actionConfig, err := s.actionConfig(regionid) + actionConfig, _, err := s.actionConfig(regionid) if err != nil { log.Infow("could not create actionConfig during daemon Get", "err", err) return err @@ -96,7 +97,7 @@ func (s *KubernetesSpawner) Shutdown(regionid string, daemonid string) error { } func (s *KubernetesSpawner) List(regionid string) (daemons []*Daemon, err error) { - actionConfig, err := s.actionConfig(regionid) + actionConfig, _, err := s.actionConfig(regionid) if err != nil { log.Infow("could not create actionConfig during daemon List", "err", err) return daemons, err @@ -125,15 +126,15 @@ func (s *KubernetesSpawner) Regions() []string { return regions } -func (s *KubernetesSpawner) actionConfig(regionid string) (*action.Configuration, error) { +func (s *KubernetesSpawner) actionConfig(regionid string) (*action.Configuration, string, error) { getter, ok := s.getters[regionid] if !ok { - return nil, RegionNotFound + return nil, "", RegionNotFound } c := s.rawConfig.Contexts[regionid] actionConfig := new(action.Configuration) actionConfig.Init(getter, c.Namespace, "", log.Debugw) - return actionConfig, actionConfig.KubeClient.IsReachable() + return actionConfig, c.Namespace, actionConfig.KubeClient.IsReachable() } func NewKubernetes() *KubernetesSpawner { From 05ee4276767581483bf5a99e82ce11179d0153b2 Mon Sep 17 00:00:00 2001 From: Will Scott Date: Wed, 1 Dec 2021 11:19:53 -0800 Subject: [PATCH 3/3] remove failing 'embedded credential urls' --- controller/app/index.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/controller/app/index.js b/controller/app/index.js index a301afd..7e8bd50 100644 --- a/controller/app/index.js +++ b/controller/app/index.js @@ -67,13 +67,13 @@ $().ready(() => { $("#botlist").hide() $("#shutdownConfirm").on('click', confirmShutdown) - fetch("./regions", { method: "GET", headers: getHeaders()}).then((response) => response.json()).then(gotRegions) + fetch(getUrl("./regions"), { method: "GET",mode: 'cors', headers: getHeaders()}).then((response) => response.json()).then(gotRegions) syncData() }) function syncData() { - fetch("./tasks", { method: "GET", headers: getHeaders()}).then((response) => response.json()).then(gotTasks) + fetch(getUrl("./tasks"), { method: "GET", mode: 'cors', headers: getHeaders()}).then((response) => response.json()).then(gotTasks) } function operate(val, row) { @@ -143,7 +143,7 @@ function gotRegions(data) { $("#regionList .list-group-item").removeClass("active") $(this).addClass("active") currentRegion = regionList[reg] - fetch(`./regions/${regionList[reg]}`, { method: "GET", headers: getHeaders()}).then((response) => response.json()).then(gotDaemons) + fetch(getUrl(`./regions/${regionList[reg]}`), { method: "GET", mode: 'cors', headers: getHeaders()}).then((response) => response.json()).then(gotDaemons) }) .appendTo($("#regionlist")); $('