2021-07-28 16:28:26 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: test-loadbalancer
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: nginx-app-loadbalancer
|
|
|
|
replicas: 2
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: nginx-app-loadbalancer
|
|
|
|
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:
|
2022-08-05 16:16:10 +00:00
|
|
|
labels:
|
|
|
|
k8s-app: nginx-app-loadbalancer
|
|
|
|
name: nginx-loadbalancer-svc
|
|
|
|
namespace: default
|
2021-07-28 16:28:26 +00:00
|
|
|
spec:
|
2022-08-05 16:16:10 +00:00
|
|
|
type: LoadBalancer
|
|
|
|
ports:
|
|
|
|
- port: 81
|
|
|
|
targetPort: 8080
|
|
|
|
protocol: TCP
|
|
|
|
name: http
|
|
|
|
selector:
|
|
|
|
k8s-app: nginx-app-loadbalancer
|