Reproducer for https://github.com/metallb/metallb/issues/558
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
kind: Cluster | |
apiVersion: kind.x-k8s.io/v1alpha4 | |
nodes: | |
- role: control-plane | |
- role: worker | |
- role: worker | |
- role: worker |
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
#!/bin/bash | |
set -euxo pipefail | |
kind create cluster --config kind-config.yaml | |
kubectl create ns metallb-system | |
kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.9.2/manifests/metallb.yaml | |
kubectl create secret generic -n metallb-system memberlist --from-literal=secretkey="$(openssl rand -base64 128)" | |
kubectl apply -f metallb-config.yaml | |
kubectl apply -f nginx.yaml | |
kubectl wait --for=condition=Available --timeout=120s deploy/nginx | |
kubectl get events | grep service/nginx |
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: | |
namespace: metallb-system | |
name: config | |
data: | |
config: | | |
address-pools: | |
- name: default | |
protocol: layer2 | |
addresses: | |
- 172.17.0.240-172.17.0.250 |
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: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: nginx | |
name: nginx | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: | |
app: nginx | |
template: | |
metadata: | |
labels: | |
app: nginx | |
spec: | |
containers: | |
- image: nginx | |
name: nginx | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-a | |
annotations: | |
metallb.universe.tf/allow-shared-ip: secret | |
spec: | |
ports: | |
- port: 80 | |
targetPort: 80 | |
selector: | |
app: nginx | |
type: LoadBalancer | |
externalTrafficPolicy: Local | |
loadBalancerIP: 172.17.0.240 | |
--- | |
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: nginx-b | |
annotations: | |
metallb.universe.tf/allow-shared-ip: secret | |
spec: | |
ports: | |
- port: 8080 | |
targetPort: 80 | |
selector: | |
app: nginx | |
type: LoadBalancer | |
externalTrafficPolicy: Local | |
loadBalancerIP: 172.17.0.240 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment