3.7.
3.7.1. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: ext-host-gwy
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- ext-host.example.com
tls:
mode: SIMPLE
serverCertificate: /tmp/tls.crt
privateKey: /tmp/tls.key
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: virtual-svc
spec:
hosts:
- ext-host.example.com
gateways:
- ext-host-gwy
3.7.2. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: info-gateway spec: selector: istio: ingressgateway servers: - port: number: 80 name: http protocol: HTTP hosts: - "*"$ oc apply -f gateway.yaml
apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: info spec: hosts: - "*" gateways: - info-gateway http: - match: - uri: exact: /productpage - uri: prefix: /static - uri: exact: /login - uri: exact: /logout - uri: prefix: /api/v1/products route: - destination: host: productpage port: number: 9080$ oc apply -f vs.yaml
export GATEWAY_URL=$(oc -n istio-system get route istio-ingressgateway -o jsonpath='{.spec.host}')export TARGET_PORT=$(oc -n istio-system get route istio-ingressgateway -o jsonpath='{.spec.port.targetPort}')curl -s -I "$GATEWAY_URL/productpage"
3.7.3. 링크 복사링크가 클립보드에 복사되었습니다!
3.7.3.1. 링크 복사링크가 클립보드에 복사되었습니다!
$ oc get svc istio-ingressgateway -n istio-system
3.7.3.1.1. 링크 복사링크가 클립보드에 복사되었습니다!
$ export INGRESS_HOST=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].ip}')$ export INGRESS_PORT=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].port}')$ export SECURE_INGRESS_PORT=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].port}')$ export TCP_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="tcp")].port}')
$ export INGRESS_HOST=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
3.7.3.1.2. 링크 복사링크가 클립보드에 복사되었습니다!
$ export INGRESS_PORT=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')$ export SECURE_INGRESS_PORT=$(oc -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')$ export TCP_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="tcp")].nodePort}')
3.7.4. 링크 복사링크가 클립보드에 복사되었습니다!
3.7.4.1. 링크 복사링크가 클립보드에 복사되었습니다!
spec:
istio:
gateways:
istio-egressgateway:
autoscaleEnabled: false
autoscaleMin: 1
autoscaleMax: 5
istio-ingressgateway:
autoscaleEnabled: false
autoscaleMin: 1
autoscaleMax: 5
ior_enabled: true
3.7.4.2. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: gateway1
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- www.info.com
- info.example.com
$ oc -n <control_plane_namespace> get routes
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
gateway1-lvlfn info.example.com istio-ingressgateway <all> None
gateway1-scqhv www.info.com istio-ingressgateway <all> None
3.7.5. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: svc-entry
spec:
hosts:
- ext-svc.example.com
ports:
- number: 443
name: https
protocol: HTTPS
location: MESH_EXTERNAL
resolution: DNS
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: ext-res-dr
spec:
host: ext-svc.example.com
trafficPolicy:
tls:
mode: MUTUAL
clientCertificate: /etc/certs/myclientcert.pem
privateKey: /etc/certs/client_private_key.pem
caCertificates: /etc/certs/rootcacerts.pem
3.7.6. 링크 복사링크가 클립보드에 복사되었습니다!
3.7.6.1. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews spec: hosts: - reviews http: - match: - headers: end-user: exact: jason route: - destination: host: reviews subset: v2 - route: - destination: host: reviews subset: v3$ oc apply -f <VirtualService.yaml>
3.7.6.2. 링크 복사링크가 클립보드에 복사되었습니다!
|
|
|
|
|
|
3.7.7. 링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: my-destination-rule
spec:
host: my-svc
trafficPolicy:
loadBalancer:
simple: RANDOM
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
- name: v3
labels:
version: v3
3.7.8. 링크 복사링크가 클립보드에 복사되었습니다!
3.7.8.1. 링크 복사링크가 클립보드에 복사되었습니다!
$ oc apply -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.6/samples/info/networking/virtual-service-all-v1.yaml$ oc get virtualservices -o yaml
3.7.8.2. 링크 복사링크가 클립보드에 복사되었습니다!
export GATEWAY_URL=$(oc -n istio-system get route istio-ingressgateway -o jsonpath='{.spec.host}')echo "http://$GATEWAY_URL/productpage"
3.7.8.3. 링크 복사링크가 클립보드에 복사되었습니다!
$ oc apply -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.6/samples/info/networking/virtual-service-reviews-test-v2.yaml$ oc get virtualservice reviews -o yaml