Created
August 20, 2018 20:43
-
-
Save lvthillo/96e0c2514329e5a1f1150fbc8a709ff9 to your computer and use it in GitHub Desktop.
Example of NodePort service in Kubernetes
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: my-app | |
spec: | |
selector: | |
matchLabels: | |
run: my-app | |
replicas: 2 | |
template: | |
metadata: | |
labels: | |
run: my-app | |
spec: | |
containers: | |
- name: my-app | |
image: lvthillo/python-flask-docker | |
ports: | |
- containerPort: 8080 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: my-app | |
labels: | |
run: my-app | |
spec: | |
type: NodePort | |
ports: | |
- port: 8080 | |
protocol: TCP | |
selector: | |
run: my-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment