You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
520 B
30 lines
520 B
apiVersion: apps/v1 |
|
kind: Deployment |
|
metadata: |
|
name: nginx-deployment |
|
spec: |
|
selector: |
|
matchLabels: |
|
app: nginx |
|
replicas: 2 # tells deployment to run 2 pods matching the template |
|
template: |
|
metadata: |
|
labels: |
|
app: nginx |
|
spec: |
|
containers: |
|
- name: nginx |
|
image: nginx:1.20.0-alpine |
|
ports: |
|
- containerPort: 80 |
|
--- |
|
apiVersion: v1 |
|
kind: Service |
|
metadata: |
|
name: nginx-service |
|
spec: |
|
selector: |
|
app: nginx |
|
ports: |
|
- protocol: TCP |
|
port: 80
|
|
|