Files
ubicloud/spec/model/minio/minio_cluster_spec.rb
shikharbhardwaj 523d6ca958 Use public IPs for minio cluster communication
Based on some recent networking performance benchmarks, we've discovered
that the private netwroking stack seems to offer upto 10x lower
bandwidth as compared to the public one. While this needs to be
investigated further, meanwhile we switch the MinIO cluster to use
public IPs for peer communication to avoid this performance penalty.
2025-02-21 17:58:29 +05:30

54 lines
1.3 KiB
Ruby

# frozen_string_literal: true
require_relative "../spec_helper"
RSpec.describe MinioCluster do
subject(:mc) {
mc = described_class.create_with_id(
location: "hetzner-fsn1",
name: "minio-cluster-name",
admin_user: "minio-admin",
admin_password: "dummy-password",
root_cert_1: "root_cert_1",
root_cert_2: "root_cert_2",
project_id: Project.create(name: "test").id
)
mp = MinioPool.create_with_id(
cluster_id: mc.id,
start_index: 0,
server_count: 1,
drive_count: 1,
storage_size_gib: 100,
vm_size: "standard-2"
)
MinioServer.create_with_id(
minio_pool_id: mp.id,
vm_id: create_vm.id,
index: 0
)
mc
}
it "returns minio servers properly" do
expect(mc.servers.map(&:index)).to eq([0])
end
it "returns per pool storage size properly" do
expect(mc.storage_size_gib).to eq(100)
end
it "returns per pool server count properly" do
expect(mc.server_count).to eq(1)
end
it "returns per pool driver count properly" do
expect(mc.drive_count).to eq(1)
end
it "returns connection strings properly" do
expect(mc.servers.first.vm).to receive(:ephemeral_net4).and_return("1.1.1.1")
expect(mc.ip4_urls).to eq(["https://1.1.1.1:9000"])
end
end