Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jaeger] Elasticsearch chart migration #554

Merged

Conversation

dpericaxon
Copy link
Contributor

@dpericaxon dpericaxon commented Apr 10, 2024

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)

  • fixes #

Checklist

  • DCO signed
  • Commits are GPG signed
  • Chart Version bumped
  • Title of the PR starts with chart name ([jaeger] or [jaeger-operator])
  • README.md has been updated to match version/contain new values

@dpericaxon dpericaxon force-pushed the elasticsearch-chart-migration branch 3 times, most recently from 97b43ef to 8d11c17 Compare April 10, 2024 19:24
@dpericaxon dpericaxon changed the title Elasticsearch chart migration [jaeger] Elasticsearch chart migration Apr 10, 2024
@dpericaxon
Copy link
Contributor Author

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

@pavelnikolov
Copy link
Contributor

Could you, please, go through the PR checklist?

@dpericaxon
Copy link
Contributor Author

@pavelnikolov all set!

@pavelnikolov
Copy link
Contributor

Are your commits gpg signed?

@dpericaxon dpericaxon force-pushed the elasticsearch-chart-migration branch 2 times, most recently from 583b80e to a77cd99 Compare April 15, 2024 22:26
@dpericaxon
Copy link
Contributor Author

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
Copy link
Contributor

Is it possible to squash all the commits?

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

feat: Elasticsearch Bitnami Chart Migration to Support Elasticsearch 8

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

feat: Elasticsearch Bitnami Chart Migration to Support Elasticsearch 8

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

feat: Elasticsearch Bitnami Chart Migration to Support Elasticsearch 8

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

feat: Elasticsearch Bitnami Chart Migration to Support Elasticsearch 8

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

Revert Kafka version

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

quick lint test update

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

fix kubectl version

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>

fix chart-testing versions

Signed-off-by: dperic <108087612+dpericaxon@users.noreply.github.com>
@dpericaxon dpericaxon force-pushed the elasticsearch-chart-migration branch from a77cd99 to 5c52a7a Compare April 17, 2024 13:04
@dpericaxon
Copy link
Contributor Author

Done!

@pavelnikolov pavelnikolov merged commit 2e18693 into jaegertracing:main Apr 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants