Skip to content

Instantly share code, notes, and snippets.

@dduportal
Created July 15, 2019 13:04
Show Gist options
  • Save dduportal/b14aa1fd2cdc2b63fae34672532c595c to your computer and use it in GitHub Desktop.
Save dduportal/b14aa1fd2cdc2b63fae34672532c595c to your computer and use it in GitHub Desktop.
whoami
version: '3'
services:
webapp:
image: containous/whoami
# Move this directive under the "deploy:" if you are deploying to swarm instead of standalone Docker Engine
labels:
# Traefik v1
- "traefik.frontend.rule=Host:whoami.localhost"
# Traefik v2
- "traefik.http.routers.whoami.rule=Host(`whoami.localhost`)"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
spec:
replicas: 1
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: containous/whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoami
labels:
app: whoami
spec:
type: ClusterIP
ports:
- port: 80
name: whoami
selector:
app: whoami
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: whoami
labels:
app: whoami
spec:
rules:
- host: whoami.localhost
http:
paths:
- backend:
serviceName: whoami
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment