From de21cda2fd249e5f1200fbfb0cccb82725b36c67 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Tue, 17 Oct 2023 10:40:02 +0200 Subject: [PATCH 1/3] Adding the definition about the Service and Ingress kubernetes resource to expose backstage using the host: backstage.idpbuilder.cnoe.io.local Signed-off-by: cmoulliard --- pkg/apps/srv/backstage/install.yaml | 38 ++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/pkg/apps/srv/backstage/install.yaml b/pkg/apps/srv/backstage/install.yaml index cd705f49..fe5ab3a7 100644 --- a/pkg/apps/srv/backstage/install.yaml +++ b/pkg/apps/srv/backstage/install.yaml @@ -98,13 +98,49 @@ spec: image: public.ecr.aws/cnoe-io/backstage:v0.0.3 imagePullPolicy: IfNotPresent ports: - - name: http + - name: backend containerPort: 7007 volumeMounts: - mountPath: /app/config name: backstage-config readOnly: true --- +--- +apiVersion: v1 +kind: Service +metadata: + name: backstage + namespace: backstage +spec: + ports: + - name: http-backend + port: 7007 + protocol: TCP + targetPort: backend + selector: + app: backstage + sessionAffinity: None + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: backstage + namespace: backstage +spec: + ingressClassName: nginx + rules: + - host: backstage.idpbuilder.cnoe.io.local + http: + paths: + - backend: + service: + name: backstage + port: + number: 7007 + path: / + pathType: Prefix +--- apiVersion: v1 kind: ConfigMap metadata: From b16b4a811da4a2606bc2acbadce9e8124c93b439 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Tue, 17 Oct 2023 10:51:22 +0200 Subject: [PATCH 2/3] Changing localhost host name to https://backstage.idpbuilder.cnoe.io.local:8443 to avoid the error: https://github.com/backstage/backstage/issues/15403 Signed-off-by: cmoulliard --- pkg/apps/srv/backstage/install.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apps/srv/backstage/install.yaml b/pkg/apps/srv/backstage/install.yaml index fe5ab3a7..bfc2da86 100644 --- a/pkg/apps/srv/backstage/install.yaml +++ b/pkg/apps/srv/backstage/install.yaml @@ -152,17 +152,17 @@ data: app-config.yaml: | app: title: CNOE - baseUrl: http://localhost:3000 + baseUrl: "https://backstage.idpbuilder.cnoe.io.local:8443" organization: name: CNOE backend: - baseUrl: http://localhost:7007 + baseUrl: "https://backstage.idpbuilder.cnoe.io.local:8443" listen: port: 7007 csp: connect-src: ["'self'", 'http:', 'https:'] cors: - origin: http://localhost:3000 + origin: "https://backstage.idpbuilder.cnoe.io.local:8443" methods: [GET, HEAD, PATCH, POST, PUT, DELETE] credentials: true database: From 83259ab67b178b69c31e4df30fe97f4f35d796e2 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Wed, 18 Oct 2023 10:56:22 +0200 Subject: [PATCH 3/3] Switching the DNS name from cnoe.io.local to cnoe.io.localtest.me Signed-off-by: cmoulliard --- README.md | 4 ++-- pkg/apps/srv/backstage/install.yaml | 8 ++++---- pkg/controllers/gitserver/controller.go | 2 +- pkg/controllers/localbuild/controller.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9470312c..531a8425 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,9 @@ This can be useful in several ways: Kubernetes: `kubectl get pods` -Argo: Visit https://argocd.idpbuilder.cnoe.io.localtest.me:8443/ +Argo: https://argocd.idpbuilder.cnoe.io.localtest.me:8443/ -Backstage: http://backstage.idpbuilder.cnoe.io.localtest.me/ +Backstage: https://backstage.idpbuilder.cnoe.io.localtest.me:8443/ ## Architecture diff --git a/pkg/apps/srv/backstage/install.yaml b/pkg/apps/srv/backstage/install.yaml index bfc2da86..959b07fa 100644 --- a/pkg/apps/srv/backstage/install.yaml +++ b/pkg/apps/srv/backstage/install.yaml @@ -130,7 +130,7 @@ metadata: spec: ingressClassName: nginx rules: - - host: backstage.idpbuilder.cnoe.io.local + - host: backstage.idpbuilder.cnoe.io.localtest.me http: paths: - backend: @@ -152,17 +152,17 @@ data: app-config.yaml: | app: title: CNOE - baseUrl: "https://backstage.idpbuilder.cnoe.io.local:8443" + baseUrl: "https://backstage.idpbuilder.cnoe.io.localtest.me:8443" organization: name: CNOE backend: - baseUrl: "https://backstage.idpbuilder.cnoe.io.local:8443" + baseUrl: "https://backstage.idpbuilder.cnoe.io.localtest.me:8443" listen: port: 7007 csp: connect-src: ["'self'", 'http:', 'https:'] cors: - origin: "https://backstage.idpbuilder.cnoe.io.local:8443" + origin: "https://backstage.idpbuilder.cnoe.io.localtest.me:8443" methods: [GET, HEAD, PATCH, POST, PUT, DELETE] credentials: true database: diff --git a/pkg/controllers/gitserver/controller.go b/pkg/controllers/gitserver/controller.go index 04983441..72cb5a10 100644 --- a/pkg/controllers/gitserver/controller.go +++ b/pkg/controllers/gitserver/controller.go @@ -23,7 +23,7 @@ import ( const ( gitServerResourceName string = "gitserver" gitServerDeploymentContainerName string = "httpd" - gitServerIngressHostnameBase string = ".idpbuilder.cnoe.io.local" + gitServerIngressHostnameBase string = ".idpbuilder.cnoe.io.localtest.me" repoUrlFmt string = "http://%s.%s.svc/idpbuilder-resources.git" ) diff --git a/pkg/controllers/localbuild/controller.go b/pkg/controllers/localbuild/controller.go index a9847241..f89f81e0 100644 --- a/pkg/controllers/localbuild/controller.go +++ b/pkg/controllers/localbuild/controller.go @@ -24,7 +24,7 @@ const ( EmbeddedGitServerName string = "embedded" gitServerResourceName string = "gitserver" gitServerDeploymentContainerName string = "httpd" - gitServerIngressHostnameBase string = ".idpbuilder.cnoe.io.local" + gitServerIngressHostnameBase string = ".idpbuilder.cnoe.io.localtest.me" repoUrlFmt string = "http://%s.%s.svc/idpbuilder-resources.git" )