mirror of
https://github.com/bvanroll/cicdTest.git
synced 2025-08-29 12:02:47 +00:00
oepsie, net opgemerkt waarom mirror raar doet op istio
This commit is contained in:
185
deploy.yaml
185
deploy.yaml
@@ -2,21 +2,21 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: istio-project-1
|
name: consul-project-1
|
||||||
labels:
|
annotations:
|
||||||
istio-injection: enabled #zorgt voor auto sidecar injection
|
"consul.hashicorp.com/connect-inject": "true" #dit is hoe consul injection handled
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: server-a
|
name: server-a
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
server: "http"
|
server: "http"
|
||||||
app: "project-1" #app label bepaald groepering pods in kiali dashboard dus makkelijker te gebruiken
|
app: "project-1"
|
||||||
expose: "true"
|
expose: "true"
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
@@ -36,8 +36,8 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: server-b
|
name: server-b
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -64,7 +64,7 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: server-b-test
|
name: server-b-test
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
@@ -72,7 +72,7 @@ spec:
|
|||||||
server: "http"
|
server: "http"
|
||||||
app: "project-1"
|
app: "project-1"
|
||||||
version: v2
|
version: v2
|
||||||
backend: "true"
|
backend: "true"
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -92,45 +92,47 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: server-d
|
name: server-d
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: "project-1"
|
app: "project-1"
|
||||||
mirror: "true"
|
mirror: "true"
|
||||||
template:
|
server: "http"
|
||||||
metadata:
|
template:
|
||||||
labels:
|
metadata:
|
||||||
app: "project-1"
|
labels:
|
||||||
mirror: "true"
|
app: "project-1"
|
||||||
spec:
|
mirror: "true"
|
||||||
containers:
|
server: "http"
|
||||||
- name: front-end
|
spec:
|
||||||
image: beppev/server-d:master
|
containers:
|
||||||
ports:
|
- name: front-end
|
||||||
- containerPort: 6000
|
image: beppev/server-d:master
|
||||||
|
ports:
|
||||||
|
- containerPort: 6000
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: mirror-service
|
name: expose-service
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
labels:
|
labels:
|
||||||
app: "project-1"
|
app: "project-1"
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
mirror: "true"
|
expose: "true"
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
port: 6000
|
port: 5000
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: server-check
|
name: backend-service
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
labels:
|
labels:
|
||||||
app: "project-1"
|
app: "project-1"
|
||||||
spec:
|
spec:
|
||||||
@@ -141,134 +143,17 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
port: 6000
|
port: 6000
|
||||||
---
|
---
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
|
||||||
kind: DestinationRule
|
|
||||||
metadata:
|
|
||||||
name: server-check-destination
|
|
||||||
namespace: istio-project-1
|
|
||||||
labels:
|
|
||||||
app: "project-1"
|
|
||||||
spec:
|
|
||||||
host: server-check
|
|
||||||
subsets:
|
|
||||||
- name: v1
|
|
||||||
labels:
|
|
||||||
version: v1
|
|
||||||
- name: v2
|
|
||||||
labels:
|
|
||||||
version: v2
|
|
||||||
---
|
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
|
||||||
kind: Gateway
|
|
||||||
metadata:
|
|
||||||
name: expose-server-gateway
|
|
||||||
namespace: istio-project-1
|
|
||||||
labels:
|
|
||||||
app: "project-1"
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
istio: ingressgateway
|
|
||||||
servers:
|
|
||||||
- port:
|
|
||||||
number: 80
|
|
||||||
name: http
|
|
||||||
protocol: HTTP
|
|
||||||
hosts:
|
|
||||||
- "*"
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: expose-server-service
|
name: mirror-service
|
||||||
namespace: istio-project-1
|
namespace: consul-project-1
|
||||||
labels:
|
labels:
|
||||||
app: "project-1"
|
app: "project-1"
|
||||||
spec:
|
spec:
|
||||||
|
selector:
|
||||||
|
mirror: "true"
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
port: 5000
|
protocol: TCP
|
||||||
protocol: TCP
|
port: 6000
|
||||||
selector:
|
|
||||||
expose: "true"
|
|
||||||
---
|
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
|
||||||
kind: VirtualService
|
|
||||||
metadata:
|
|
||||||
name: expose-server-vservice
|
|
||||||
namespace: istio-project-1
|
|
||||||
labels:
|
|
||||||
app: "project-1"
|
|
||||||
spec:
|
|
||||||
hosts:
|
|
||||||
- "*"
|
|
||||||
gateways:
|
|
||||||
- expose-server-gateway
|
|
||||||
http:
|
|
||||||
- match:
|
|
||||||
- uri:
|
|
||||||
prefix: /server-a
|
|
||||||
route:
|
|
||||||
- destination:
|
|
||||||
port:
|
|
||||||
number: 5000
|
|
||||||
host: expose-server-service
|
|
||||||
- match:
|
|
||||||
- uri:
|
|
||||||
prefix: /server-d
|
|
||||||
route:
|
|
||||||
- destination:
|
|
||||||
port:
|
|
||||||
number: 7000
|
|
||||||
host: mirror-service
|
|
||||||
--- # TODO fix gateway zodat we ingress gateway kunnen gebruike ipv de fuken loadbalancer.
|
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
|
||||||
kind: Gateway
|
|
||||||
metadata:
|
|
||||||
name: server-check-gateway
|
|
||||||
namespace: istio-project-1
|
|
||||||
labels:
|
|
||||||
app: "project-1"
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
expose: "true"
|
|
||||||
servers:
|
|
||||||
- port:
|
|
||||||
number: 6000
|
|
||||||
name: http
|
|
||||||
protocol: HTTP
|
|
||||||
hosts:
|
|
||||||
- "*"
|
|
||||||
---
|
|
||||||
apiVersion: networking.istio.io/v1alpha3
|
|
||||||
kind: VirtualService
|
|
||||||
metadata:
|
|
||||||
name: server-check-service
|
|
||||||
namespace: istio-project-1
|
|
||||||
labels:
|
|
||||||
app: "project-1"
|
|
||||||
spec:
|
|
||||||
hosts:
|
|
||||||
- "*"
|
|
||||||
gateways:
|
|
||||||
- expose-server-gateway
|
|
||||||
tcp:
|
|
||||||
- match:
|
|
||||||
- port: 6000
|
|
||||||
route:
|
|
||||||
- destination:
|
|
||||||
host: server-check
|
|
||||||
port:
|
|
||||||
number: 6000
|
|
||||||
subset: v1
|
|
||||||
weight: 50
|
|
||||||
- destination:
|
|
||||||
host: server-check
|
|
||||||
port:
|
|
||||||
number: 6000
|
|
||||||
subset: v2
|
|
||||||
weight: 50
|
|
||||||
mirror:
|
|
||||||
host: mirror-service
|
|
||||||
port:
|
|
||||||
number: 6000
|
|
||||||
mirror_percent: 100
|
|
@@ -21,4 +21,4 @@ def get():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True, host="0.0.0.0", port=7000)
|
app.run(debug=True, host="0.0.0.0", port=6000)
|
||||||
|
Reference in New Issue
Block a user