2021-07-28 16:28:26 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: test-nodeport
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: nginx-app-nodeport
|
|
|
|
replicas: 2
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: nginx-app-nodeport
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: nginx
|
2022-08-05 16:16:10 +00:00
|
|
|
image: ranchertest/mytestcontainer:unprivileged
|
2021-07-28 16:28:26 +00:00
|
|
|
ports:
|
2022-08-05 16:16:10 +00:00
|
|
|
- containerPort: 8080
|
2021-07-28 16:28:26 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: nginx-app-nodeport
|
|
|
|
name: nginx-nodeport-svc
|
|
|
|
namespace: default
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
2022-08-05 16:16:10 +00:00
|
|
|
- port: 8080
|
2021-07-28 16:28:26 +00:00
|
|
|
nodePort: 30096
|
|
|
|
name: http
|
|
|
|
selector:
|
|
|
|
k8s-app: nginx-app-nodeport
|