generated from mrsimonemms/new
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove hetzner load balancer in favour of metallb
This gives great flexibility for using UDP ingress, required to run the unifi controller in the cluster
- Loading branch information
1 parent
e6508a2
commit ca2bf57
Showing
25 changed files
with
351 additions
and
172 deletions.
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2024 Simon Emms <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
data "kubernetes_nodes" "cluster" { | ||
depends_on = [ | ||
helm_release.hcloud_ccm, | ||
helm_release.hcloud_csi, | ||
] | ||
} | ||
|
||
resource "kubernetes_namespace_v1" "metallb" { | ||
metadata { | ||
name = "metallb-system" | ||
} | ||
} | ||
|
||
resource "kubernetes_config_map_v1" "metallb" { | ||
metadata { | ||
name = "nodes" | ||
namespace = kubernetes_namespace_v1.metallb.metadata[0].name | ||
} | ||
|
||
data = { | ||
resource = yamlencode({ | ||
apiVersion = "metallb.io/v1beta1" | ||
kind = "IPAddressPool" | ||
metadata = { | ||
name = "nodes" | ||
namespace = kubernetes_namespace_v1.metallb.metadata[0].name | ||
} | ||
spec = { | ||
addresses = [ | ||
for n in flatten(data.kubernetes_nodes.cluster.nodes[*].status[*].addresses) : "${n.address}/32" if n.type == "ExternalIP" | ||
] | ||
} | ||
}) | ||
} | ||
|
||
immutable = false | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: ingress-nginx-components | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "20" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/mrsimonemms/infrastructure | ||
path: registry/components/ingress-nginx | ||
targetRevision: HEAD | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: ingress-nginx | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: metallb-components | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "10" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/mrsimonemms/infrastructure | ||
path: registry/components/metallb | ||
targetRevision: HEAD | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: metallb-system | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: ingress-nginx-components | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "20" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/mrsimonemms/infrastructure | ||
path: registry/components/ingress-nginx | ||
targetRevision: HEAD | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: ingress-nginx | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: metallb-components | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "10" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/mrsimonemms/infrastructure | ||
path: registry/components/metallb | ||
targetRevision: HEAD | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: metallb-system | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: ingress-nginx | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "10" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
spec: | ||
project: default | ||
source: | ||
chart: ingress-nginx | ||
repoURL: https://kubernetes.github.io/ingress-nginx | ||
targetRevision: 4.11.3 | ||
helm: | ||
valuesObject: | ||
controller: | ||
# Not strictly necessary, but feels safer running on all nodes | ||
kind: DaemonSet | ||
config: | ||
use-proxy-protocol: false | ||
extraArgs: | ||
enable-ssl-passthrough: true | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: ingress-nginx | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true | ||
syncOptions: | ||
- CreateNamespace=true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- application.yaml | ||
- namespace.yaml |
Oops, something went wrong.