added local-path-provisioner config
This commit is contained in:
parent
3f3974794a
commit
b509bb4228
2 changed files with 22 additions and 0 deletions
|
@ -32,6 +32,8 @@ private val certManagerIssuer = File(k3sManualManifestsDir, "le-issuer.yaml")
|
|||
private val k3sEcho = File(k3sManualManifestsDir, "echo.yaml")
|
||||
private val selfSignedCertificate = File(k3sManualManifestsDir, "selfsigned-certificate.yaml")
|
||||
|
||||
private val localPathProvisionerConfig = File(k3sManualManifestsDir, "local-path-provisioner-config.yaml")
|
||||
|
||||
|
||||
// ----------------------------------- public functions --------------------------------
|
||||
|
||||
|
@ -57,6 +59,8 @@ fun Prov.installK3s(k3sConfig: K3sConfig) = task {
|
|||
createDirs(k8sCredentialsDir, sudo = true)
|
||||
createDirs(k3sAutomatedManifestsDir, sudo = true)
|
||||
createDirs(k3sManualManifestsDir, sudo = true)
|
||||
createDirs("/var/pvc1", sudo = true)
|
||||
createDirs("/var/pvc2", sudo = true)
|
||||
|
||||
var k3sConfigMap: Map<String, String> = mapOf(
|
||||
"loopback_ipv4" to k3sConfig.loopback.ipv4,
|
||||
|
@ -96,6 +100,9 @@ fun Prov.installK3s(k3sConfig: K3sConfig) = task {
|
|||
} else {
|
||||
ProvResult(true)
|
||||
}
|
||||
|
||||
applyK3sFileFromResource(localPathProvisionerConfig)
|
||||
|
||||
cmd("ln -sf $k3sKubeConfig " + k8sCredentialsDir + "admin.conf", sudo = true)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: local-path-config
|
||||
namespace: kube-system
|
||||
data:
|
||||
config.json: |-
|
||||
{
|
||||
"nodePathMap":[
|
||||
{
|
||||
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
||||
"paths":["/var/pvc1","/var/pvc2"]
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue