Skip to content

Commit

Permalink
Merge pull request #12 from nicholaskuechler/adds-prometheus
Browse files Browse the repository at this point in the history
feat: adds metallb
  • Loading branch information
cardoe authored Apr 17, 2024
2 parents b567b55 + 5247aa1 commit acd2145
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ traffic and utilize ArgoCD to deploy the rest of the stack. We'll call that
./bootstrap/bootstrap.sh
```

### (Optional) Install MetalLB

[Install MetalLB](./components/20-metallb/README.md)


At this point ArgoCD can start doing the heavy lifting.

Expand Down Expand Up @@ -76,3 +80,4 @@ components which aren't working with GitOps methods at this time.
[Install Keystone](./components/keystone/README.md)

[Configure environment for Keystone/Dex auth](./components/dexidp/README.md).

28 changes: 28 additions & 0 deletions bootstrap/metallb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# MetalLB

We can use metallb with a couple unused IP addresses to provide
the Kubernetes LoadBalancer service type.

## Install MetalLB

```bash
cd components/20-metallb/
kubectl kustomize . | kubectl create -f -
```

## Edit and apply metallb config with our IP addresses

Things to change:
* IPAddressPool list of IPs
* L2Advertisement network interface name

```bash
vim example-create-metallb.yaml
kubectl apply -f example-create-metallb.yaml
```

## Simple test application to test if it's working

```bash
kubectl apply -f example-app-with-lb.yaml
```
33 changes: 33 additions & 0 deletions bootstrap/metallb/example-app-with-lb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
apiVersion: v1
kind: Service
metadata:
name: hello-kubernetes
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8080
selector:
app: hello-kubernetes
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-kubernetes
spec:
replicas: 3
selector:
matchLabels:
app: hello-kubernetes
template:
metadata:
labels:
app: hello-kubernetes
spec:
containers:
- name: hello-kubernetes
image: paulbouwer/hello-kubernetes:1.8
ports:
- containerPort: 8080
---
30 changes: 30 additions & 0 deletions bootstrap/metallb/example-create-metallb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: lb-external
namespace: metallb-system
spec:
addresses:
- 10.22.37.207/32 # This is assumed to be the public LB vip address
- 10.22.37.208/32
- 10.22.37.209/32
- 10.22.37.210/32
- 10.22.37.211/32
- 10.22.37.212/32
- 10.22.37.213/32
autoAssign: true
---
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: lb-external-advertisement
namespace: metallb-system
spec:
ipAddressPools:
- lb-external
# nodeSelectors: # Optional block to limit nodes for a given advertisement
# - matchLabels:
# kubernetes.io/hostname: xs0018.b0013.ord.ohthree.com
interfaces: # Optional block to limit ifaces used to advertise VIPs
- ens1f0
6 changes: 6 additions & 0 deletions bootstrap/metallb/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://raw.githubusercontent.com/metallb/metallb/v0.14.3/config/manifests/metallb-native.yaml

0 comments on commit acd2145

Please sign in to comment.