-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Cassandra 4.0 beta images #378
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// Copyright DataStax, Inc. | ||
// Please see the included license file for details. | ||
|
||
package smoke_test_4x | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
ginkgo_util "github.com/datastax/cass-operator/mage/ginkgo" | ||
"github.com/datastax/cass-operator/mage/kubectl" | ||
) | ||
|
||
var ( | ||
testName = "Smoke test of basic functionality for one-node OSS Cassandra 4.x cluster." | ||
namespace = "test-smoke-test-4x" | ||
dcName = "dc2" | ||
dcYaml = "../testdata/smoke-test-4x.yaml" | ||
operatorYaml = "../testdata/operator.yaml" | ||
dcResource = fmt.Sprintf("CassandraDatacenter/%s", dcName) | ||
dcLabel = fmt.Sprintf("cassandra.datastax.com/datacenter=%s", dcName) | ||
ns = ginkgo_util.NewWrapper(testName, namespace) | ||
) | ||
|
||
func TestLifecycle(t *testing.T) { | ||
AfterSuite(func() { | ||
logPath := fmt.Sprintf("%s/aftersuite", ns.LogDir) | ||
kubectl.DumpAllLogs(logPath).ExecV() | ||
fmt.Printf("\n\tPost-run logs dumped at: %s\n\n", logPath) | ||
ns.Terminate() | ||
}) | ||
|
||
RegisterFailHandler(Fail) | ||
RunSpecs(t, testName) | ||
} | ||
|
||
var _ = Describe(testName, func() { | ||
Context("when in a new cluster", func() { | ||
Specify("the operator can stand up a one node cluster", func() { | ||
By("creating a namespace") | ||
err := kubectl.CreateNamespace(namespace).ExecV() | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
step := "setting up cass-operator resources via helm chart" | ||
ns.HelmInstall("../../charts/cass-operator-chart") | ||
|
||
step = "waiting for the operator to become ready" | ||
json := "jsonpath={.items[0].status.containerStatuses[0].ready}" | ||
k := kubectl.Get("pods"). | ||
WithLabel("name=cass-operator"). | ||
WithFlag("field-selector", "status.phase=Running"). | ||
FormatOutput(json) | ||
ns.WaitForOutputAndLog(step, k, "true", 360) | ||
|
||
step = "creating a datacenter resource with 1 rack/1 node" | ||
k = kubectl.ApplyFiles(dcYaml) | ||
ns.ExecAndLog(step, k) | ||
|
||
ns.WaitForDatacenterReady(dcName) | ||
|
||
step = "deleting the dc" | ||
k = kubectl.DeleteFromFiles(dcYaml) | ||
ns.ExecAndLog(step, k) | ||
|
||
step = "checking that the dc no longer exists" | ||
json = "jsonpath={.items}" | ||
k = kubectl.Get("CassandraDatacenter"). | ||
WithLabel(dcLabel). | ||
FormatOutput(json) | ||
ns.WaitForOutputAndLog(step, k, "[]", 600) | ||
|
||
step = "checking that no dc pods remain" | ||
json = "jsonpath={.items}" | ||
k = kubectl.Get("pods"). | ||
WithLabel(dcLabel). | ||
FormatOutput(json) | ||
ns.WaitForOutputAndLog(step, k, "[]", 600) | ||
|
||
step = "checking that no dc services remain" | ||
json = "jsonpath={.items}" | ||
k = kubectl.Get("services"). | ||
WithLabel(dcLabel). | ||
FormatOutput(json) | ||
ns.WaitForOutputAndLog(step, k, "[]", 600) | ||
|
||
step = "checking that no dc stateful sets remain" | ||
json = "jsonpath={.items}" | ||
k = kubectl.Get("statefulsets"). | ||
WithLabel(dcLabel). | ||
FormatOutput(json) | ||
ns.WaitForOutputAndLog(step, k, "[]", 600) | ||
}) | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: cassandra.datastax.com/v1beta1 | ||
kind: CassandraDatacenter | ||
metadata: | ||
name: dc2 | ||
spec: | ||
clusterName: cluster2 | ||
serverType: cassandra | ||
serverVersion: "4.0-beta4" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will the config builder accept this string? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That I'm not sure. I'll check it out and see. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on my initial testing it does not appear that changes are needed in the config builder. For reference I am testing with this k8ssandra branch k8ssandra/k8ssandra#336. The medusa image changes have not been merged yet, so I built the medusa image from source my branch here https://github.com/jsanda/cassandra-medusa/tree/reduce_docker_filesize. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My cassandra pods are in the ready state but there are some problems. Here is what happened when I tried to run
@jimdickinson do you think this is config builder related? |
||
serverImage: "datastax/cassandra-mgmtapi-4_0_0:v0.1.20" | ||
managementApiAuth: | ||
insecure: {} | ||
size: 1 | ||
storageConfig: | ||
cassandraDataVolumeClaimSpec: | ||
storageClassName: server-storage | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 250Mi | ||
racks: | ||
- name: r1 | ||
config: | ||
jvm-server-options: | ||
initial_heap_size: "800m" | ||
max_heap_size: "800m" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great idea