test-project
This commit is contained in:
40
k8s/overlays/onpremise/ingress.yaml
Normal file
40
k8s/overlays/onpremise/ingress.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: react-mysql-api-ingress
|
||||
namespace: react-mysql
|
||||
annotations:
|
||||
nginx.ingress.kubernetes.io/rewrite-target: /$2
|
||||
nginx.ingress.kubernetes.io/use-regex: "true"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: myapp.local
|
||||
http:
|
||||
paths:
|
||||
- path: /api(/|$)(.*)
|
||||
pathType: ImplementationSpecific
|
||||
backend:
|
||||
service:
|
||||
name: backend
|
||||
port:
|
||||
number: 3000
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: react-mysql-frontend-ingress
|
||||
namespace: react-mysql
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: myapp.local
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: frontend
|
||||
port:
|
||||
number: 3000
|
||||
12
k8s/overlays/onpremise/kustomization.yaml
Normal file
12
k8s/overlays/onpremise/kustomization.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../base
|
||||
- ingress.yaml
|
||||
|
||||
patches:
|
||||
- path: patch-storageclass.yaml
|
||||
target:
|
||||
kind: StatefulSet
|
||||
name: mysql
|
||||
15
k8s/overlays/onpremise/patch-storageclass.yaml
Normal file
15
k8s/overlays/onpremise/patch-storageclass.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: mysql
|
||||
namespace: react-mysql
|
||||
spec:
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: mysql-data
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
Reference in New Issue
Block a user