diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/K3s.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/K3s.kt index fbaa5cc..f27b07f 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/K3s.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/server/infrastructure/K3s.kt @@ -100,7 +100,7 @@ fun Prov.installK3s(k3sConfig: K3sConfig): ProvResult { // traefik if (k3sConfig.isDualStack()) { // see https://github.com/k3s-io/k3s/discussions/5003 - applyK3sFileFromResourceTemplate(k3sTraefikWorkaround, k3sConfigMap) + applyK3sFileFromResource(k3sTraefikWorkaround) } else { ProvResult(true) } diff --git a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.dual.template.yaml b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.dual.template.yaml index 475f068..2bb9135 100644 --- a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.dual.template.yaml +++ b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.dual.template.yaml @@ -9,5 +9,5 @@ data: - name: default protocol: layer2 addresses: - - ${node_ipv4}/29 + - ${node_ipv4}/32 - ${node_ipv6}/128 \ No newline at end of file diff --git a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.ipv4.template.yaml b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.ipv4.template.yaml index cba3869..f56534f 100644 --- a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.ipv4.template.yaml +++ b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/metallb-config.ipv4.template.yaml @@ -9,4 +9,4 @@ data: - name: default protocol: layer2 addresses: - - ${node_ipv4}/29 \ No newline at end of file + - ${node_ipv4}/32 \ No newline at end of file diff --git a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.template.yaml b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.yaml similarity index 94% rename from src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.template.yaml rename to src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.yaml index 25651d8..eaede41 100644 --- a/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.template.yaml +++ b/src/main/resources/org/domaindrivenarchitecture/provs/server/infrastructure/k3s/traefik.yaml @@ -48,7 +48,7 @@ spec: ipFamilyPolicy: "PreferDualStack" metadata: annotations: - metallb.universe.tf/loadBalancerIPs: "${node_ipv4}, ${node_ipv6}" + metallb.universe.tf/allow-shared-ip: "repo-server-svc" spec: type: LoadBalancer externalTrafficPolicy: Local diff --git a/° b/° new file mode 100644 index 0000000..162fca6 --- /dev/null +++ b/° @@ -0,0 +1,24 @@ +#!/bin/bash +set -e +set -o noglob + +function usage() { + echo "Requires argument cluster_name and domain_name in server fqdn {cluster_name} {domain_name}" +} + +function main() { + local cluster_name="${1}"; shift + local domain_name="${1:-meissa-gmbh.de}"; shift + + /usr/local/bin/k3s-create-context.sh ${cluster_name} + kubectl config use-context ${cluster_name} + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@${cluster_name}.${domain_name} -L 8002:localhost:8002 -L 6443:192.168.5.1:6443 +} + +if [ $# -gt 0 ] +then + main $1 +else + usage + exit -1 +fi