Skip to content

Commit

Permalink
Set minimum Kubernetes version to v1.22 (#612)
Browse files Browse the repository at this point in the history
- Switch default solr version for e2e and smoke tests
- Up resources for e2e and smoke tests
  • Loading branch information
HoustonPutman authored Aug 31, 2023
1 parent 45665b5 commit da24cff
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
matrix:
go-version: [ '1.20' ]
kube-version: [ 'v1.21.14' ]
kube-version: [ 'v1.26.6' ]
solr-version: [ '9' ] # [ '8', '9' ]

steps:
Expand Down
2 changes: 1 addition & 1 deletion dev-docs/e2e-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $ make e2e-tests TEST_SEED=89724023 SOLR_IMAGE=apache/solr-nightly:10.0.0-SNAPSH
Default is `solr:8.11`.
- **KUBERETES_VERSION** - A full Kubernetes version, starting with `v`, to use when creating the KinD Cluster.
To find a list of all possible versions, check the [KinD Node Docker tags](https://hub.docker.com/r/kindest/node/tags).
Default is `v1.21.14`.
Default is `v1.26.6`.

### Filtering tests

Expand Down
8 changes: 7 additions & 1 deletion docs/upgrade-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ If you want to skip versions when upgrading, be sure to check out the [upgrading

### Kubernetes Versions

| Solr Operator Version | `1.15` | `1.16` - `1.18` | `1.19` - `1.20` | `1.21` | `1.22`+ |
| Solr Operator Version | `1.15` | `1.16` - `1.18` | `1.19` - `1.20` | `1.21` | `1.22`+ |
|:---------------------:| :---: | :---: |:------------------:|:------------------:|:------------------:|
| `v0.2.6` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
| `v0.2.7` | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: |
Expand All @@ -37,6 +37,7 @@ If you want to skip versions when upgrading, be sure to check out the [upgrading
| `v0.5.x` | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.6.x` | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.7.x` | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.8.x` | :x: | :x: | :x: | :x: | :heavy_check_mark: |

### Solr Versions

Expand All @@ -50,6 +51,7 @@ If you want to skip versions when upgrading, be sure to check out the [upgrading
| `v0.5.x` | :grey_question: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.6.x` | :grey_question: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.7.x` | :grey_question: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| `v0.8.x` | :grey_question: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |

Please note that this represents basic compatibility with the Solr Operator.
There may be options and features that require newer versions of Solr.
Expand Down Expand Up @@ -110,6 +112,10 @@ _Note that the Helm chart version does not contain a `v` prefix, which the downl
## Upgrade Warnings and Notes

### v0.8.0
- **Kubernetes support is now limited to 1.22+.**
If you are unable to use a newer version of Kubernetes, please install the `v0.7.1` version of the Solr Operator for use with Kubernetes `1.21`.
See the [version compatibility matrix](#kubernetes-versions) for more information.

- The new `SolrCloud.spec.scaling.vacatePodsOnScaleDown` option is enabled by default.
This means that any SolrCloud that has its `spec.replicas` decreased will have the replicas migrated off of the soon-to-be-deleted pods by default.
Set this value to `false` to retain the previous functionality.
Expand Down
29 changes: 15 additions & 14 deletions hack/release/smoke_test/test_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Test the release candidate in a Kind cluster
-l Base location of the staged artifacts. Can be a URL or relative or absolute file path.
-i Solr Operator docker image to use (Optional, defaults to apache/solr-operator:<version>)
-g GPG Key (fingerprint) used to sign the artifacts (Optional, if not provided then the helm chart will not be verified)
-k Kubernetes Version to test with (full tag, e.g. v1.21.2) (Optional, defaults to a compatible version)
-k Kubernetes Version to test with (full tag, e.g. v1.26.6) (Optional, defaults to a compatible version)
-t Full solr image, or image tag (for the official Solr image), to test with (e.g. apache/solr-nightly:9.0.0, 8.11). (Optional, defaults to a compatible version)
EOF
}
Expand Down Expand Up @@ -74,10 +74,10 @@ if [[ -z "${LOCATION:-}" ]]; then
echo "Specify an base artifact location -l, or through the LOCATION env var" >&2 && exit 1
fi
if [[ -z "${KUBERNETES_VERSION:-}" ]]; then
KUBERNETES_VERSION="v1.21.2"
KUBERNETES_VERSION="v1.26.6"
fi
if [[ -z "${SOLR_IMAGE:-}" ]]; then
SOLR_IMAGE="${SOLR_VERSION:-9.0}"
SOLR_IMAGE="${SOLR_VERSION:-8.11}"
fi
if [[ "${SOLR_IMAGE}" != *":"* ]]; then
SOLR_IMAGE="solr:${SOLR_IMAGE}"
Expand Down Expand Up @@ -170,13 +170,14 @@ helm install --kube-context "${KUBE_CONTEXT}" ${VERIFY_OR_NOT} solr-operator "${

printf "\nInstall a test Solr Cluster\n"
helm install --kube-context "${KUBE_CONTEXT}" ${VERIFY_OR_NOT} example "${SOLR_HELM_CHART}" \
--set replicas=3 \
--set replicas=2 \
--set image.repository="${SOLR_IMAGE%%:*}" \
--set-string image.tag="${SOLR_IMAGE##*:}" \
--set solrOptions.javaMemory="-Xms1g -Xmx3g" \
--set podOptions.resources.limits.memory="1G" \
--set podOptions.resources.requests.cpu="300m" \
--set podOptions.resources.requests.memory="512Mi" \
--set solrOptions.javaMemory="-Xms700m -Xmx700m" \
--set podOptions.resources.limits.cpu="500m" \
--set podOptions.resources.limits.memory="1Gi" \
--set podOptions.resources.requests.cpu="500m" \
--set podOptions.resources.requests.memory="1Gi" \
--set zk.provided.persistence.spec.resources.requests.storage="5Gi" \
--set zk.provided.replicas=1 \
--set "backupRepositories[0].name=local" \
Expand All @@ -186,8 +187,8 @@ helm install --kube-context "${KUBE_CONTEXT}" ${VERIFY_OR_NOT} example "${SOLR_H
remove_solr_helm_repo

# Wait for solrcloud to be ready
printf '\nWait for all 3 Solr nodes to become ready.\n\n'
grep -q "3 3 3 3" <(exec kubectl get solrcloud example -w); kill $!
printf '\nWait for all 2 Solr nodes to become ready.\n\n'
grep -q "2 2 2 2" <(exec kubectl get solrcloud example -w); kill $!

# Expose the common Solr service to localhost
kubectl port-forward service/example-solrcloud-common 18983:80 || true &
Expand All @@ -197,7 +198,7 @@ printf "\nCheck the admin URL to make sure it works\n"
curl --silent "http://localhost:18983/solr/admin/info/system" | grep '"status":0' > /dev/null

printf "\nCreating a test collection\n"
curl --silent "http://localhost:18983/solr/admin/collections?action=CREATE&name=smoke-test&replicationFactor=2&numShards=1" | grep '"status":0' > /dev/null
curl --silent "http://localhost:18983/solr/admin/collections?action=CREATE&name=smoke-test&replicationFactor=1&numShards=2" | grep '"status":0' > /dev/null

printf "\nQuery the test collection, test for 0 docs\n"
curl --silent "http://localhost:18983/solr/smoke-test/select" | grep '\"numFound\":0' > /dev/null
Expand Down Expand Up @@ -293,11 +294,11 @@ add_solr_helm_repo
helm upgrade --kube-context "${KUBE_CONTEXT}" ${VERIFY_OR_NOT} example "${SOLR_HELM_CHART}" --reuse-values \
--set-string podOptions.annotations.restart="true"
printf '\nWait for the rolling restart to begin.\n\n'
grep -q "3 [[:digit:]] [[:digit:]] 0" <(exec kubectl get solrcloud example -w); kill $!
grep -q "2 [[:digit:]] [[:digit:]] 0" <(exec kubectl get solrcloud example -w); kill $!
remove_solr_helm_repo

printf '\nWait 5 minutes for all 3 Solr nodes to become ready.\n\n'
grep -q "3 3 3 3" <(exec kubectl get solrcloud example -w --request-timeout 300); kill $!
printf '\nWait 5 minutes for all 2 Solr nodes to become ready.\n\n'
grep -q "2 2 2 2" <(exec kubectl get solrcloud example -w --request-timeout 300); kill $!

# Need a new port-forward, since the last one will have broken due to all pods restarting
kubectl port-forward service/example-solrcloud-common 28983:80 || true &
Expand Down
9 changes: 8 additions & 1 deletion helm/solr-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: solr-operator
description: The Solr Operator enables easy management of Solr resources within Kubernetes.
version: 0.8.0-prerelease
appVersion: v0.8.0-prerelease
kubeVersion: ">= 1.21.0-0"
kubeVersion: ">= 1.22.0-0"
home: https://solr.apache.org/operator
sources:
- https://github.com/apache/solr-operator
Expand Down Expand Up @@ -54,6 +54,13 @@ annotations:
# Add change log for a single release here.
# Allowed syntax is described at: https://artifacthub.io/docs/topics/annotations/helm/#example
artifacthub.io/changes: |
- kind: changed
description: The minimum supported version of Kubernetes is now v1.22
links:
- name: Github Issue
url: https://github.com/apache/solr-operator/issues/604
- name: Github PR
url: https://github.com/apache/solr-operator/pull/612
- kind: added
description: Ability to customize the SecurityContext for the solr-operator pod
links:
Expand Down
2 changes: 1 addition & 1 deletion helm/solr/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: solr
description: A SolrCloud cluster running on Kubernetes via the Solr Operator
version: 0.8.0-prerelease
appVersion: 8.11.1
kubeVersion: ">= 1.21.0-0"
kubeVersion: ">= 1.22.0-0"
home: https://solr.apache.org
sources:
- https://github.com/apache/solr
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/test_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,12 @@ func generateBaseSolrCloud(replicas int) *solrv1beta1.SolrCloud {
},
},
// This seems to be the lowest memory & CPU that allow the tests to pass
SolrJavaMem: "-Xms512m -Xmx512m",
SolrJavaMem: "-Xms700m -Xmx700m",
CustomSolrKubeOptions: solrv1beta1.CustomSolrKubeOptions{
PodOptions: &solrv1beta1.PodOptions{
Resources: corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceMemory: resource.MustParse("600Mi"),
corev1.ResourceMemory: resource.MustParse("1Gi"),
corev1.ResourceCPU: resource.MustParse("1"),
},
},
Expand Down
6 changes: 3 additions & 3 deletions tests/scripts/manage_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Available actions are: run-tests, create-cluster, destroy-cluster, kubeconfig
-h Display this help and exit
-i Solr Operator docker image to use (Optional, defaults to apache/solr-operator:<version>)
-k Kubernetes Version to test with (full tag, e.g. v1.21.2) (Optional, defaults to a compatible version)
-k Kubernetes Version to test with (full tag, e.g. v1.24.16) (Optional, defaults to a compatible version)
-s Full solr image, or image tag (for the official Solr image), to test with (e.g. apache/solr-nightly:9.0.0, 8.11). (Optional, defaults to a compatible version)
-a Load additional local images into the test Kubernetes cluster. Provide option multiple times for multiple images. (Optional)
EOF
Expand Down Expand Up @@ -73,10 +73,10 @@ if [[ -z "${OPERATOR_IMAGE:-}" ]]; then
echo "Specify a Docker image for the Solr Operator through -i, or through the OPERATOR_IMAGE env var" >&2 && exit 1
fi
if [[ -z "${KUBERNETES_VERSION:-}" ]]; then
KUBERNETES_VERSION="v1.21.14"
KUBERNETES_VERSION="v1.26.6"
fi
if [[ -z "${SOLR_IMAGE:-}" ]]; then
SOLR_IMAGE="${SOLR_VERSION:-8.11}"
SOLR_IMAGE="${SOLR_VERSION:-9.3}"
fi
if [[ "${SOLR_IMAGE}" != *":"* ]]; then
SOLR_IMAGE="solr:${SOLR_IMAGE}"
Expand Down

0 comments on commit da24cff

Please sign in to comment.