Skip to content

Instantly share code, notes, and snippets.

@ffledgling
Created April 17, 2018 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ffledgling/5d2ecc35a5270399ac1cf462fe068eb6 to your computer and use it in GitHub Desktop.
Save ffledgling/5d2ecc35a5270399ac1cf462fe068eb6 to your computer and use it in GitHub Desktop.
Spin up a hello world server in kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: echo
spec:
template:
metadata:
labels:
app: echo
spec:
containers:
- image: hashicorp/http-echo
name: echo
ports:
- containerPort: 5678
args:
- -text="Hello World"
---
apiVersion: v1
kind: Service
metadata:
name: echo
annotations:
# Annotation for use by external-dns, otherwise it's ignored.
external-dns.alpha.kubernetes.io/hostname: echo.example.com
spec:
selector:
app: echo
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 5678
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment