Skip to content

Commit

Permalink
*: some fixes for e2e test on krane-based k8s (#443)
Browse files Browse the repository at this point in the history
**change resources for `deploy/k8s/dev`**
To test the Varlog in a Krane-based cluster, the size of the cluster
should be at least 20 nodes. Recommended numbers are as follows: the
number of MRs is three and the number of SNs is 3 or 4 and the
replication factor is 3.

**daemonset doesn't respect podAntiAffinity**
See kubernetes/kubernetes#29276.
We should attach label `varlog-type=telemetry` to nodes running
jaeger, prometheus, otel-collector and grafana. Daemonset for MR and SN
won't be deployed to those nodes. The e2e testing module ignores nodes
labed with `varlog-type=telemetry`.

Resolves [#VARLOG-509](VARLOG-509).
  • Loading branch information
ijsong authored and GitHub Enterprise committed Jul 12, 2021
1 parent 406bc02 commit 1e1d275
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/e2e/e2e_long_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import (
func TestK8sVarlogAppendLongTime(t *testing.T) {
const (
testTimeout = 15 * time.Minute
numRepFactor = 2
numRepFactor = 3
numMRs = 3
numSNs = 2
numLSs = 1
numClients = 50
numSNs = 9
numLSs = 3
numClients = 10
clusterID = types.ClusterID(1)
)

Expand Down
18 changes: 16 additions & 2 deletions test/e2e/k8s_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const (
IngressNginxNamespace = "ingress-nginx"

ENV_REP_FACTOR = "REP_FACTOR"

// telemetry
TelemetryLabelValue = "telemetry"
)

type K8sVarlogPodGetter interface {
Expand Down Expand Up @@ -444,7 +447,10 @@ func (k8s *K8sVarlogCluster) RemoveLabelAll() (err error) {
}

for _, node := range nodes.Items {
if _, ok := node.Labels[TypeLabelKey]; ok {
if labelValue, ok := node.Labels[TypeLabelKey]; ok {
if labelValue == TelemetryLabelValue {
continue
}
if erri := k8s.RemoveLabel(node.GetName(), TypeLabelKey); erri != nil {
err = multierr.Append(err, erri)
}
Expand Down Expand Up @@ -582,6 +588,14 @@ func (k8s *K8sVarlogCluster) clearMRDatas() error {
return err
}

targetNodes := 0
for _, node := range nodes.Items {
if _, ok := node.Labels[TypeLabelKey]; ok {
continue
}
targetNodes++
}

for _, node := range nodes.Items {
if _, ok := node.Labels[TypeLabelKey]; ok {
continue
Expand All @@ -595,7 +609,7 @@ func (k8s *K8sVarlogCluster) clearMRDatas() error {

if err := testutil.CompareWaitErrorWithRetryIntervalN(1000, 10*time.Second, func() (bool, error) {
numPods, err := k8s.numPodsReady(VarlogNamespace, podSelector)
return numPods == len(nodes.Items), errors.Wrap(err, "k8s")
return numPods == targetNodes, errors.Wrap(err, "k8s")
}); err != nil {
return err
}
Expand Down

0 comments on commit 1e1d275

Please sign in to comment.