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

Template and store replicas count as service configuration in Metalk8s cluster #2258

Conversation

Ebaneck
Copy link
Contributor

@Ebaneck Ebaneck commented Feb 25, 2020

Component:

'salt', 'charts',

Context:

See #2255

Summary:

Template and render the charts to consume service configuration values directly.

Acceptance criteria:


Closes: #2255

@bert-e
Copy link
Contributor

bert-e commented Feb 25, 2020

Hello ebaneck,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@Ebaneck Ebaneck requested a review from a team February 25, 2020 08:44
@bert-e
Copy link
Contributor

bert-e commented Feb 25, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Feb 25, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
@bert-e
Copy link
Contributor

bert-e commented Feb 25, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

import logging
import re

from salt.exceptions import CommandExecutionError
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please respect pylint import suggestion

C:  8, 0: third party import "import yaml" should be placed before "from salt.exceptions import CommandExecutionError" (wrong-import-order)

Copy link
Contributor

@slaperche-scality slaperche-scality Feb 25, 2020

Choose a reason for hiding this comment

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

Maybe we should setup pylint for Salt tree (or _modules at least)?
That would automatically flag unused import and import ordering.

That way we can enforce it in CI and focus our brain's bandwidth on functional issues.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree we should but we need some extra stuff about "salt" stuffs like all the __opts__ __salt__ __pillar__ ... but anyway agree we should have salt module checking in the CI so linting + unit test

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is something we really want to enforce, it would make sense to add it in CI. Especially since not everyone here uses pylint + the special Salt plugin to lint their Salt modules (I don't).

Copy link
Contributor

Choose a reason for hiding this comment

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

I thin there is a pylint plugin for Salt, otherwise we can simply ignore Salt stuff by tweaking Pylint conf (you can probably consider some stuff as blackbox).

Copy link
Collaborator

Choose a reason for hiding this comment

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

https://github.com/saltstack/salt-pylint (Personnaly never tested)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @jbertran tried it (but I may remember wrong)

buildchain/buildchain/salt_tree.py Outdated Show resolved Hide resolved
buildchain/buildchain/salt_tree.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
charts/render.py Outdated Show resolved Hide resolved
salt/_modules/metalk8s_service_configurator.py Outdated Show resolved Hide resolved
salt/_modules/metalk8s_service_configurator.py Outdated Show resolved Hide resolved
salt/_modules/metalk8s_service_configurator.py Outdated Show resolved Hide resolved
salt/metalk8s/addons/addons-service-config/configmap.sls Outdated Show resolved Hide resolved
salt/metalk8s/addons/addons-service-config/configmap.sls Outdated Show resolved Hide resolved
salt/metalk8s/addons/addons-service-config/deployed.sls Outdated Show resolved Hide resolved
@bert-e
Copy link
Contributor

bert-e commented Feb 25, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch 3 times, most recently from c1b9b89 to 2afbfcf Compare February 25, 2020 22:18
@Ebaneck Ebaneck changed the title WIP: Template and store replicas count as service configuration in Metalk8s cluster Template and store replicas count as service configuration in Metalk8s cluster Feb 25, 2020
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch 3 times, most recently from dd39d83 to e5c6401 Compare February 26, 2020 07:15
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch 2 times, most recently from c4bf2ef to 71257ae Compare February 26, 2020 12:29
@Ebaneck Ebaneck marked this pull request as ready for review February 26, 2020 12:44
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch from 71257ae to 0d02d6e Compare February 26, 2020 14:11
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch 2 times, most recently from da93185 to fb7a2f4 Compare February 27, 2020 10:52
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch from fb7a2f4 to d4aa36c Compare February 27, 2020 11:14
Ebaneck and others added 5 commits February 27, 2020 14:19
…uster

Initially, we do not deploy and manage service configurations using
configmaps.

This commit adds generic configmaps with service related configurations
such that the end user can configure cluster settings directly by editing
the related configmaps
This commit adds a salt module used to query a configmap object
within a metalk8s cluster

Once called with a service config parameter, this module returns
the value of the configuration
This commit adds argparse to our render script and introduces
a new argument `--service-config` which can be called several times
accepting only two arguments(service name & service configmap name)
This hack is required to bypass the fact that dumping Jinja
to YAML does not work with the render script because of the presence
of unquote special characters e.g `{%`.

If we try to escape thess special characters, we end up with type(str)
always and in some special conditions, we need for example replicas count
to be of type(int)
The prometheus-operator chart is rendered using the following command:

./charts/render.py prometheus-operator --namespace metalk8s-monitoring charts/prometheus-operator.yaml --service-config grafana
metalk8s-grafana-config --service-config prometheus metalk8s-prometheus-config --service-config alertmanager metalk8s-alertmanager-config
charts/prometheus-operator/ > salt/metalk8s/addons/prometheus-operator/deployed/chart.sls

Service configuration values are passed using `--service-config` argument.
When rendering this chart, we must pass the following services(grafana, prometheus, alertmanager)
including the configmap that holds their respective service & cluster configurations

Closes: #2255
@Ebaneck Ebaneck force-pushed the feature/2255-template-and-store-replicas-as-service-configuration branch from d4aa36c to 6f96f83 Compare February 27, 2020 13:21
Copy link
Collaborator

@TeddyAndrieux TeddyAndrieux left a comment

Choose a reason for hiding this comment

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

LGTM

@Ebaneck
Copy link
Contributor Author

Ebaneck commented Feb 27, 2020

/approve

@Ebaneck
Copy link
Contributor Author

Ebaneck commented Feb 27, 2020

/reset

@bert-e
Copy link
Contributor

bert-e commented Feb 27, 2020

Reset complete

I have successfully deleted this pull request's integration branches.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Feb 27, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Feb 27, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

The following options are set: approve

1 similar comment
@bert-e
Copy link
Contributor

bert-e commented Feb 27, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Feb 28, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

The following options are set: approve

@Ebaneck
Copy link
Contributor Author

Ebaneck commented Feb 28, 2020

/status

@bert-e
Copy link
Contributor

bert-e commented Feb 28, 2020

Status

Status report is not available.

The following options are set: approve

@scality scality deleted a comment from bert-e Feb 28, 2020
@scality scality deleted a comment from bert-e Feb 28, 2020
@bert-e
Copy link
Contributor

bert-e commented Feb 28, 2020

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.5

  • ✔️ development/2.6

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Feb 28, 2020

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.5

  • ✔️ development/2.6

The following branches have NOT changed:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4

Please check the status of the associated issue None.

Goodbye ebaneck.

@bert-e bert-e merged commit 6f96f83 into development/2.5 Feb 28, 2020
@bert-e bert-e deleted the feature/2255-template-and-store-replicas-as-service-configuration branch February 28, 2020 03:33
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.

6 participants