jaegertracing / helm-charts

Helm Charts for Jaeger backend
Apache License 2.0
254 stars 338 forks source link

[jaeger] Elasticsearch chart migration #554

Closed dpericaxon closed 2 months ago

dpericaxon commented 2 months ago

What this PR does

This PR changes the Elasticsearch helm chart to https://github.com/bitnami/charts/tree/main/bitnami/elasticsearch to migrate to a supported helm chart since the current one is deprecated. I bumped the major version since the helm chart is getting changed.

I was able to get this to work with the default settings. Out of the box Elasticsearch doesn't have auth support unless security.enabled is set.

To migrate existing workloads/data I was able to follow instructions on migrating the volumes to a new PVC thats created by the helm chart. This is similar to the Kafka migration that was done:

# Env variables
REPLICA=0
OLD_PVC="elasticsearch-master-elasticsearch-master-${REPLICA}"
NEW_PVC="data-elasticsearch-master-${REPLICA}"
PV_NAME=$(kubectl get pvc $OLD_PVC -o jsonpath="{.spec.volumeName}" -n <fill-in-namespace> )
NEW_PVC_MANIFEST_FILE="$NEW_PVC.yaml"

# Modify PV reclaim policy
kubectl patch pv $PV_NAME -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'
# Manually check field 'RECLAIM POLICY'
kubectl get pv $PV_NAME

# Create new PVC manifest
kubectl get pvc $OLD_PVC -n <fill-in-namespace> -o json | jq "
  .metadata.name = \"$NEW_PVC\"
  | with_entries(
      select([.key] |
        inside([\"metadata\", \"spec\", \"apiVersion\", \"kind\"]))
    )
  | del(
      .metadata.annotations, .metadata.creationTimestamp,
      .metadata.finalizers, .metadata.resourceVersion,
      .metadata.selfLink, .metadata.uid
    )
  " > $NEW_PVC_MANIFEST_FILE
# Check manifest
cat $NEW_PVC_MANIFEST_FILE

# Delete your old Statefulset and PVC
kubectl delete sts "elasticsearch-master" -n <fill-in-namespace>
kubectl delete pvc $OLD_PVC -n <fill-in-namespace>
# Make PV available again and create the new PVC
kubectl patch pv $PV_NAME -p '{"spec":{"claimRef": null}}' -n <fill-in-namespace>
kubectl apply -f $NEW_PVC_MANIFEST_FILE -n <fill-in-namespace>

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Checklist

dpericaxon commented 2 months ago

Hmm, not sure why that check is failing. It seems to render fine. It looks like its complaining about this line

pavelnikolov commented 2 months ago

Could you, please, go through the PR checklist?

dpericaxon commented 2 months ago

@pavelnikolov all set!

pavelnikolov commented 2 months ago

Are your commits gpg signed?

dpericaxon commented 2 months ago

I just went through and made sure they were all signed. I'm not sure why the first commit isn't updating though:

image
pavelnikolov commented 2 months ago

Is it possible to squash all the commits?

dpericaxon commented 2 months ago

Done!