Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Revise RPC credentials handling #1623

Closed
a-palchikov opened this issue May 28, 2020 · 2 comments
Closed

Revise RPC credentials handling #1623

a-palchikov opened this issue May 28, 2020 · 2 comments
Labels
kind/enhancement New feature or request priority/0 High priority

Comments

@a-palchikov
Copy link
Contributor

a-palchikov commented May 28, 2020

Current Result

There are two types of RPC credentials:

  • installs/expands/leaves - stored in the system repository with a fixed age of 10yrs/20yrs (CA)
  • upgrades - stored in the cluster-specific package repository with a fixed age of 1yrs/5yrs (CA) but with rotation with each operation

Expected Result

  • Unify both types of credentials - i.e. use either one consistently
  • Extend the cluster controller with the ability to verify and automatically rotate RPC credentials

Design doc: https://docs.google.com/document/d/1KVWEnLVXoExWHrq_Hm4gAJcU1ECiuQrj7k0F6rIzRJ0/edit#

@a-palchikov a-palchikov added kind/enhancement New feature or request priority/0 High priority labels May 28, 2020
@a-palchikov a-palchikov changed the title Reconciler loop for RPC credentials Revise RPC credentials handling May 28, 2020
a-palchikov added a commit that referenced this issue May 29, 2020
upgrade operation.
Revise "system rotate-rpc-creds" to be able to use it on any affected
cluster and not necessarily based on 5.5.47-dev.x.

Updates #1623
a-palchikov added a commit that referenced this issue May 29, 2020
upgrade operation.
Revise "system rotate-rpc-creds" to be able to use it on any affected
cluster and not necessarily based on 5.5.47-dev.x.

Updates #1623
r0mant added a commit that referenced this issue May 30, 2020
* Rotate RPC credentials used for install/expand/leave operations on each
upgrade operation.
Revise "system rotate-rpc-creds" to be able to use it on any affected
cluster and not necessarily based on 5.5.47-dev.x.

Updates #1623

* Address review comments

* Address review comments

* Create the RPC credentials backup package in cluster repository and
assign it the operation label so it gets automatically removed.
Also, upsert the package to be able to overwrite the contents and
labels.

Co-authored-by: Roman Tkachenko <[email protected]>
@r0mant
Copy link
Contributor

r0mant commented Jun 3, 2020

@a-palchikov Looks like with these changes (#1629) the rollback of /init phase screws up rpc creds package completely:

ubuntu@node-1:~/upgrade$ sudo ./gravity plan execute --phase=/init
Wed Jun  3 21:10:13 UTC	Executing "/init/node-1" locally
Wed Jun  3 21:10:15 UTC	Executing phase "/init" finished in 2 seconds
ubuntu@node-1:~/upgrade$
ubuntu@node-1:~/upgrade$
ubuntu@node-1:~/upgrade$ sudo ./gravity plan rollback --phase=/init
Wed Jun  3 21:10:19 UTC	Rolling back "/init/node-1" locally
Wed Jun  3 21:10:20 UTC	Rolling back phase "/init" finished in 1 second
ubuntu@node-1:~/upgrade$
ubuntu@node-1:~/upgrade$
ubuntu@node-1:~/upgrade$ sudo ./gravity plan execute --phase=/init
Wed Jun  3 21:10:25 UTC	Executing "/init/node-1" locally
Wed Jun  3 21:10:25 UTC	Executing phase "/init" finished in now
[ERROR]: failed to update RPC credentials
	failed to read package gravitational.io/rpcagent-secrets:0.0.1
		object not found

@r0mant
Copy link
Contributor

r0mant commented Jun 18, 2020

Done in 5.5, forward-ports are tracked in #1740.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement New feature or request priority/0 High priority
Projects
None yet
Development

No branches or pull requests

3 participants