48 lines
694 B
YAML
48 lines
694 B
YAML
|
apiVersion: v1
|
||
|
kind: Namespace
|
||
|
metadata:
|
||
|
name: nginx
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: my-ngnix-svc
|
||
|
namespace: nginx
|
||
|
labels:
|
||
|
app: nginx
|
||
|
spec:
|
||
|
type: ClusterIP
|
||
|
selector:
|
||
|
app: nginx
|
||
|
ports:
|
||
|
- port: 80
|
||
|
targetPort: 80
|
||
|
---
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: my-nginx
|
||
|
namespace: nginx
|
||
|
labels:
|
||
|
app: nginx
|
||
|
spec:
|
||
|
replicas: 2
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: nginx
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: nginx
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: nginx
|
||
|
image: nginx
|
||
|
resources:
|
||
|
limits:
|
||
|
memory: "128Mi"
|
||
|
cpu: "500m"
|
||
|
ports:
|
||
|
- containerPort: 80
|
||
|
|