Created
October 4, 2017 14:04
-
-
Save 0xAhmed/9216750db1264ac0983a789559367a6b to your computer and use it in GitHub Desktop.
Example k8s Deployment exposing Service for use by Ingress resources
This file contains hidden or 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
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