Skip to content

Instantly share code, notes, and snippets.

@bprashanth
Created November 12, 2015 01:25
Show Gist options
  • Save bprashanth/382ea382a6be6b10c424 to your computer and use it in GitHub Desktop.
Save bprashanth/382ea382a6be6b10c424 to your computer and use it in GitHub Desktop.
apiVersion: v1
kind: Service
metadata:
labels:
app: echoheaders
name: echoheaders
spec:
# Type NodePort is essentially a request 30301 on every Node in your cluster
type: NodePort
ports:
# NodePort for the Kubernetes Service (use this to access it outside the cluster)
- nodePort: 30301
# Port for the Kubernetes Service (use this to access it within the cluster)
port: 80
# Port of the echoheaders pod
targetPort: 8080
selector:
app: echoheaders
---
apiVersion: v1
kind: ReplicationController
metadata:
name: echoheaders
spec:
replicas: 1
template:
metadata:
labels:
app: echoheaders
spec:
containers:
- name: echoheaders
image: gcr.io/google_containers/echoserver:1.0
ports:
- containerPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment