From fb103556346f289cdc55dc5b899735ab7944cef1 Mon Sep 17 00:00:00 2001 From: robj Date: Wed, 6 Dec 2023 19:45:26 +0100 Subject: [PATCH 1/4] now that we have WAF protection we can go back to running just 3 FE instances --- .cicd/values/frontend-prod.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cicd/values/frontend-prod.yaml b/.cicd/values/frontend-prod.yaml index 1750b2a..ddac211 100644 --- a/.cicd/values/frontend-prod.yaml +++ b/.cicd/values/frontend-prod.yaml @@ -1,5 +1,5 @@ #Deployment -replicaCount: 15 +replicaCount: 3 #Pod resourceCpuRequest: 200m From e7cee494d2021e0f0705fa0f5ac7b22750645b30 Mon Sep 17 00:00:00 2001 From: Sandro Ducceschi Date: Wed, 3 Jan 2024 16:35:38 +0100 Subject: [PATCH 2/4] MODIFIED: better subdomain handling to respect staging urls --- src/components/Header.vue | 3 ++- src/router/index.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/Header.vue b/src/components/Header.vue index 9f0cb5c..583e28d 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -197,7 +197,8 @@ export default { // destroyed() {}, methods: { testForCountryPage() { - this.hideNavigation = /^[a-zA-Z]{2}.casper.network/.test(window.location.hostname); + const { hostname } = window.location; + this.hideNavigation = /^[a-zA-Z]{2}.casper.network/.test(hostname) || /^[a-zA-Z]{2}.staging.casper.network/.test(hostname); }, goHome() { if (this.hideNavigation) { diff --git a/src/router/index.js b/src/router/index.js index 7b6fc56..324d64e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,11 +86,17 @@ export function getRouter() { let isCountryLP = false; let countryCode = null; - const hostname = window.location.hostname; + const { hostname } = window.location; - if (/^[a-zA-Z]{2}.casper.network/.test(hostname)) { + const prodDomainTest = /^[a-zA-Z]{2}.casper.network/.test(hostname); + const stagingDomainTest = /^[a-zA-Z]{2}.staging.casper.network/.test(hostname); + if (prodDomainTest || stagingDomainTest) { isCountryLP = true; countryCode = hostname.replace('.casper.network', ''); + if (countryCode.includes('.')) { + countryCode = hostname.replace('.staging.casper.network', ''); + } + console.log(countryCode); ignoreLanguage = true; language = 'en-us'; } From bf6b0ac0086dc42d2bc5023e486121dec8f3a321 Mon Sep 17 00:00:00 2001 From: Sandro Ducceschi Date: Wed, 3 Jan 2024 16:36:33 +0100 Subject: [PATCH 3/4] MODIFIED: remove unnecessary console.log --- src/router/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 324d64e..ea6f1d3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -96,7 +96,6 @@ export function getRouter() { if (countryCode.includes('.')) { countryCode = hostname.replace('.staging.casper.network', ''); } - console.log(countryCode); ignoreLanguage = true; language = 'en-us'; } From 46f3f874621972c24b48c8c9b997c3f94e6d6103 Mon Sep 17 00:00:00 2001 From: robj Date: Fri, 12 Jan 2024 20:18:52 +1300 Subject: [PATCH 4/4] kr subdomain ingress --- .cicd/manifests/ingress-kr.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .cicd/manifests/ingress-kr.yaml diff --git a/.cicd/manifests/ingress-kr.yaml b/.cicd/manifests/ingress-kr.yaml new file mode 100644 index 0000000..3111443 --- /dev/null +++ b/.cicd/manifests/ingress-kr.yaml @@ -0,0 +1,31 @@ +# note: We explicitly create each language subdomain, rather than a wildcard domain +# as wildcards are not supportd by http01 cert-manager ClusterIssuer + +{{- if .Values.ingressDomainName}} + +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + namespace: {{.Values.namespace}} + name: kr-{{.Values.appName}}-{{.Values.envName}}-ingress + annotations: + cert-manager.io/cluster-issuer: "letsencrypt-prod" +spec: + tls: + - hosts: + - kr.{{.Values.ingressDomainName}} + secretName: kr-{{.Values.appName}}-{{.Values.envName}}-tls + rules: + - host: kr.{{.Values.ingressDomainName}} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{.Values.appName}}-{{.Values.envName}}-svc + port: + number: {{.Values.servicePort}} + ingressClassName: nginx + + {{- end}} \ No newline at end of file