Lightweight Kubernetes
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.
 
 
 
 

36 lines
636 B

---
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
image: ranchertest/mytestcontainer
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-loadbalancer-svc
labels:
k8s-app: nginx-app-loadbalancer
spec:
type: LoadBalancer
ports:
- port: 81
targetPort: 80
protocol: TCP
name: http
selector:
k8s-app: nginx-app-loadbalancer