Skip to content

Instantly share code, notes, and snippets.

@0xAhmed
Created October 4, 2017 14:04
Show Gist options
  • Save 0xAhmed/9216750db1264ac0983a789559367a6b to your computer and use it in GitHub Desktop.
Save 0xAhmed/9216750db1264ac0983a789559367a6b to your computer and use it in GitHub Desktop.
Example k8s Deployment exposing Service for use by Ingress resources
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: kubeapp-production
spec:
replicas: 3
template:
metadata:
name: kubeapp
labels:
app: kubeapp
env: production
spec:
containers:
- name: kubeapp
image: gcr.io/PROJECT_ID/app:1.0
imagePullPolicy: Always
readinessProbe:
httpGet:
path: /health
port: 8080
command: ["/app"]
ports:
- name: kubeapp
containerPort: 8080
---
kind: Service
apiVersion: v1
metadata:
name: kubeapp-production-service
labels:
app: kubeapp
env: production
spec:
type: NodePort
ports:
- port: 80
targetPort: 8080
selector:
app: kubeapp
env: production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment