diff --git a/04-Backends/02-HTTPS-backend/deployment.yaml b/04-Backends/02-HTTPS-backend/Deployment.yaml similarity index 66% rename from 04-Backends/02-HTTPS-backend/deployment.yaml rename to 04-Backends/02-HTTPS-backend/Deployment.yaml index 82e781b..d5590d6 100755 --- a/04-Backends/02-HTTPS-backend/deployment.yaml +++ b/04-Backends/02-HTTPS-backend/Deployment.yaml @@ -1,20 +1,3 @@ -apiVersion: v1 -kind: Service -metadata: - name: helloworld - labels: - app: helloworld - service: helloworld -spec: - ports: - - port: 8443 - name: https - targetPort: 443 - protocol: TCP - appProtocol: https - selector: - app: helloworld ---- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/04-Backends/02-HTTPS-backend/DestinationRule.yaml b/04-Backends/02-HTTPS-backend/DestinationRule.yaml new file mode 100644 index 0000000..3cf1130 --- /dev/null +++ b/04-Backends/02-HTTPS-backend/DestinationRule.yaml @@ -0,0 +1,13 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: DestinationRule +metadata: + name: helloworld + namespace: default +spec: + host: helloworld.default.svc.cluster.local + trafficPolicy: + portLevelSettings: + - port: + number: 8443 + tls: + mode: SIMPLE \ No newline at end of file diff --git a/04-Backends/02-HTTPS-backend/Gateway.yaml b/04-Backends/02-HTTPS-backend/Gateway.yaml new file mode 100755 index 0000000..cf8fe5c --- /dev/null +++ b/04-Backends/02-HTTPS-backend/Gateway.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: Gateway +metadata: + name: helloworld-gateway +spec: + selector: + istio: ingressgateway + servers: + - port: + number: 80 + name: http + protocol: HTTP + hosts: + - "*" + - port: + number: 443 + name: https + protocol: HTTPS + hosts: + - "*" + tls: + credentialName: my-tls-cert-secret + mode: SIMPLE diff --git a/04-Backends/02-HTTPS-backend/authentication.yaml b/04-Backends/02-HTTPS-backend/PeerAuthentication.yaml similarity index 100% rename from 04-Backends/02-HTTPS-backend/authentication.yaml rename to 04-Backends/02-HTTPS-backend/PeerAuthentication.yaml diff --git a/04-Backends/02-HTTPS-backend/Service.yaml b/04-Backends/02-HTTPS-backend/Service.yaml new file mode 100644 index 0000000..063b8b8 --- /dev/null +++ b/04-Backends/02-HTTPS-backend/Service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: helloworld + labels: + app: helloworld + service: helloworld +spec: + ports: + - port: 8443 + name: https + targetPort: 443 + protocol: TCP + appProtocol: https + selector: + app: helloworld \ No newline at end of file diff --git a/04-Backends/02-HTTPS-backend/VirtualService.yaml b/04-Backends/02-HTTPS-backend/VirtualService.yaml new file mode 100644 index 0000000..9d09b0b --- /dev/null +++ b/04-Backends/02-HTTPS-backend/VirtualService.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.istio.io/v1alpha3 +kind: VirtualService +metadata: + name: helloworld-vs +spec: + hosts: + - "*" + gateways: + - helloworld-gateway + http: + - name: https-vs + match: + - port: 80 + - port: 443 + route: + - destination: + host: helloworld.default.svc.cluster.local + port: + number: 8443 \ No newline at end of file diff --git a/04-Backends/02-HTTPS-backend/gateway.yaml b/04-Backends/02-HTTPS-backend/gateway.yaml deleted file mode 100755 index 861d59e..0000000 --- a/04-Backends/02-HTTPS-backend/gateway.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: Gateway -metadata: - name: helloworld-gateway -spec: - selector: - istio: ingressgateway - servers: - - port: - number: 80 - name: http - protocol: HTTP - hosts: - - "*" - - port: - number: 443 - name: https - protocol: HTTPS - hosts: - - "*" - tls: - credentialName: my-tls-cert-secret - mode: SIMPLE ---- -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: helloworld-vs -spec: - hosts: - - "*" - gateways: - - helloworld-gateway - http: - - name: https-vs - match: - - port: 80 - - port: 443 - route: - - destination: - host: helloworld.default.svc.cluster.local - port: - number: 8443 ---- -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: helloworld - namespace: default -spec: - host: helloworld.default.svc.cluster.local - trafficPolicy: - portLevelSettings: - - port: - number: 8443 - tls: - mode: SIMPLE