Helm/Solr

From Chorke Wiki
Revision as of 10:56, 11 December 2024 by Shahed (talk | contribs) (→‎Playground)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
helm repo add apache-solr https://solr.apache.org/charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update && helm repo list
kubectl config get-contexts

Config

export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"

Install

kubectl get ns|grep solr
kubectl delete ns   solr
kubectl get ns|grep solr
kubectl create ns   solr

kubectl create -f https://solr.apache.org/operator/downloads/crds/v0.8.1/all-with-dependencies.yaml
helm -n solr install solr-operator apache-solr/solr-operator --version=0.8.1

cat <<YML | helm -n solr install    solr apache-solr/solr --version=0.8.1 -f -
---
image:
  tag: 8.11.2
fullnameOverride: solr
ingressOptions:
  ingressClassName: nginx
addressability:
  external:
    method: Ingress
    domainName: k8s.local
    useExternalAddress: true
solrOptions:
  javaMemory: "-Xms300m -Xmx300m"
replicas: 1
zk:
  provided:
    replicas: 1
YML

cat << YML | kubectl apply -n solr -f -
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: solr
  namespace: solr
  labels:
    app.kubernetes.io/managed-by: kubectl
    app.kubernetes.io/version: 8.11.1
    app.kubernetes.io/instance: solr
    app.kubernetes.io/name: solr
spec:
  ingressClassName: nginx
  rules:
    - host: "solr.k8s.local"
      http:
        paths:
          - path: /
            pathType: ImplementationSpecific
            backend:
              service:
                name: solr-solrcloud-common
                port:
                  number: 80
YML

xdg-open http://solr.k8s.local &>/dev/null &
gnome-open http://solr.k8s.local &>/dev/null &
x-www-browser http://solr.k8s.local &>/dev/null &
sensible-browser http://solr.k8s.local &>/dev/null &

Uninstall

helm -n solr uninstall   solr
kubectl delete namespace solr

kubectl get crd|grep solr.apache.org
kubectl get crd|grep zookeeper.pravega.io

kubectl delete crd solrbackups.solr.apache.org
kubectl delete crd solrclouds.solr.apache.org
kubectl delete crd solrprometheusexporters.solr.apache.org
kubectl delete crd zookeeperclusters.zookeeper.pravega.io

Playground

helm -n solr install    solr apache-solr/solr --version=0.8.0
helm -n solr upgrade -i solr apache-solr/solr --version=0.8.1
helm show values apache-solr/solr --version=0.8.1|less

kubectl -n solr get configmap solr-solrcloud-zookeeper-configmap -o json|jq -r '.data."log4j-quiet.properties"'
kubectl -n solr get configmap solr-solrcloud-zookeeper-configmap -o json|jq -r '.data."log4j.properties"'
kubectl -n solr get configmap solr-solrcloud-zookeeper-configmap -o json|jq -r '.data."zoo.cfg"'
kubectl -n solr get configmap solr-solrcloud-zookeeper-configmap -o json|jq -r '.data."env.sh"'
kubectl -n solr get configmap solr-solrcloud-configmap -o json|jq -r '.data."solr.xml"'

kubectl -n solr logs -f svc/solr-solrcloud-zookeeper-headless -c zookeeper
kubectl -n solr logs -f svc/solr-solrcloud-zookeeper-client -c zookeeper
kubectl -n solr logs -f svc/solr-solrcloud-common -c solrcloud-node
kubectl -n solr logs -f svc/solr-solrcloud-0 -c solrcloud-node

kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten

kubectl -n solr delete all --all
kubectl -n solr delete ing --all
kubectl -n solr delete sts --all
kubectl -n solr delete svc --all
kubectl -n solr delete pvc --all
kubectl -n solr delete pv  --all

kubectl -n solr rollout status  sts solr-solrcloud-zookeeper
kubectl -n solr rollout history sts solr-solrcloud
kubectl -n solr rollout restart sts solr-solrcloud
kubectl -n solr logs -f svc/solr-solrcloud-zookeeper-client -c zookeeper
kubectl -n solr logs -f svc/solr-solrcloud-common -c solrcloud-node
kubectl -n solr logs -f svc/solr-solrcloud-0 -c solrcloud-node

References