mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 18:47:20 +01:00
G15d: mount launcher blockvolume state dir
This commit is contained in:
1 parent
7aa0db8a57
commit
7660b855ce
2 files changed
+27
-8
No files matched your search
@@ -67,11 +67,13 @@ func RenderBlockVolumeDeployments(plan lifecycle.BlockVolumeWorkloadPlan, cfg K8
|
||||
DNSPolicy: "ClusterFirstWithHostNet",
|
||||
NodeSelector: map[string]string{"kubernetes.io/hostname": replica.ServerID},
|
||||
Containers: []container{{
|
||||
Name: "blockvolume",
|
||||
Image: cfg.Image,
|
||||
Command: []string{"/usr/local/bin/blockvolume"},
|
||||
Args: blockVolumeArgs(plan, replica, cfg),
|
||||
Name: "blockvolume",
|
||||
Image: cfg.Image,
|
||||
Command: []string{"/usr/local/bin/blockvolume"},
|
||||
Args: blockVolumeArgs(plan, replica, cfg),
|
||||
VolumeMounts: []volumeMount{{Name: "state", MountPath: "/var/lib/sw-block"}},
|
||||
}},
|
||||
Volumes: []volume{{Name: "state", EmptyDir: emptyDir{}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -158,11 +160,25 @@ type podSpec struct {
|
||||
DNSPolicy string `yaml:"dnsPolicy"`
|
||||
NodeSelector map[string]string `yaml:"nodeSelector,omitempty"`
|
||||
Containers []container `yaml:"containers"`
|
||||
Volumes []volume `yaml:"volumes,omitempty"`
|
||||
}
|
||||
|
||||
type container struct {
|
||||
Name string `yaml:"name"`
|
||||
Image string `yaml:"image"`
|
||||
Command []string `yaml:"command,omitempty"`
|
||||
Args []string `yaml:"args"`
|
||||
Name string `yaml:"name"`
|
||||
Image string `yaml:"image"`
|
||||
Command []string `yaml:"command,omitempty"`
|
||||
Args []string `yaml:"args"`
|
||||
VolumeMounts []volumeMount `yaml:"volumeMounts,omitempty"`
|
||||
}
|
||||
|
||||
type volumeMount struct {
|
||||
Name string `yaml:"name"`
|
||||
MountPath string `yaml:"mountPath"`
|
||||
}
|
||||
|
||||
type volume struct {
|
||||
Name string `yaml:"name"`
|
||||
EmptyDir emptyDir `yaml:"emptyDir"`
|
||||
}
|
||||
|
||||
type emptyDir struct{}
|
||||
@@ -28,6 +28,9 @@ func TestG15d_K8sRenderer_RendersBlockVolumeDeploymentArgs(t *testing.T) {
|
||||
"hostNetwork: true",
|
||||
"dnsPolicy: ClusterFirstWithHostNet",
|
||||
"- /usr/local/bin/blockvolume",
|
||||
"mountPath: /var/lib/sw-block",
|
||||
"name: state",
|
||||
"emptyDir: {}",
|
||||
"--master=blockmaster.kube-system.svc.cluster.local:9333",
|
||||
"--volume-id=pvc-a",
|
||||
"--replica-id=r1",
|
||||
|
||||
Reference in new issue
Block a user