Helm/OpenSearch: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 15: | Line 15: | ||
|valign="top"| | |valign="top"| | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
helm show values bitnami/opensearch --version=1.5.0|less | helm show values bitnami/opensearch --version=1.5.0|less | ||
helm show values bitnami/opensearch --version=1.5.1|less | |||
kubectl get ns|grep opensearch | kubectl get ns|grep opensearch | ||
Line 140: | Line 140: | ||
|colspan="2"| | |colspan="2"| | ||
<syntaxhighlight lang="yaml"> | <syntaxhighlight lang="yaml"> | ||
cat <<YML | helm -n=opensearch install opensearch bitnami/opensearch --version=1.5. | cat <<YML | helm -n=opensearch install opensearch bitnami/opensearch --version=1.5.1 -f=- | ||
--- | --- | ||
ingress: | ingress: | ||
Line 147: | Line 147: | ||
ingressClassName: nginx | ingressClassName: nginx | ||
enabled: true | enabled: true | ||
security: | |||
existingSecret: opensearch | |||
master: | master: | ||
masterOnly: false | |||
replicaCount: 1 | replicaCount: 1 | ||
data: | |||
replicaCount: 0 | |||
ingest: | ingest: | ||
replicaCount: | replicaCount: 0 | ||
coordinating: | coordinating: | ||
replicaCount: | replicaCount: 0 | ||
YML | YML | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 186: | Line 189: | ||
| colspan="2" | | | colspan="2" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
helm -n=opensearch install opensearch bitnami/opensearch --version=1. | helm -n=opensearch install opensearch bitnami/opensearch --version=1.5.0 | ||
helm -n=opensearch upgrade -i opensearch bitnami/opensearch --version=1.5. | helm -n=opensearch upgrade -i opensearch bitnami/opensearch --version=1.5.1 | ||
helm show values bitnami/opensearch --version=1.5. | helm show values bitnami/opensearch --version=1.5.1|less | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 197: | Line 200: | ||
| colspan="2" | | | colspan="2" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n=opensearch exec -it svc/opensearch -c=opensearch- | kubectl -n=opensearch exec -it svc/opensearch -c=opensearch -- bash | ||
kubectl -n=opensearch exec -it svc/opensearch -c=opensearch | kubectl -n=opensearch exec -it svc/opensearch -c=opensearch -- sh | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 237: | Line 240: | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n=opensearch rollout history | kubectl -n=opensearch rollout history sts opensearch-master | ||
kubectl -n=opensearch rollout restart | kubectl -n=opensearch rollout restart sts opensearch-master | ||
kubectl -n=opensearch rollout status | kubectl -n=opensearch rollout status sts opensearch-master | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| valign="top" | | | valign="top" | | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n=opensearch | kubectl -n=opensearch exec -it svc/opensearch -c=opensearch -- bash | ||
kubectl -n=opensearch | kubectl -n=opensearch logs -f svc/opensearch -c=opensearch | ||
kubectl -n=opensearch logs -f svc/opensearch | kubectl -n=opensearch logs -f svc/opensearch | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 22:41, 17 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 bitnami/opensearch --version=1.5.0|less
helm show values bitnami/opensearch --version=1.5.1|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 bitnami/opensearch --version=1.5.1 -f=-
---
ingress:
path: /
hostname: opensearch.k8s.local
ingressClassName: nginx
enabled: true
security:
existingSecret: opensearch
master:
masterOnly: false
replicaCount: 1
data:
replicaCount: 0
ingest:
replicaCount: 0
coordinating:
replicaCount: 0
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 bitnami/opensearch --version=1.5.0
helm -n=opensearch upgrade -i opensearch bitnami/opensearch --version=1.5.1
helm show values bitnami/opensearch --version=1.5.1|less
| |
| |
kubectl -n=opensearch exec -it svc/opensearch -c=opensearch -- bash
kubectl -n=opensearch exec -it svc/opensearch -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 sts opensearch-master
kubectl -n=opensearch rollout restart sts opensearch-master
kubectl -n=opensearch rollout status sts opensearch-master
|
kubectl -n=opensearch exec -it svc/opensearch -c=opensearch -- bash
kubectl -n=opensearch logs -f svc/opensearch -c=opensearch
kubectl -n=opensearch logs -f svc/opensearch
|
References
| ||
|