Skip to content

Instantly share code, notes, and snippets.

View nashmaniac's full-sized avatar
😃
Happy Always

Raju Ahmed Shetu nashmaniac

😃
Happy Always
  • KOHO Financial Inc
  • Toronto, Canada
View GitHub Profile
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: microservice-virtual-service
namespace: traffic-management
spec:
hosts:
- traffic-management.retailvoice.xyz #allowed host
gateways:
- traffic-management/ingressgateway # list of gateway from which we will be getting request forwarded
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: user-virtual-service #self explanatory
namespace: traffic-management #self explanatory
spec:
hosts: # a virtual service can redirect requests for multiple hosts. this is more of a filtering hosts
- user.traffic-management.retailvoice.xyz
gateways: # a virtual service can also received requests from multiple gateway
- traffic-management/ingressgateway # always safe to access with namespaces
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: microservice-virtual-service
namespace: traffic-management
spec:
hosts:
- traffic-management.retailvoice.xyz #allowed host
gateways:
- traffic-management/ingressgateway # list of gateway from which we will be getting request forwarded
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: user-virtual-service #self explanatory
namespace: traffic-management #self explanatory
spec:
hosts: # a virtual service can redirect requests for multiple hosts. this is more of a filtering hosts
- user.traffic-management.retailvoice.xyz
gateways: # a virtual service can also received requests from multiple gateway
- traffic-management/ingressgateway # always safe to access with namespaces
@nashmaniac
nashmaniac / 2-user-microservice.yaml
Created May 9, 2020 01:25
2-traffic-management/2-user-microservice.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: user-deployment # make sure the name of two deployment to be different
namespace: traffic-management # setting namespace to default
labels:
app: user
spec:
replicas: 1 #setting replica count to 1
selector:
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: microservice-virtual-service
namespace: default
spec:
hosts:
- microservice.retailvoice.xyz #allowed host
gateways:
- ingressgateway # list of gateway from which we will be getting request forwarded
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: product-virtual-service
namespace: default
spec:
hosts:
- product.microservice.retailvoice.xyz
gateways:
- ingressgateway
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: user-virtual-service #self explanatory
namespace: default #self explanatory
spec:
hosts: # a virtual service can redirect requests for multiple hosts. this is more of a filtering hosts
- user.microservice.retailvoice.xyz
gateways: # a virtual service can also received requests from multiple gateway
- ingressgateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: ingressgateway #self explanatory
namespace: default #self explantory
spec:
servers: # can have multiple server configuration
- port: # this configuration actually means that we will be allow http connection on port 80 for 3 domains which are listed under hosts
number: 80
name: http
apiVersion: apps/v1
kind: Deployment
metadata:
name: product-deployment
labels:
app: product
spec:
replicas: 2
selector:
matchLabels: