You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
curl -sfL https://get.k3s.io | sudo INSTALL_K3S_COMMIT='01e6b5b8d3274b11e982345f5fc1630dcc6e3add' sh -s - server
Verify Cluster Status:
kubectl get nodes -o wide
kubectl get pods -A
Create 1000 basic secrets:
echo 'this is a file' > file.txt && for i in {1..1000}; do echo test$i >> file.txt; kubectl create secret generic test$i --from-file=file.txt; done
Perform the secrets encryption operations: prepare/rotate/reencrypt (Reboot ALL nodes after every command - all etcd first then all cp then agent nodes)
Secrets encryption operations should be successful
Actual behavior:
Reencrypt operation times out with fatal error.
$ sudo /usr/local/bin/k3s secrets-encrypt reencrypt
time="2024-11-27T18:53:33Z" level=debug msg="Asset dir /var/lib/rancher/k3s/data/3345fdb78d4ac6f55d7d70b8ec401ed32d58d5af6b2e11412cd5a2d3c50ff3d1"
time="2024-11-27T18:53:33Z" level=debug msg="Running /var/lib/rancher/k3s/data/3345fdb78d4ac6f55d7d70b8ec401ed32d58d5af6b2e11412cd5a2d3c50ff3d1/bin/k3s-secrets-encrypt [/usr/local/bin/k3s secrets-encrypt reencrypt]"
time="2024-11-27T18:53:43Z" level=fatal msg="see server log for details: Put \"https://127.0.0.1:6443/v1-k3s/encrypt/config\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)"
The status shows reencrypt finished though. (Output shown - Before reboot of all nodes. So hashes dont match yet)
sudo /usr/local/bin/k3s secrets-encrypt status
DEBU[0000] Asset dir /var/lib/rancher/k3s/data/3345fdb78d4ac6f55d7d70b8ec401ed32d58d5af6b2e11412cd5a2d3c50ff3d1
DEBU[0000] Running /var/lib/rancher/k3s/data/3345fdb78d4ac6f55d7d70b8ec401ed32d58d5af6b2e11412cd5a2d3c50ff3d1/bin/k3s-secrets-encrypt [/usr/local/bin/k3s secrets-encrypt status]
Encryption Status: Enabled
Current Rotation Stage: reencrypt_finished
Server Encryption Hashes: hash does not match between ip-172-31-19-50 and ip-172-31-28-125
Active Key Type Name
------ -------- ----
* AES-CBC aescbckey-2024-11-27T18:38:34Z
From the journal logs - it looks like the reencrypt action is actually successful - and this could be a client monitor that times out.
Yeah this is just a cosmetic thing - as you noted the re-encrypt does in fact finish.
Rather than having the client make a single request that doesn't return until the re-encrypt is done, it should probably make 1 request to initiate the re-encrypt operation. That request should return immediately, and then the client can poll with additional status requests until the operation is complete.
That's not how reencrypt works right now. We don't wait for it to finish. That's why we print reencryption started. It just makes a PUT request to start the process.
The request trigger a annotation to be written on the node, which the k3s secrets-encryption controller watches. The response header is sent immediately after the annotation is written on the server node.
Okay, when #10612 got merged, the logic around http replies got muddled. We should not be waiting for that function to finish, we should just move on now.
Build details:
Branch: release-1.31
Commit ID: e99a668
Environment Details
Infrastructure
Node(s) CPU architecture, OS, and Version:
Cluster Configuration:
Describe the bug:
Etcd Config.yaml:
Control Plane Config.yaml:
Testing Steps to Reproduce:
Expected behavior:
Secrets encryption operations should be successful
Actual behavior:
Reencrypt operation times out with fatal error.
The status shows reencrypt finished though. (Output shown - Before reboot of all nodes. So hashes dont match yet)
From the journal logs - it looks like the reencrypt action is actually successful - and this could be a client monitor that times out.
The text was updated successfully, but these errors were encountered: