Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Use ClusterIP service name for connecting to memcached #1618

Merged
merged 4 commits into from
Dec 27, 2018

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Dec 27, 2018

  • add an option to replace memcached headless service with ClusterIP in Helm chart
  • make Flux use the memcached ClusterIP name instead of SRV records when the memcached-service is set to string empty

Fix: #1591

Test image: stefanprodan/flux:mem-v5

PS. This is a breaking change in the Helm chart, using the new image with the old chart will not work since the old chart deploys memcached with a headless service

- replace memcached headless service with ClusterIP
- make Flux use the memcached ClusterIP name instead of SRV records
@squaremo
Copy link
Member

his is a breaking change in the Helm chart,

.. and probably in most people's deployments, for the same reason. This ought to require a change in arguments, so it doesn't break when the image is updated.

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest making it possible to tell fluxd to use the FixedServerMemcacheClient instead (and changing the example manifests and chart so they do that). Otherwise, this is a change that will break every deployment of fluxd.

// Since DNS returns records in different order each time, we sort to
// guarantee best possible match between nodes.
sort.Strings(servers)
servers := []string{fmt.Sprintf("%s:11211", c.hostname)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to change this; Use FixedServerMemcacheClient instead.

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right to me -- does it work? :-)

@@ -17,7 +17,7 @@ spec:
labels:
name: flux
spec:
serviceAccount: flux
serviceAccountName: flux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well caught

@stefanprodan
Copy link
Member Author

I've installed the chart with ClusterIP on and off, both are working fine. There is one caveat with helm upgrade since the ClusterIP field is immutable.

The upgrade fails with:

Error: UPGRADE FAILED: Service "flux-memcached" is invalid: spec.clusterIP: Invalid value: "": field is immutable

In order to fix the upgrade you need to delete the headless service upfront:

kubectl -n flux delete svc flux-memcached

@squaremo
Copy link
Member

There is one caveat with helm upgrade since the ClusterIP field is immutable.

OK -- we'll just need to flag this up in the chart release notes (and give it a minor version bump).

@stefanprodan
Copy link
Member Author

@squaremo I've added a note to the chart changelog with the upgrade instructions.

@stefanprodan stefanprodan merged commit 727fb81 into master Dec 27, 2018
@stefanprodan stefanprodan deleted the memcached-srv branch December 27, 2018 17:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants