eyyyyy, twerkt

This commit is contained in:
2020-03-11 14:56:22 +01:00
parent 17c2b429d3
commit e405966c38
2 changed files with 294 additions and 178 deletions

View File

@@ -2,31 +2,29 @@
apiVersion: v1
kind: Namespace
metadata:
name: istio-project-1
labels:
istio-injection: enabled #zorgt voor auto sidecar injection
name: linkerd-project-1
annotations:
linkerd.io/inject: enabled
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-a
namespace: istio-project-1
namespace: linkerd-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1" #app label bepaald groepering pods in kiali dashboard dus makkelijker te gebruiken
expose: "true"
app: frontend
template:
metadata:
namespace: linkerd-project-1
labels:
server: "http"
app: "project-1"
expose: "true"
app: frontend
group: frontend
spec:
containers:
- name: front-end
- name: frontend
image: beppev/server-a:master
imagePullPolicy: "Always"
ports:
@@ -35,26 +33,23 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: linkerd-project-1
name: server-b
namespace: istio-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
version: v1
backend: "true"
app: backend-master
group: backend
template:
metadata:
namespace: linkerd-project-1
labels:
server: "http"
app: "project-1"
version: v1
backend: "true"
app: backend-master
group: backend
spec:
containers:
- name: front-end
- name: backend
image: beppev/server-b:master
imagePullPolicy: "Always"
ports:
@@ -63,26 +58,23 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: linkerd-project-1
name: server-b-test
namespace: istio-project-1
spec:
replicas: 1
selector:
matchLabels:
server: "http"
app: "project-1"
version: v2
backend: "true"
app: backend-experimental
group: backend
template:
metadata:
namespace: linkerd-project-1
labels:
server: "http"
app: "project-1"
version: v2
backend: "true"
app: backend-experimental
group: backend
spec:
containers:
- name: front-end
- name: backend
image: beppev/server-b:experimental
imagePullPolicy: "Always"
ports:
@@ -91,184 +83,103 @@ spec:
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: linkerd-project-1
name: server-d
namespace: istio-project-1
spec:
replicas: 1
selector:
matchLabels:
app: "project-1"
mirror: "true"
app: mirror
template:
metadata:
namespace: linkerd-project-1
labels:
app: "project-1"
mirror: "true"
group: mirror
app: mirror
spec:
containers:
- name: front-end
- name: mirror
image: beppev/server-d:master
ports:
- containerPort: 6000
---
apiVersion: v1
kind: Service
metadata:
name: mirror-service
namespace: istio-project-1
labels:
app: "project-1"
spec:
selector:
mirror: "true"
ports:
- name: http
protocol: TCP
port: 6000
---
apiVersion: v1
kind: Service
metadata:
name: server-check
namespace: istio-project-1
labels:
app: "project-1"
namespace: linkerd-project-1
spec:
selector:
backend: "true"
ports:
- name: http
protocol: TCP
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:
- "*"
targetPort: 6000
---
apiVersion: v1
kind: Service
metadata:
name: expose-server-service
namespace: istio-project-1
labels:
app: "project-1"
name: server-check-master
namespace: linkerd-project-1
spec:
selector:
app: backend-master
ports:
- name: http
port: 6000
targetPort: 6000
---
apiVersion: v1
kind: Service
metadata:
name: server-check-experimental
namespace: linkerd-project-1
spec:
selector:
app: backend-experimental
ports:
- name: http
port: 6000
targetPort: 6000
---
apiVersion: split.smi-spec.io/v1alpha1
kind: TrafficSplit
metadata:
name: splitter
namespace: linkerd-project-1
spec:
service: server-check
backends:
- service: server-check-experimental
weight: 90
- service: server-check-master
weight: 10
---
apiVersion: v1
kind: Service
metadata:
name: expose-server
namespace: linkerd-project-1
spec:
selector:
group: frontend
ports:
- name: http
port: 5000
protocol: TCP
selector:
expose: "true"
port: 5000
targetPort: 5000
nodePort: 30036
type: NodePort
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
apiVersion: v1
kind: Service
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"
name: mirror-service
namespace: linkerd-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
group: mirror
ports:
- name: http
protocol: TCP
port: 7000
targetPort: 7000