You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/03/24 16:36:25 UTC

[GitHub] [solr-operator] thelabdude commented on a change in pull request #241: Help for upgrading from v0.2.x to v0.3.0

thelabdude commented on a change in pull request #241:
URL: https://github.com/apache/solr-operator/pull/241#discussion_r600658981



##########
File path: hack/test-upgrade.sh
##########
@@ -0,0 +1,172 @@
+#!/usr/bin/env bash
+
+# Clear your kube environment
+kubectl delete crds --all; kubectl delete pvc --all; helm delete solr-operator apache
+helm ls -a --all-namespaces | awk 'NR > 1 { print  "-n "$2, $1}' | xargs -L1 helm delete
+
+helm repo add apache-solr https://solr.apache.org/charts && helm repo update
+
+####
+##  Setup an environment using the v0.2.6 Solr Operator
+####
+
+# Install the Zookeeper Operator
+kubectl apply -f https://apache.github.io/solr-operator/example/dependencies/zk_operator.yaml
+
+# Install a past version of the Solr Operator
+helm install solr-operator apache-solr/solr-operator --version 0.2.6 --set ingressBaseDomain=localhost.com
+kubectl rollout status deployment/solr-operator
+
+# Install an out-of-date Solr Cloud
+cat <<EOF | kubectl apply -f -
+apiVersion: solr.bloomberg.com/v1beta1
+kind: SolrCloud
+metadata:
+  name: example
+spec:
+  dataPvcSpec:
+    resources:
+      requests:
+        storage: "5Gi"
+  replicas: 3
+  solrImage:
+    tag: 8.5.0
+  solrJavaMem: "-Xms1g -Xmx3g"
+  customSolrKubeOptions:
+    podOptions:
+      resources:
+        limits:
+          memory: "1G"
+        requests:
+          cpu: "65m"
+          memory: "156Mi"
+  zookeeperRef:
+    provided:
+      chroot: "/this/will/be/auto/created"
+      zookeeper:
+        persistence:
+          spec:
+            storageClassName: "hostpath"
+            resources:
+              requests:
+                storage: "5Gi"
+        replicas: 1
+        zookeeperPodPolicy:
+          resources:
+            limits:
+              memory: "1G"
+            requests:
+              cpu: "65m"
+              memory: "156Mi"
+EOF
+
+# Wait for solrcloud to be ready
+sleep 60
+kubectl rollout status statefulset/example-solrcloud
+
+# Install a SolrCollection and PrometheusExporter
+cat <<EOF | kubectl apply -f -
+apiVersion: solr.bloomberg.com/v1beta1
+kind: SolrCollection
+metadata:
+  name: example-collection-1
+spec:
+  solrCloud: example
+  collection: example-collection
+  routerName: compositeId
+  autoAddReplicas: false
+  numShards: 2
+  replicationFactor: 1
+  maxShardsPerNode: 1
+  collectionConfigName: "_default"
+---
+apiVersion: solr.bloomberg.com/v1beta1
+kind: SolrPrometheusExporter
+metadata:
+  name: example
+spec:
+  solrReference:
+    cloud:
+      name: "example"
+  numThreads: 4
+  image:
+    tag: 8.5.0
+EOF
+
+# Wait for solrmetrics to be ready
+sleep 5
+kubectl rollout status deployment/example-solr-metrics
+
+####
+##  Upgrade the Solr Operator to v0.2.8
+####
+helm upgrade solr-operator apache-solr/solr-operator --version 0.2.8 --set ingressBaseDomain=localhost.com
+
+kubectl replace -f https://raw.githubusercontent.com/apache/lucene-solr-operator/v0.2.8/helm/solr-operator/crds/crds.yaml
+
+
+
+# Wait until everything is up to date and the cluster is calm
+kubectl get solrcloud -w
+
+####
+
+####
+##  Install the Apache Solr Operator separately
+####
+# Build the Apache release (TODO: Change to release when it is cut)
+make docker-build
+helm dependency build helm/solr-operator
+
+# Uninstall Old ZK Operator
+echo "Deleting all Zookeeper Operator resources, except for CRDs" && \
+  kubectl delete deployment zk-operator && \

Review comment:
       I just did it independently of the solr-operator:
   ```
   helm upgrade --install zookeeper-operator pravega/zookeeper-operator \
     --version=0.2.9 --namespace=${NAMESPACE}
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org