Skip to content

Commit

Permalink
feat: DEVOPS-1047 zillion migration to gcp
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlops committed Nov 21, 2023
1 parent f426029 commit 58750fd
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 0 deletions.
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
8 changes: 8 additions & 0 deletions products/zillion/cd/overlays/production/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
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

0 comments on commit 58750fd

Please sign in to comment.