Last active
January 8, 2022 21:25
-
-
Save parisnakitakejser/895c31044c12f0089cd07e422143c1ea to your computer and use it in GitHub Desktop.
Service and Pods with support hostname & subdomain
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: v1 | |
kind: Service | |
metadata: | |
name: default-subdomain | |
spec: | |
selector: | |
app: web | |
ports: | |
- name: "5000" | |
port: 5000 | |
targetPort: 5000 | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: flask-api-1 | |
labels: | |
app: web | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: web | |
template: | |
metadata: | |
labels: | |
app: web | |
spec: | |
hostname: flask-api-1 | |
subdomain: default-subdomain | |
containers: | |
- name: web1 | |
image: parisnk/flask-test:v1.0.0 | |
ports: | |
- containerPort: 5000 | |
env: | |
- name: SERVICE_NAME | |
value: "flask-api-1" | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: flask-api-2 | |
labels: | |
app: web | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: web | |
template: | |
metadata: | |
labels: | |
app: web | |
spec: | |
hostname: flask-api-2 | |
subdomain: default-subdomain | |
containers: | |
- name: web2 | |
image: parisnk/flask-test:v1.0.0 | |
ports: | |
- containerPort: 5000 | |
env: | |
- name: SERVICE_NAME | |
value: "flask-api-2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment