-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSSM-8079 Automate Expose Grpc With Passthrough Gateway (#748)
- Loading branch information
Showing
7 changed files
with
331 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
pkg/tests/tasks/traffic/ingress/yaml/grpc_echo_server_tls.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: echo | ||
name: echo | ||
namespace: echo-grpc | ||
spec: | ||
selector: | ||
app: echo | ||
type: ClusterIP | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 18080 | ||
- name: tls-grpc | ||
protocol: TCP | ||
port: 7070 | ||
targetPort: 17070 | ||
- name: tcp | ||
port: 9090 | ||
targetPort: 19090 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echo-v1 | ||
namespace: echo-grpc | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: echo | ||
version: v1 | ||
template: | ||
metadata: | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
labels: | ||
app: echo | ||
version: v1 | ||
spec: | ||
containers: | ||
- args: | ||
- --metrics=15014 | ||
- --port | ||
- "18080" | ||
- --tcp | ||
- "19090" | ||
- --grpc | ||
- "17070" | ||
- '--tls' | ||
- '17070' | ||
- --grpc | ||
- "17171" | ||
- --port | ||
- "3333" | ||
- --port | ||
- "8080" | ||
- --version | ||
- v1 | ||
- --crt=/cert.crt | ||
- --key=/cert.key | ||
env: | ||
- name: INSTANCE_IP | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: status.podIP | ||
image: {{ image "grpc-echo" }} | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 10 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: tcp-health-port | ||
timeoutSeconds: 1 | ||
name: app | ||
ports: | ||
- containerPort: 17070 | ||
protocol: TCP | ||
- containerPort: 17171 | ||
protocol: TCP | ||
- containerPort: 8080 | ||
protocol: TCP | ||
- containerPort: 3333 | ||
name: tcp-health-port | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 10 | ||
httpGet: | ||
path: / | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 1 | ||
periodSeconds: 2 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
startupProbe: | ||
failureThreshold: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: tcp-health-port | ||
timeoutSeconds: 1 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echo-v2 | ||
namespace: echo-grpc | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: echo | ||
version: v2 | ||
template: | ||
metadata: | ||
annotations: | ||
sidecar.istio.io/inject: "true" | ||
labels: | ||
app: echo | ||
version: v2 | ||
spec: | ||
containers: | ||
- args: | ||
- --metrics=15014 | ||
- --port | ||
- "18080" | ||
- --tcp | ||
- "19090" | ||
- --grpc | ||
- "17070" | ||
- '--tls' | ||
- '17070' | ||
- --grpc | ||
- "17171" | ||
- --port | ||
- "3333" | ||
- --port | ||
- "8080" | ||
- --version | ||
- v2 | ||
- --crt=/cert.crt | ||
- --key=/cert.key | ||
env: | ||
- name: INSTANCE_IP | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: status.podIP | ||
image: {{ image "grpc-echo" }} | ||
imagePullPolicy: Always | ||
livenessProbe: | ||
failureThreshold: 10 | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: tcp-health-port | ||
timeoutSeconds: 1 | ||
name: app | ||
ports: | ||
- containerPort: 17070 | ||
protocol: TCP | ||
- containerPort: 17171 | ||
protocol: TCP | ||
- containerPort: 8080 | ||
protocol: TCP | ||
- containerPort: 3333 | ||
name: tcp-health-port | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 10 | ||
httpGet: | ||
path: / | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 1 | ||
periodSeconds: 2 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
startupProbe: | ||
failureThreshold: 10 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: tcp-health-port | ||
timeoutSeconds: 1 |
36 changes: 36 additions & 0 deletions
36
pkg/tests/tasks/traffic/ingress/yaml/grpc_passthrough_gateway.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: Gateway | ||
metadata: | ||
name: grpc-gateway | ||
spec: | ||
selector: | ||
istio: ingressgateway | ||
servers: | ||
- port: | ||
number: 443 | ||
name: tls | ||
protocol: TLS | ||
tls: | ||
mode: PASSTHROUGH | ||
hosts: | ||
- grpc.example.com | ||
--- | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: grpc | ||
spec: | ||
hosts: | ||
- grpc.example.com | ||
gateways: | ||
- grpc-gateway | ||
tls: | ||
- match: | ||
- port: 443 | ||
sniHosts: | ||
- grpc.example.com | ||
route: | ||
- destination: | ||
host: echo.echo-grpc.svc.cluster.local | ||
port: | ||
number: 7070 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDITCCAgmgAwIBAgIBADANBgkqhkiG9w0BAQsFADAtMRUwEwYDVQQKDAxleGFt | ||
cGxlIEluYy4xFDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTI0MDkxMzA4MzUyM1oX | ||
DTI1MDkxMzA4MzUyM1owNzEZMBcGA1UEAwwQZ3JwYy5leGFtcGxlLmNvbTEaMBgG | ||
A1UECgwRZ3JwYyBvcmdhbml6YXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw | ||
ggEKAoIBAQDHBwwCOZP/tcEDlxfyBmnyhOoS+1VQH9C92cZnnLsmSH/p6FwX2VJT | ||
jj274JXI0iu+tJ1zcAjJrIgKMvI5CkBqwI9GTVqtzEz7Y6fXi+OHKFE+XT2yRV/k | ||
4yV2stFBHL5tZvcSZdQ/+Hm+BRB/Zfg2j8tmVdGJfLFe3F0wlPxsuLfXVwgu4uHz | ||
b1fhlFESCSZQaPYwAyHEa+csMG1EVDjQuIaQl+bNE7ZH9juF1XWfnbWBf3htORGF | ||
WvQZrp8BGDprqdgM+kjNb3lZDjjwzo8tIO+cSCp1eovCV8fhheQ3Qu4yN0de5c/o | ||
EaU5YeM94TntODVkTDYeOyU9xbzZ1tMHAgMBAAGjQjBAMB0GA1UdDgQWBBRSmeNJ | ||
ZNX5IVuggHLMOtkooAPElTAfBgNVHSMEGDAWgBTQpJ9L4z2EoZRTo0fvOcJ+BEWI | ||
ijANBgkqhkiG9w0BAQsFAAOCAQEArzxbdL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