mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
G15d: fix dynamic launcher iSCSI bind
This commit is contained in:
1 parent
7d09750d58
commit
7aa0db8a57
5 files changed
+16
-6
No files matched your search
@@ -61,6 +61,7 @@ func TestG15d_K8sRunner_AppliesLauncherGeneratedManifest(t *testing.T) {
|
||||
"generated-blockvolume.yaml",
|
||||
"kubectl apply -f \"$ARTIFACT_DIR/generated-blockvolume.yaml\"",
|
||||
"kubectl -n kube-system wait --for=condition=available deploy -l app=sw-blockvolume",
|
||||
"kubectl -n kube-system logs -l sw-block.seaweedfs.com/volume",
|
||||
"PASS: dynamic PVC pod completed checksum write/read",
|
||||
} {
|
||||
if !strings.Contains(body, want) {
|
||||
|
||||
@@ -70,7 +70,7 @@ func TestG15d_BlockmasterLauncherTickWritesBlockvolumeManifest(t *testing.T) {
|
||||
"--master=blockmaster.kube-system.svc.cluster.local:9333",
|
||||
"--volume-id=pvc-a",
|
||||
"--replica-id=r1",
|
||||
"--iscsi-listen=0.0.0.0:3260",
|
||||
"--iscsi-listen=127.0.0.1:3260",
|
||||
} {
|
||||
if !strings.Contains(body, want) {
|
||||
t.Fatalf("manifest missing %q:\n%s", want, body)
|
||||
|
||||
@@ -57,7 +57,11 @@ func RenderBlockVolumeDeployments(plan lifecycle.BlockVolumeWorkloadPlan, cfg K8
|
||||
Replicas: intPtr(1),
|
||||
Selector: selector{MatchLabels: map[string]string{"app": name}},
|
||||
Template: podTemplate{
|
||||
Metadata: metadata{Labels: map[string]string{"app": name}},
|
||||
Metadata: metadata{Labels: map[string]string{
|
||||
"app": name,
|
||||
"sw-block.seaweedfs.com/volume": plan.VolumeID,
|
||||
"sw-block.seaweedfs.com/replica": replica.ReplicaID,
|
||||
}},
|
||||
Spec: podSpec{
|
||||
HostNetwork: true,
|
||||
DNSPolicy: "ClusterFirstWithHostNet",
|
||||
@@ -94,7 +98,7 @@ func blockVolumeArgs(plan lifecycle.BlockVolumeWorkloadPlan, replica lifecycle.B
|
||||
fmt.Sprintf("--durable-blocks=%d", plan.SizeBytes/4096),
|
||||
"--durable-blocksize=4096",
|
||||
"--recovery-mode=" + cfg.RecoveryMode,
|
||||
fmt.Sprintf("--iscsi-listen=0.0.0.0:%d", replica.ISCSIListenPort),
|
||||
fmt.Sprintf("--iscsi-listen=127.0.0.1:%d", replica.ISCSIListenPort),
|
||||
"--iscsi-iqn=" + replica.ISCSIQualifiedName,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,8 @@ func TestG15d_K8sRenderer_RendersBlockVolumeDeploymentArgs(t *testing.T) {
|
||||
"--replica-id=r1",
|
||||
"--durable-root=/var/lib/sw-block/pvc-a/r1",
|
||||
"--recovery-mode=dual-lane",
|
||||
"--iscsi-listen=0.0.0.0:3260",
|
||||
"sw-block.seaweedfs.com/volume: pvc-a",
|
||||
"--iscsi-listen=127.0.0.1:3260",
|
||||
"--iscsi-iqn=iqn.test:pvc-a",
|
||||
} {
|
||||
if !strings.Contains(raw, want) {
|
||||
@@ -50,7 +51,7 @@ func TestG15d_K8sRenderer_RF2UsesDistinctNamesAndPorts(t *testing.T) {
|
||||
if manifests[0].Name == manifests[1].Name {
|
||||
t.Fatalf("duplicate names: %q", manifests[0].Name)
|
||||
}
|
||||
if !strings.Contains(string(manifests[1].YAML), "--iscsi-listen=0.0.0.0:3261") {
|
||||
if !strings.Contains(string(manifests[1].YAML), "--iscsi-listen=127.0.0.1:3261") {
|
||||
t.Fatalf("second manifest missing port 3261:\n%s", manifests[1].YAML)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,14 +32,17 @@ kubectl version --client=true >"$ARTIFACT_DIR/kubectl-version.txt" 2>&1 || true
|
||||
kubectl get nodes -o wide >"$ARTIFACT_DIR/nodes.before.txt"
|
||||
|
||||
cleanup() {
|
||||
(
|
||||
set +e
|
||||
kubectl -n kube-system delete deploy -l app=sw-blockvolume --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl -n kube-system delete deploy sw-blockvolume-r1 sw-blockvolume-r2 --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$ROOT/deploy/k8s/g15d/dynamic-pvc-pod.yaml" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$ROOT/deploy/k8s/g15b/csi-node.yaml" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$ROOT/deploy/k8s/g15d/csi-controller.yaml" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$ROOT/deploy/k8s/g15b/csi-driver.yaml" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$ROOT/deploy/k8s/g15d/rbac.yaml" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
kubectl delete -f "$STACK_RENDERED" --ignore-not-found=true >>"$ARTIFACT_DIR/cleanup.log" 2>&1
|
||||
)
|
||||
}
|
||||
|
||||
collect_daemon_logs() {
|
||||
@@ -50,12 +53,13 @@ collect_daemon_logs() {
|
||||
kubectl -n kube-system logs deploy/sw-block-csi-controller -c block-csi >"$ARTIFACT_DIR/blockcsi-controller.log" 2>&1 || true
|
||||
kubectl -n kube-system logs deploy/sw-block-csi-controller -c csi-provisioner >"$ARTIFACT_DIR/csi-provisioner.log" 2>&1 || true
|
||||
kubectl -n kube-system logs deploy/sw-block-csi-controller -c csi-attacher >"$ARTIFACT_DIR/csi-attacher.log" 2>&1 || true
|
||||
kubectl -n kube-system logs -l app=sw-blockvolume -c blockvolume --tail=-1 >"$ARTIFACT_DIR/blockvolume-generated.log" 2>&1 || true
|
||||
kubectl -n kube-system logs -l sw-block.seaweedfs.com/volume -c blockvolume --tail=-1 >"$ARTIFACT_DIR/blockvolume-generated.log" 2>&1 || true
|
||||
kubectl -n kube-system get pods,deploy -o wide >"$ARTIFACT_DIR/kube-system-pods-deploys.txt" 2>&1 || true
|
||||
kubectl -n "$NAMESPACE" get sc,pv,pvc,pod -o wide >"$ARTIFACT_DIR/app-storage.txt" 2>&1 || true
|
||||
kubectl -n kube-system exec deploy/sw-blockmaster -c blockmaster -- sh -c 'cat /manifests/*.yaml' >"$ARTIFACT_DIR/generated-blockvolume.yaml" 2>"$ARTIFACT_DIR/generated-blockvolume.err" || true
|
||||
}
|
||||
|
||||
cleanup
|
||||
trap 'collect_daemon_logs; cleanup' EXIT
|
||||
|
||||
log "apply product stack without pre-created blockvolumes"
|
||||
|
||||
Reference in new issue
Block a user