Last active
March 12, 2023 17:43
-
-
Save clouditlab/c3d6a702f92016e60ac8d1f36a429d49 to your computer and use it in GitHub Desktop.
METALLB example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: itlab-app | |
data: | |
nginx.conf: ' | |
events { | |
} | |
http { | |
server { | |
listen 80; | |
location / { | |
return 200 "$remote_addr - Hello IT Lab readers, today we are covering MetalLB!\n"; | |
} | |
} | |
} | |
' | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: itlab-app | |
spec: | |
selector: | |
matchLabels: | |
owner: cloud-itlab | |
app: itlab-app | |
replicas: 2 | |
template: | |
metadata: | |
labels: | |
owner: cloud-itlab | |
app: itlab-app | |
spec: | |
containers: | |
- name: itlab-app | |
image: nginx:latest | |
ports: | |
- containerPort: 80 | |
volumeMounts: | |
- name: itlab-app-vol | |
mountPath: /etc/nginx/ | |
volumes: | |
- name: itlab-app-vol | |
configMap: | |
name: itlab-app | |
items: | |
- key: nginx.conf | |
path: nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: metallb.io/v1beta1 | |
kind: IPAddressPool | |
metadata: | |
name: itlab-pool | |
namespace: metallb-system | |
spec: | |
addresses: | |
- 192.168.122.232-192.168.122.240 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: metallb.io/v1beta1 | |
kind: L2Advertisement | |
metadata: | |
name: itlab-advertisement | |
namespace: metallb-system | |
spec: | |
ipAddressPools: | |
- itlab-pool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: itlab-app | |
labels: | |
app: itlab-app | |
spec: | |
type: LoadBalancer | |
ports: | |
- port: 80 | |
protocol: TCP | |
selector: | |
app: itlab-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment