Last active
May 14, 2020 21:48
-
-
Save dimaskiddo/12252e67721b2b40eb2a965c483d6ca8 to your computer and use it in GitHub Desktop.
OpenShift - Route to Host Outside Cluster
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
apiVersion: v1 | |
kind: Endpoints | |
metadata: | |
name: "{{ service_name }}-service" | |
namespace: "{{ project_name }}" | |
subsets: | |
- addresses: | |
- ip: "{{ endpoint_ip_1 }}" | |
nodeName: "{{ endpoint_name_1 }}" | |
- ip: "{{ endpoint_ip_n }}" | |
nodeName: "{{ endpoint_name_n }}" | |
ports: | |
- name: "{{ endpoint_port_1 }}-tcp" | |
port: "{{ endpoint_port_1 }}" | |
protocol: TCP | |
- name: "{{ endpoint_port_n }}-tcp" | |
port: "{{ endpoint_port_n }}" | |
protocol: TCP |
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
apiVersion: v1 | |
kind: Route | |
metadata: | |
name: "{{ route_name }}-route" | |
namespace: "{{ project_name }}" | |
spec: | |
host: "{{ route_name }}" | |
tls: | |
termination: passthrough | |
insecureEdgeTerminationPolicy: Redirect | |
port: | |
targetPort: "{{ endpoint_port_n }}-tcp" | |
to: | |
kind: Service | |
name: "{{ service_name }}-service" |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: "{{ service_name }}-service" | |
namespace: "{{ project_name }}" | |
spec: | |
ports: | |
- name: "{{ endpoint_port_1 }}-tcp" | |
port: "{{ endpoint_port_1 }}" | |
targetPort: "{{ endpoint_port_1 }}" | |
protocol: TCP | |
- name: "{{ endpoint_port_n }}-tcp" | |
port: "{{ endpoint_port_n }}" | |
targetPort: "{{ endpoint_port_n }}" | |
protocol: TCP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment