Created
March 11, 2020 19:50
-
-
Save hbagdi/26ac5f35e9c7b33bee554772d41c5689 to your computer and use it in GitHub Desktop.
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: apps/v1 | |
kind: Deployment | |
metadata: | |
name: tcp-echo | |
labels: | |
app: tcp-echo | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: tcp-echo | |
template: | |
metadata: | |
labels: | |
app: tcp-echo | |
spec: | |
containers: | |
- name: tcp-echo-container | |
image: cjimti/go-echo:latest | |
imagePullPolicy: Always | |
env: | |
- name: TCP_PORT | |
value: "2701" | |
- name: NODE_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: spec.nodeName | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
- name: POD_IP | |
valueFrom: | |
fieldRef: | |
fieldPath: status.podIP | |
ports: | |
- name: tcp-echo-port | |
containerPort: 2701 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: tcp-echo | |
labels: | |
app: tcp-echo | |
spec: | |
selector: | |
app: "tcp-echo" | |
ports: | |
- protocol: "TCP" | |
port: 2701 | |
targetPort: 2701 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment