Helm/OpenSearch: Difference between revisions
Jump to navigation
Jump to search
(Created page with " helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update && helm repo list kubectl config get-contexts ==Config== <syntaxhighlight lang="properties"> export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" export KUBECONFIG="${HOME}/.kube/config" </syntaxhighlight> ==Install== {| |valign="top"| <syntaxhighlight lang="bash"> helm show values opensearch/opensearch --version=1.4.0|less helm show value...") |
|||
Line 256: | Line 256: | ||
* [https://artifacthub.io/packages/helm/bitnami/opensearch Helm » OpenSearch] | * [https://artifacthub.io/packages/helm/bitnami/opensearch Helm » OpenSearch] | ||
* [[Helm/GitLab|Helm » GitLab]] | * [[Helm/GitLab|Helm » GitLab]] | ||
* [[Helm/Solr|Helm » Solr]] | |||
* [[Helm]] | * [[Helm]] | ||
Revision as of 00:58, 16 December 2024
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
helm show values opensearch/opensearch --version=1.4.0|less
helm show values opensearch/opensearch --version=1.5.0|less
kubectl get ns|grep opensearch
kubectl delete ns opensearch
kubectl create ns opensearch
|
kubectl -n=opensearch create secret generic opensearch \
--from-literal=opensearch-dashboards-password=sadaqah! \
--from-literal=opensearch-password=sadaqah! \
--from-literal=logstash-password=sadaqah! \
--dry-run=client -o=yaml \
| kubectl apply -f=-
|
| |
cat <<ENV | kubectl -n=opensearch create secret generic opensearch --from-env-file=/dev/stdin
opensearch-dashboards-password=sadaqah!
opensearch-password=sadaqah!
logstash-password=sadaqah!
ENV
| |
| |
cat << YML | kubectl -n=opensearch apply -f=-
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-opensearch
spec:
persistentVolumeReclaimPolicy: Retain
storageClassName: standard
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/hostpath-provisioner/opensearch/pvc-opensearch
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: opensearch
name: pvc-opensearch
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
volumeName: pv-opensearch
YML
|
cat << YML | kubectl -n=opensearch apply -f=-
---
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: opensearch
name: pvc-opensearch
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
YML
|
| |
PV_NAME="$(kubectl -n=opensearch get pvc pvc-opensearch -o=yaml|yq -r .spec.volumeName)"
cat <<YML |kubectl -n=opensearch patch pv ${PV_NAME} --patch-file=/dev/stdin
---
spec:
persistentVolumeReclaimPolicy: Retain
YML
| |
| |
cat <<YML | helm -n=opensearch install opensearch opensearch/opensearch --version=1.5.0 -f=-
---
ingress:
path: /
hosts:
- opensearch.k8s.local
ingressClassName: nginx
enabled: true
replicas: 1
nodeGroup: master
clusterName: opensearch
nameOverride: opensearch
fullnameOverride: opensearch
masterService: opensearch-master
YML
| |
| |
xdg-open http://opensearch.k8s.local &>/dev/null &
gnome-open http://opensearch.k8s.local &>/dev/null &
|
x-www-browser http://opensearch.k8s.local &>/dev/null &
sensible-browser http://opensearch.k8s.local &>/dev/null &
|
Uninstall
helm uninstall -n=opensearch opensearch
kubectl delete namespace opensearch
Playground
helm -n=opensearch install opensearch opensearch/opensearch --version=1.4.0
helm -n=opensearch upgrade -i opensearch opensearch/opensearch --version=1.5.0
helm show values opensearch/opensearch --version=1.5.0|less
| |
| |
kubectl -n=opensearch exec -it svc/opensearch-master -c=fsgroup-volume -- sh
kubectl -n=opensearch exec -it svc/opensearch-master -c=opensearch -- sh
| |
| |
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=opensearch delete all --all
kubectl -n=opensearch delete ing --all
kubectl -n=opensearch delete sts --all
|
kubectl -n=opensearch delete svc --all
kubectl -n=opensearch delete pvc --all
kubectl -n=opensearch delete pv --all
|
| |
kubectl -n=opensearch rollout history deploy opensearch
kubectl -n=opensearch rollout restart deploy opensearch
kubectl -n=opensearch rollout status deploy opensearch
|
kubectl -n=opensearch logs -f svc/opensearch-master -c=opensearch
kubectl -n=opensearch exec -it svc/opensearch-master -- sh
kubectl -n=opensearch logs -f svc/opensearch-master
|
References
| ||
|