Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVOPS-1047: zillion migration to gcp #283

Merged
merged 10 commits into from
Nov 21, 2023
Prev Previous commit
Next Next commit
feat: DEVOPS-1047 zillion migration to gcp
  • Loading branch information
pavlops committed Nov 21, 2023
commit 58750fd8697eb1258db7727006a29e0ae124c8a0
24 changes: 24 additions & 0 deletions products/zillion/cd/base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: zillion
namespace: zillion
labels:
"app.kubernetes.io/name": "zillion"
spec:
replicas: 1
selector:
matchLabels:
"app.kubernetes.io/name": "zillion"
strategy:
type: RollingUpdate
template:
metadata:
labels:
"app.kubernetes.io/name": "zillion"
spec:
containers:
- image: zillion
name: zillion
ports:
- containerPort: 80
41 changes: 41 additions & 0 deletions products/zillion/cd/base/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: zillion
namespace: zillion
labels:
"app.kubernetes.io/name": "zillion"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
rules:
- host: localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: zillion
port:
number: 80
- host: stg-stake.zilliqa.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: zillion
port:
number: 80
- host: testnet-stake.zilliqa.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: zillion
port:
number: 80
7 changes: 7 additions & 0 deletions products/zillion/cd/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- deployment.yaml
- svc.yaml
- ingress.yaml
4 changes: 4 additions & 0 deletions products/zillion/cd/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: zillion
16 changes: 16 additions & 0 deletions products/zillion/cd/base/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: zillion
namespace: zillion
labels:
"app.kubernetes.io/name": "zillion"
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
"app.kubernetes.io/name": "zillion"
7 changes: 7 additions & 0 deletions products/zillion/cd/overlays/production/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
name: zillion
spec:
domains:
- stake.zilliqa.com
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
name: zillion
spec:
redirectToHttps:
enabled: true
responseCodeName: RESPONSE_CODE
29 changes: 29 additions & 0 deletions products/zillion/cd/overlays/production/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base
- certificate.yaml
- frontend-config.yaml

patches:
- target:
kind: Ingress
name: zillion
patch: |-
- op: replace
path: "/spec/rules/0/host"
value: stake.zilliqa.com
- op: remove
path: "/spec/rules/2"
- op: remove
path: "/spec/rules/1"
- op: replace
path: /metadata/annotations
value:
kubernetes.io/ingress.class: gce
kubernetes.io/ingress.global-static-ip-name: stake-zilliqa-com
networking.gke.io/managed-certificates: zillion
networking.gke.io/v1beta1.FrontendConfig: zillion

namespace: zillion-prd
7 changes: 7 additions & 0 deletions products/zillion/cd/overlays/staging/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
metadata:
name: zillion
spec:
domains:
- zillion.zilstg.dev
8 changes: 8 additions & 0 deletions products/zillion/cd/overlays/staging/frontend-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
name: zillion
spec:
redirectToHttps:
enabled: true
responseCodeName: RESPONSE_CODE
24 changes: 24 additions & 0 deletions products/zillion/cd/overlays/staging/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../base
- certificate.yaml
- frontend-config.yaml

patches:
- target:
kind: Ingress
name: zillion
patch: |-
- op: replace
path: "/spec/rules/0/host"
value: zillion.zilstg.dev
- op: replace
path: /metadata/annotations
value:
kubernetes.io/ingress.class: gce
kubernetes.io/ingress.global-static-ip-name: zillion-zilstg-dev
networking.gke.io/managed-certificates: zillion

namespace: zillion-stg