-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make pod topologySpreadConstraints configurable (#66)
Fixes #65 More info https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
- qdrant-1.12.5
- qdrant-1.12.4
- qdrant-1.12.3
- qdrant-1.12.2
- qdrant-1.12.1
- qdrant-1.12.0
- qdrant-1.11.5
- qdrant-1.11.4
- qdrant-1.11.3
- qdrant-1.11.2
- qdrant-1.11.1
- qdrant-1.11.0
- qdrant-0.10.1
- qdrant-0.10.0
- qdrant-0.9.4
- qdrant-0.9.3
- qdrant-0.9.2
- qdrant-0.9.1
- qdrant-0.9.0
- qdrant-0.8.5
- qdrant-0.8.4
- qdrant-0.8.3
- qdrant-0.8.2
- qdrant-0.8.1
- qdrant-0.8.0
- qdrant-0.7.6
- qdrant-0.7.5
- qdrant-0.7.4
- qdrant-0.7.3
- qdrant-0.7.2
- qdrant-0.7.1
- qdrant-0.7.0
- qdrant-0.6.1
- qdrant-0.6.0
- qdrant-0.5.1
- qdrant-0.5.0
- qdrant-0.4.1
- qdrant-0.4.0
1 parent
dfff7fa
commit 17ab935
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package test | ||
|
||
import ( | ||
"path/filepath" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/gruntwork-io/terratest/modules/helm" | ||
"github.com/gruntwork-io/terratest/modules/k8s" | ||
"github.com/gruntwork-io/terratest/modules/logger" | ||
"github.com/gruntwork-io/terratest/modules/random" | ||
"github.com/stretchr/testify/require" | ||
appsv1 "k8s.io/api/apps/v1" | ||
) | ||
|
||
func TestTopologySpreadConstraints(t *testing.T) { | ||
t.Parallel() | ||
|
||
helmChartPath, err := filepath.Abs("../charts/qdrant") | ||
releaseName := "qdrant" | ||
require.NoError(t, err) | ||
|
||
namespaceName := "qdrant-" + strings.ToLower(random.UniqueId()) | ||
logger.Log(t, "Namespace: %s\n", namespaceName) | ||
|
||
options := &helm.Options{ | ||
SetJsonValues: map[string]string{ | ||
"topologySpreadConstraints": `[{"maxSkew":1,"topologyKey":"kubernetes.io/hostname","whenUnsatisfiable":"DoNotSchedule","labelSelector":{"matchLabels":{"app":"qdrant"}}}]`, | ||
}, | ||
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName), | ||
} | ||
|
||
output := helm.RenderTemplate(t, options, helmChartPath, releaseName, []string{"templates/statefulset.yaml"}) | ||
|
||
var statefulSet appsv1.StatefulSet | ||
helm.UnmarshalK8SYaml(t, output, &statefulSet) | ||
|
||
require.Equal(t, 1, len(statefulSet.Spec.Template.Spec.TopologySpreadConstraints)) | ||
require.Equal(t, int32(1), statefulSet.Spec.Template.Spec.TopologySpreadConstraints[0].MaxSkew) | ||
} |