From cdff7c620cc31ca90d9e63a0d7c81b56d322eceb Mon Sep 17 00:00:00 2001 From: savagebidoof Date: Tue, 25 Apr 2023 03:42:10 +0200 Subject: [PATCH] Documented `02-Traffic_management/09-TCP-FORWARDING` --- .../deployment.yaml | 9 +- .../09-TCP-FORWARDING/gateway.yaml | 45 ++++++++++ .../??-TCP-FORWARDING-(WORKS)/gateway.yaml | 83 ------------------- 3 files changed, 48 insertions(+), 89 deletions(-) rename Istio/02-Traffic_management/{??-TCP-FORWARDING-(WORKS) => 09-TCP-FORWARDING}/deployment.yaml (83%) create mode 100755 Istio/02-Traffic_management/09-TCP-FORWARDING/gateway.yaml delete mode 100755 Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/gateway.yaml diff --git a/Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/deployment.yaml b/Istio/02-Traffic_management/09-TCP-FORWARDING/deployment.yaml similarity index 83% rename from Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/deployment.yaml rename to Istio/02-Traffic_management/09-TCP-FORWARDING/deployment.yaml index ae41138..92c59bd 100755 --- a/Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/deployment.yaml +++ b/Istio/02-Traffic_management/09-TCP-FORWARDING/deployment.yaml @@ -8,12 +8,11 @@ metadata: spec: ports: - port: 8080 - name: tcp-a + name: http-web targetPort: 80 protocol: TCP - - port: 8443 - name: tcp-b + name: https-web targetPort: 443 protocol: TCP selector: @@ -34,16 +33,14 @@ spec: metadata: labels: app: helloworld - sidecar.istio.io/inject: "true" spec: containers: - name: helloworld -# image: nginx image: oriolfilter/https-nginx-demo resources: requests: cpu: "100m" - imagePullPolicy: IfNotPresent #Always + imagePullPolicy: IfNotPresent ports: - containerPort: 80 - containerPort: 443 diff --git a/Istio/02-Traffic_management/09-TCP-FORWARDING/gateway.yaml b/Istio/02-Traffic_management/09-TCP-FORWARDING/gateway.yaml new file mode 100755 index 0000000..036596c --- /dev/null +++ b/Istio/02-Traffic_management/09-TCP-FORWARDING/gateway.yaml @@ -0,0 +1,45 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: helloworld-gateway +spec: + selector: + istio: ingressgateway + servers: + - port: + number: 80 + name: tcp-1 + protocol: TCP + hosts: + - "*" + - port: + number: 443 + name: tcp-2 + protocol: TCP + hosts: + - "*" +--- +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: helloworld-vs +spec: + hosts: + - "*" + gateways: + - helloworld-gateway + tcp: + - match: + - port: 80 + route: + - destination: + host: helloworld.default.svc.cluster.local + port: + number: 8080 + - match: + - port: 443 + route: + - destination: + host: helloworld.default.svc.cluster.local + port: + number: 8443 \ No newline at end of file diff --git a/Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/gateway.yaml b/Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/gateway.yaml deleted file mode 100755 index 17c1ada..0000000 --- a/Istio/02-Traffic_management/??-TCP-FORWARDING-(WORKS)/gateway.yaml +++ /dev/null @@ -1,83 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: Gateway -metadata: - name: helloworld-gateway -spec: - selector: - istio: ingressgateway - servers: -# - port: -# number: 443 -# name: secure-http2 -# protocol: HTTP2 -# hosts: -# - "*" - - port: - number: 80 - name: tcp-2 - protocol: TCP - hosts: - - "*" - - port: - number: 443 - name: tcp-i - protocol: TCP - hosts: - - "*" -# tls: -# credentialName: my-tls-cert-secret -# minProtocolVersion: TLSV1_2 - -# mode: PASSTHROUGH ---- -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: helloworld-vs -spec: - hosts: - - "*" - gateways: - - helloworld-gateway - http: - - match: - - port: 80 -# hosts: -# - "hello.si" - name: helloworld - route: - - destination: - host: helloworld - port: - number: 80 - tcp: - - match: - - port: 80 - route: - - destination: - host: helloworld - port: - number: 8080 - - match: - - port: 443 - route: - - destination: - host: helloworld - port: - number: 8443 -# -# tls: -# - match: -# - port: 443 -# sniHosts: -# - "hello.si" -## - uri: -## exact: /helloworld -# route: -# - destination: -# host: helloworld -# port: -# number: 8443 -## protocol: HTTPS -## rewrite: -## uri: "/" \ No newline at end of file