mirror of https://github.com/k3s-io/k3s
37 lines
681 B
YAML
37 lines
681 B
YAML
|
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:unprivileged
|
||
|
ports:
|
||
|
- containerPort: 8080
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
labels:
|
||
|
k8s-app: nginx-app-loadbalancer
|
||
|
name: nginx-loadbalancer-svc
|
||
|
namespace: default
|
||
|
spec:
|
||
|
type: LoadBalancer
|
||
|
ports:
|
||
|
- port: 81
|
||
|
targetPort: 8080
|
||
|
protocol: TCP
|
||
|
name: http
|
||
|
selector:
|
||
|
k8s-app: nginx-app-loadbalancer
|