-
Notifications
You must be signed in to change notification settings - Fork 45
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
Automatic certificates renewal #2914
Automatic certificates renewal #2914
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
455c330
to
43dfb73
Compare
This comment has been minimized.
This comment has been minimized.
43dfb73
to
5891105
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is not sufficient, since from what I can see it only checks 'plain file' certs. However, we have certs embedded in Also, I think there should be some form of documentation/notes somewhere explaining how this feature 'works' and how the various pieces work together. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments on the kubeconfig-related parts.
87604df
to
d910eca
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
d910eca
to
3a414ae
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
351e4e9
to
d6e3363
Compare
This will allow to change the time a kubeconfig is valid (by changing the embedded certificates validity period). Refs: #1887
This beacon takes a list of kubeconfig as input and checks whether they need to be renewed or not triggering an event on Salt bus when needed. To configure this beacon, a section must be added, either in minion configuration or through the pillar, as follows: beacons: metalk8s_kubeconfig_info: - files: - /etc/kubernetes/calico.conf - /etc/kubernetes/admin.conf: notify_days: 30 - interval: 86400 - notify_days: 15 Default notify_days, if not provided, is 45. It can be overridden for a specific kubeconfig as shown above. Refs: #1887
This file is generated by pytest when using --cov* options for salt unit tests, so let's ignore it to avoid polluting git command output or committing it because of a careless mistake.
These defaults will be merged with the pillar and can be overriden, they'll be used by both the certificate & kubeconfig expiry beacons, the related reactor (certs renewal) and the `x509.certificate_managed` state. Refs: #1887
This sls setup the two beacons used to watch certificates and kubeconfig expiry. We also need to install pyOpenSSL package for cert_info beacon to work. Refs: #1887
Since this is needed on almost any node, let's deploy the beacons on all nodes, if there is no certificate to watch it will do nothing anyway. Refs: #1887
This pillar entry will be consumed by the Salt beacon configuration formula. This beacon watches certificate expirations. Refs: #1887
This pillar entry will be consumed by the Salt formulas configuring bootstrap role nodes, the beacon and the reactor listening for certificate expiration events. If the path of an expired certificate matches one in this list, the sls under `regen_sls` will be run. Refs: #1887
This pillar entry will be consumed by the Salt formulas configuring etcd, the beacon and the reactor listening for certificate expiration events. If the path of an expired certificate matches one in this list, the sls under `regen_sls` will be run. Refs: #1887
This pillar entry will be consumed by Salt formulas configuring master nodes, beacon and reactor listening for certificate expiration events. If the path of an expired certificate matches one in this list, the sls under `regen_sls` will be run. Refs: #1887
Replace hardcoded path for calico kubeconfig in the related formulas, using the new entries under certificates key in the `defaults.yaml` file. Refs: #1887
Replace hardcoded path for kubelet kubeconfig in the related formulas, using the new entries under certificates key in the `defaults.yaml` file. Refs: #1887
This orchestrate will be called by the reactor when it will receive an event for an expired certificates. It will run `sls` defined under `certs_renewal` pillar entry for each expired certificate. Refs: #1887
This reactor will be called when an expired certificate event will be received. It will then launch an orchestrate `orchestrate.certs.renew`, passing the list of expired certificates, to renew them. Refs: #1887
Set up the configuration in salt master cfg for the certificate expiration reactor. Refs: #1887
Set up the configuration in salt master cfg for the kubeconfig expiration reactor. Refs: #1887
This tests reconfigure the beacons and override the pillar configuration to force the renewal of all the certificates and kubeconfigs. The goal is to ensure that beacons work well and that nothing is broken in the cluster even when everything is triggered at the very same time. Refs: #1887
Timeout has been raised because of a lot of false positive in CI tests. We now wait 40 * 5s (200s) for log to show up in Loki from the logger Pod.
6792d9f
to
e94e404
Compare
/approve |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
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 |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
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 |
Changes done/Issue opened
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue None. Goodbye alexandre-allard-scality. |
Component: salt
Context:
In MetalK8s, we deploy a lot of certificates for interaction between components.
These certificates have an expiration date and must then be renewed, otherwise the services can no longer communicate.
Summary:
Acceptance criteria:
Tests that every certificate is well renewed and that nothing breaks or every services that must be restarted are.
Closes: #1887