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

✨(playbook) introduce static services #427

Merged
merged 2 commits into from
Feb 4, 2021

Conversation

madmatah
Copy link
Contributor

@madmatah madmatah commented Jan 8, 2020

Purpose

As explained in #417 , the current blue/green deployment mechanism adds a suffix (deployment stamp) to the name of the services exposed by applications.

This has raised several issues because it is not possible to use service names in the settings of another app because the name will change as soon as the service is redeployed.

Proposal

Services with suffixes are helpful because they allow components of a deployed application to communicate with each other while also ensuring that the application stack is consistent within the same version.

I propose to keep them, otherwise each component of an application must be aware of their current state (green or blue) to communicate with other components. And it's hard to do that without any reconfiguration during a switch between blue/green version. We don't want that.

In addition to the current mechanism, I propose to introduce "static services".
Each static service is declined in 3 versions (service-previous, service-current and service-next) that points to the right version of a deployment.

It can be used by another application because its name doesn't change.

The switch (or any deployment related task) is now patching static services instead of routes.
Routes are now pointing to the corresponding service (e.g., route A-previous points to service A-previous).

A static service can of course exist without any route.

There is a new playbook init_services.yml that initialize static services.
Static services are defined in files matching static-svc*.yml

TODO

Per application :

  • Update route templates
  • Add static service for each route
  • Add other static service if needed and patch applications using them.

@madmatah madmatah self-assigned this Jan 8, 2020
@madmatah madmatah force-pushed the feature-static-services-blue-green branch 7 times, most recently from bb1f765 to b128520 Compare January 9, 2020 13:56
create_services.yml Show resolved Hide resolved
tasks/create_static_services.yml Outdated Show resolved Hide resolved
@madmatah madmatah force-pushed the feature-static-services-blue-green branch 2 times, most recently from b760d3a to 5d958b0 Compare January 14, 2020 13:35
@madmatah
Copy link
Contributor Author

FYI I've not removed the forum route.

I propose to do that later to ease the migration process.

@madmatah madmatah changed the title WIP: ✨(playbook) introduce static services ✨(playbook) introduce static services Jan 14, 2020
@madmatah madmatah added needs review and removed WIP labels Jan 14, 2020
@madmatah madmatah force-pushed the feature-static-services-blue-green branch 2 times, most recently from 8285c50 to 43fc5e8 Compare January 14, 2020 14:05
@madmatah madmatah added WIP and removed needs review labels Jan 14, 2020
@madmatah madmatah changed the title ✨(playbook) introduce static services WIP: ✨(playbook) introduce static services Jan 14, 2020
@madmatah madmatah force-pushed the feature-static-services-blue-green branch from 43fc5e8 to b655429 Compare January 14, 2020 15:53
@madmatah madmatah changed the title WIP: ✨(playbook) introduce static services ✨(playbook) introduce static services Jan 14, 2020
@madmatah madmatah added needs review and removed WIP labels Jan 14, 2020
@madmatah madmatah requested review from jmaupetit and lunika January 14, 2020 16:39
@madmatah madmatah force-pushed the feature-static-services-blue-green branch from b655429 to 03adc8a Compare January 15, 2020 16:02
Copy link
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

I would have preferred substituting existing SVCs by static ones without introducing a new semantic / object. Do you think we must keep B/G SVCs?

@madmatah madmatah force-pushed the feature-static-services-blue-green branch 2 times, most recently from 29a4d0d to 9c0c93f Compare January 29, 2020 14:51
@madmatah
Copy link
Contributor Author

I'm afraid you need to copy the explanations in your PR description to a documentation somewhere in the project!

@sampaccoud
I added basic documentation about supported kubernetes/openshift entities in docs/developer_guide/concepts.md.

I described static services and their purpose inside.

docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
@madmatah madmatah force-pushed the feature-static-services-blue-green branch 4 times, most recently from 2bdf11b to fc61811 Compare January 30, 2020 15:57
@madmatah
Copy link
Contributor Author

I just added an Upgrade.md file to document the upgrade process.

Upgrade.md Outdated Show resolved Hide resolved
Upgrade.md Outdated Show resolved Hide resolved
Upgrade.md Outdated Show resolved Hide resolved
Upgrade.md Show resolved Hide resolved
@madmatah madmatah force-pushed the feature-static-services-blue-green branch 2 times, most recently from 007db8d to 5e90464 Compare February 3, 2020 15:21
@madmatah
Copy link
Contributor Author

madmatah commented Feb 3, 2020

@lunika I patched deploy_patch_cronjob.yml because I had an error while testing the upgrade process after merging the cronjob feature.
Can you please review this part ?

@madmatah madmatah force-pushed the feature-static-services-blue-green branch from 5e90464 to 2499802 Compare January 28, 2021 10:34
@madmatah madmatah marked this pull request as draft January 28, 2021 10:35
@madmatah madmatah changed the base branch from master to migration-to-k8s February 1, 2021 17:50
@madmatah madmatah marked this pull request as ready for review February 1, 2021 17:53
@madmatah
Copy link
Contributor Author

madmatah commented Feb 1, 2021

I changed the base branch of this PR to target migration-to-k8s, the branch that we'll use to work on our Openshift to Kubernetes migration.

Maybe I should remove the Upgrade.md file because it's not relevant anymore.

@madmatah madmatah force-pushed the feature-static-services-blue-green branch from 2499802 to 4b34082 Compare February 3, 2021 15:01
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
docs/developer_guide/concepts.md Outdated Show resolved Hide resolved
switch.yml Outdated Show resolved Hide resolved
tasks/deploy_patch_static_service.yml Outdated Show resolved Hide resolved
tasks/deploy_patch_static_service.yml Show resolved Hide resolved
Add support  for static services, with  fixed name, in addition  to the services
deployed with  a deployment stamp in  their name. It allows  applications inside
the cluster to use the services exposed by other applications, with a consistent
fqdn.

BREAKING  CHANGE :  blue/green related  tasks are  now updating  static services
instead of routes
Add a static service for the forum elasticsearch, to be used easily by
other applications.
@madmatah madmatah force-pushed the feature-static-services-blue-green branch from 4b34082 to 2d9d1eb Compare February 4, 2021 08:19
@madmatah
Copy link
Contributor Author

madmatah commented Feb 4, 2021

@sampaccoud Thanks for your feedback, I just pushed all your suggestions!

Copy link
Contributor

@sampaccoud sampaccoud left a comment

Choose a reason for hiding this comment

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

Looks GTM. Just to make sure, mailcatcher and flower are not handled in this PR although they have routes. I suppose they have no B/G.

@madmatah
Copy link
Contributor Author

madmatah commented Feb 4, 2021

Looks GTM. Just to make sure, mailcatcher and flower are not handled in this PR although they have routes. I suppose they have no B/G.

@sampaccoud 🎉 🙏

About mailcatcher and flower app, your assumptions are correct, you can see in their vars/settings.yml the following :

is_blue_green_compatible: false

@madmatah madmatah merged commit 430b70e into migration-to-k8s Feb 4, 2021
@madmatah madmatah deleted the feature-static-services-blue-green branch February 4, 2021 09:32
@jmaupetit jmaupetit mentioned this pull request Oct 31, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants