Merge branch 'master' into local-sudoer-without-pw

This commit is contained in:
az 2023-02-05 14:31:08 +01:00
commit ee1fe720f6
9 changed files with 4011 additions and 46 deletions

View file

@ -18,7 +18,7 @@ apply plugin: "kotlinx-serialization"
group = "org.domaindrivenarchitecture.provs" group = "org.domaindrivenarchitecture.provs"
version = "0.17.1-SNAPSHOT" version = "0.18.1-SNAPSHOT"
repositories { repositories {
mavenCentral() mavenCentral()

View file

@ -11,8 +11,8 @@ import java.io.FileWriter
* Returns DesktopConfig; data for config is read from specified file. * Returns DesktopConfig; data for config is read from specified file.
* Throws exceptions FileNotFoundException, SerializationException if file is not found resp. cannot be parsed. * Throws exceptions FileNotFoundException, SerializationException if file is not found resp. cannot be parsed.
*/ */
internal fun getConfig(filename: String = "desktop-config.yaml"): DesktopConfig = readFromFile(filename).yamlToType() fun getConfig(filename: String = "desktop-config.yaml"): DesktopConfig = readFromFile(filename).yamlToType()
@Suppress("unused") @Suppress("unused")
internal fun writeConfig(config: DesktopConfig, fileName: String = "desktop-config.yaml") = FileWriter(fileName).use { it.write(config.toYaml()) } fun writeConfig(config: DesktopConfig, fileName: String = "desktop-config.yaml") = FileWriter(fileName).use { it.write(config.toYaml()) }

View file

@ -90,13 +90,17 @@ fun Prov.installK3s(k3sConfig: K3sConfig): ProvResult {
cmd("INSTALL_K3S_VERSION=$K3S_VERSION k3s-install.sh") cmd("INSTALL_K3S_VERSION=$K3S_VERSION k3s-install.sh")
// metallb // metallb
applyK3sFileFromResource(File(k3sManualManifestsDir, "metallb-namespace.yaml")) applyK3sFileFromResource(File(k3sManualManifestsDir, "metallb-0.13.7-native-manifest.yaml"))
applyK3sFileFromResource(File(k3sManualManifestsDir, "metallb-0.10.2-manifest.yaml"))
applyK3sFileFromResourceTemplate( repeatTaskUntilSuccess(6, 10) {
File(k3sManualManifestsDir, "metallb-config.yaml"), applyK3sFileFromResourceTemplate(
k3sConfigMap, File(k3sManualManifestsDir, "metallb-config.yaml"),
alternativeResourceName = File(metallbConfigResourceFileName) k3sConfigMap,
) alternativeResourceName = File(metallbConfigResourceFileName)
)
}
applyK3sFileFromResource(File(k3sManualManifestsDir, "metallb-l2advertisement.yaml"))
// traefik // traefik
if (k3sConfig.isDualStack()) { if (k3sConfig.isDualStack()) {

View file

@ -1,18 +1,19 @@
apiVersion: v1 apiVersion: metallb.io/v1beta1
kind: ConfigMap kind: IPAddressPool
metadata: metadata:
name: public
namespace: metallb-system namespace: metallb-system
name: config spec:
data: addresses:
config: | - ${node_ipv4}/32
address-pools: - ${node_ipv6}/128
- name: public ---
protocol: layer2 apiVersion: metallb.io/v1beta1
addresses: kind: IPAddressPool
- ${node_ipv4}/32 metadata:
- ${node_ipv6}/128 name: private
- name: private namespace: metallb-system
protocol: layer2 spec:
addresses: addresses:
- ${loopback_ipv4}/32 - ${loopback_ipv4}/32
- ${loopback_ipv6}/128 - ${loopback_ipv6}/128

View file

@ -1,16 +1,17 @@
apiVersion: v1 apiVersion: metallb.io/v1beta1
kind: ConfigMap kind: IPAddressPool
metadata: metadata:
name: public
namespace: metallb-system namespace: metallb-system
name: config spec:
data: addresses:
config: | - ${node_ipv4}/32
address-pools: ---
- name: public apiVersion: metallb.io/v1beta1
protocol: layer2 kind: IPAddressPool
addresses: metadata:
- ${node_ipv4}/32 name: private
- name: private namespace: metallb-system
protocol: layer2 spec:
addresses: addresses:
- ${loopback_ipv4}/32 - ${loopback_ipv4}/32

View file

@ -0,0 +1,9 @@
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: layer2
namespace: metallb-system
spec:
ipAddressPools:
- private
- public

View file

@ -1,6 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: metallb-system
labels:
app: metallb