Skip to content

Commit

Permalink
Migrate to Kustomize
Browse files Browse the repository at this point in the history
  • Loading branch information
WuBruno committed Oct 11, 2023
1 parent acecfa7 commit 701a8cb
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 53 deletions.
24 changes: 24 additions & 0 deletions products/pdt/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: pdt
namespace: pdt
labels:
"app.kubernetes.io/name": "pdt"
spec:
replicas: 1
selector:
matchLabels:
"app.kubernetes.io/name": "pdt"
strategy:
type: RollingUpdate
template:
metadata:
labels:
"app.kubernetes.io/name": "pdt"
spec:
containers:
- image: pdt
name: pdt
ports:
- containerPort: 80
29 changes: 29 additions & 0 deletions products/pdt/cd/base/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: pdt
namespace: pdt
labels:
"app.kubernetes.io/name": "pdt"
spec:
rules:
- host: localhost
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: pdt
port:
number: 80
- host: pdt.zilliqa.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: devex
port:
number: 80
9 changes: 9 additions & 0 deletions products/pdt/cd/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- pv.yaml
- pvc.yaml
- deployment.yaml
- svc.yaml
- ingress.yaml
4 changes: 4 additions & 0 deletions products/pdt/cd/base/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: pdt
12 changes: 12 additions & 0 deletions products/pdt/cd/base/pv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: pdt-pv
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 128Gi
storageClassName: standard
hostPath:
path: /tmp/pdt-pv
12 changes: 12 additions & 0 deletions products/pdt/cd/base/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pdt-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 128Gi
storageClassName: standard
volumeName: pdt-pv
16 changes: 16 additions & 0 deletions products/pdt/cd/base/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: pdt
namespace: pdt
labels:
"app.kubernetes.io/name": "pdt"
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
selector:
"app.kubernetes.io/name": "pdt"
53 changes: 0 additions & 53 deletions products/pdt/cd/deployment.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions products/pdt/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: pdt
spec:
domains:
- pdt.zilstg.dev
26 changes: 26 additions & 0 deletions products/pdt/cd/overlays/staging/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

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

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

0 comments on commit 701a8cb

Please sign in to comment.