This commit is contained in:
Chris Lu 2021-11-07 21:28:26 -08:00
parent d53367b5d3
commit cbb981aad9
4 changed files with 2 additions and 16 deletions

View File

@ -5,7 +5,7 @@ metadata:
namespace: default namespace: default
spec: spec:
# Add fields here # Add fields here
image: chrislusf/seaweedfs:2.76 image: chrislusf/seaweedfs:2.77
volumeServerDiskCount: 1 volumeServerDiskCount: 1
hostSuffix: seaweed.abcdefg.com hostSuffix: seaweed.abcdefg.com
master: master:

View File

@ -16,7 +16,6 @@ func buildFilerStartupScript(m *seaweedv1.Seaweed) string {
commands := []string{"weed", "filer"} commands := []string{"weed", "filer"}
commands = append(commands, fmt.Sprintf("-port=%d", seaweedv1.FilerHTTPPort)) commands = append(commands, fmt.Sprintf("-port=%d", seaweedv1.FilerHTTPPort))
commands = append(commands, fmt.Sprintf("-ip=$(POD_NAME).%s-filer-peer.%s", m.Name, m.Namespace)) commands = append(commands, fmt.Sprintf("-ip=$(POD_NAME).%s-filer-peer.%s", m.Name, m.Namespace))
commands = append(commands, fmt.Sprintf("-peers=%s", getFilerPeersString(m.Name, m.Namespace, m.Spec.Filer.Replicas)))
commands = append(commands, fmt.Sprintf("-master=%s", getMasterPeersString(m))) commands = append(commands, fmt.Sprintf("-master=%s", getMasterPeersString(m)))
commands = append(commands, "-s3") commands = append(commands, "-s3")

View File

@ -11,7 +11,6 @@ import (
const ( const (
masterPeerAddressPattern = "%s-master-%d.%s-master-peer.%s:9333" masterPeerAddressPattern = "%s-master-%d.%s-master-peer.%s:9333"
filerPeerAddressPattern = "%s-filer-%d.%s-filer-peer.%s:8888"
) )
var ( var (
@ -50,18 +49,6 @@ func ReconcileResult(err error) (bool, ctrl.Result, error) {
return false, ctrl.Result{}, nil return false, ctrl.Result{}, nil
} }
func getFilerAddresses(name string, namespace string, replicas int32) []string {
peersAddresses := make([]string, 0, replicas)
for i := int32(0); i < replicas; i++ {
peersAddresses = append(peersAddresses, fmt.Sprintf(filerPeerAddressPattern, name, i, name, namespace))
}
return peersAddresses
}
func getFilerPeersString(name string, namespace string, replicas int32) string {
return strings.Join(getFilerAddresses(name, namespace, replicas), ",")
}
func getMasterAddresses(namespace string, name string, replicas int32) []string { func getMasterAddresses(namespace string, name string, replicas int32) []string {
peersAddresses := make([]string, 0, replicas) peersAddresses := make([]string, 0, replicas)
for i := int32(0); i < replicas; i++ { for i := int32(0); i < replicas; i++ {

View File

@ -39,7 +39,7 @@ var _ = Describe("Seaweed Controller", func() {
Name: name, Name: name,
}, },
Spec: seaweedv1.SeaweedSpec{ Spec: seaweedv1.SeaweedSpec{
Image: "chrislusf/seaweedfs:2.76", Image: "chrislusf/seaweedfs:2.77",
VolumeServerDiskCount: 1, VolumeServerDiskCount: 1,
Master: &seaweedv1.MasterSpec{ Master: &seaweedv1.MasterSpec{
Replicas: 3, Replicas: 3,