Last active
January 31, 2020 22:22
-
-
Save pedroyan/440fe3e00841e08fce1cb860641af86c to your computer and use it in GitHub Desktop.
Yaml file used on my Kubernetes tutorial
This file contains 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: mymicroservice | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: mymicroservice | |
template: | |
metadata: | |
labels: | |
app: mymicroservice | |
spec: | |
containers: | |
- name: mymicroservice | |
image: helloworldmicroservice | |
imagePullPolicy: IfNotPresent #Very important! | |
ports: | |
- containerPort: 80 #Application will be available in this port on the container | |
env: | |
- name: ASPNETCORE_URLS | |
value: http://*:80 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: mymicroservice | |
spec: | |
type: NodePort | |
ports: | |
#Container port that will be exposed | |
- port: 80 | |
#Node port that will expose the container to the public. Outside consumers connect to this port (i.e: 172.78.0.2:31000) | |
nodePort: 31000 | |
selector: | |
app: mymicroservice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment