Coder Social home page Coder Social logo

Comments (1)

aganesh-suse avatar aganesh-suse commented on July 24, 2024

Validated on release-1.29 branch with version v1.29.6-rc3+k3s1

Environment Details

Infrastructure

  • Cloud
  • Hosted

Node(s) CPU architecture, OS, and Version:

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"

$ uname -m
x86_64

Cluster Configuration:

HA: 3 server/ 1 agent

Config.yaml:

token: xxxx
cluster-init: true
write-kubeconfig-mode: "0644"
node-external-ip: 1.1.1.1
node-label:
- k3s-upgrade=server

etcd-snapshot-retention: 2
etcd-snapshot-schedule-cron: "* * * * *"
etcd-s3: true
etcd-s3-access-key: <access-key>
etcd-s3-secret-key: <secret-key>
etcd-s3-bucket: <s3-bucket>
etcd-s3-folder: <s3-folder>
etcd-s3-region: <region>

debug: true

Testing Steps

  1. Copy config.yaml
$ sudo mkdir -p /etc/rancher/k3s && sudo cp config.yaml /etc/rancher/k3s
  1. Install k3s
curl -sfL https://get.k3s.io | sudo INSTALL_K3S_VERSION='v1.29.6-rc3+k3s1' sh -s - server
  1. Verify Cluster Status:
kubectl get nodes -o wide
kubectl get pods -A
  1. Perform:
$ sudo k3s etcd-snapshot prune
$ sudo k3s etcd-snapshot list 

pruned snapshot should not be listed after being deleted.

Replication Results:

  • k3s version used for replication:
$ k3s -v
k3s version v1.29.5+k3s1 (4e53a323)
go version go1.21.9
 $ sudo /usr/local/bin/k3s etcd-snapshot prune 
time="2024-06-21T16:37:42Z" level=warning msg="Unknown flag --etcd-snapshot-schedule-cron found in config.yaml, skipping\n"
time="2024-06-21T16:37:42Z" level=warning msg="Unknown flag --cluster-init found in config.yaml, skipping\n"
time="2024-06-21T16:37:42Z" level=warning msg="Unknown flag --write-kubeconfig-mode found in config.yaml, skipping\n"
time="2024-06-21T16:37:42Z" level=warning msg="Unknown flag --node-external-ip found in config.yaml, skipping\n"
time="2024-06-21T16:37:42Z" level=warning msg="Unknown flag --node-label found in config.yaml, skipping\n"
time="2024-06-21T16:37:42Z" level=warning msg="Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash. Use the full token from the server's node-token file to enable Cluster CA validation."
time="2024-06-21T16:37:43Z" level=info msg="Snapshot on-demand-ip-172-31-30-182-1718987763 deleted."
time="2024-06-21T16:37:43Z" level=info msg="Snapshot <s3-folder>/on-demand-ip-172-31-30-182-1718987763 deleted."
 $ sudo /usr/local/bin/k3s etcd-snapshot list 2>/dev/null On SERVER1: 18.188.91.198
Name                                      Location                                                                                         Size    Created
etcd-snapshot-ip-172-31-30-182-1718987282 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987282 741408  2024-06-21T16:28:02Z
etcd-snapshot-ip-172-31-30-182-1718987345 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987345 3252256 2024-06-21T16:29:05Z
etcd-snapshot-ip-172-31-30-182-1718987402 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987402 3760160 2024-06-21T16:30:02Z
etcd-snapshot-ip-172-31-30-182-1718987460 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987460 4141088 2024-06-21T16:31:00Z
etcd-snapshot-ip-172-31-30-182-1718987522 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987522 4313120 2024-06-21T16:32:02Z
etcd-snapshot-ip-172-31-30-182-1718987580 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987580 4493344 2024-06-21T16:33:00Z
etcd-snapshot-ip-172-31-30-182-1718987644 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987644 5320736 2024-06-21T16:34:04Z
etcd-snapshot-ip-172-31-30-182-1718987701 file:///var/lib/rancher/k3s/server/db/snapshots/etcd-snapshot-ip-172-31-30-182-1718987701        5496864 2024-06-21T16:35:01Z
etcd-snapshot-ip-172-31-30-182-1718987701 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987701 5496864 2024-06-21T16:35:01Z
on-demand-ip-172-31-30-182-1718987763     s3://<s3-bucket>/<s3-folder>/on-demand-ip-172-31-30-182-1718987763     5685280 2024-06-21T16:36:03Z
on-demand-ip-172-31-30-182-1718987773     s3://<s3-bucket>/<s3-folder>/on-demand-ip-172-31-30-182-1718987773     5713952 2024-06-21T16:36:13Z
on-demand-ip-172-31-30-182-1718987773     file:///var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-172-31-30-182-1718987773            5713952 2024-06-21T16:36:13Z
on-demand-ip-172-31-30-182-1718987782     s3://<s3-bucket>/<s3-folder>/on-demand-ip-172-31-30-182-1718987782     5750816 2024-06-21T16:36:22Z
on-demand-ip-172-31-30-182-1718987782     file:///var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-172-31-30-182-1718987782            5750816 2024-06-21T16:36:22Z
etcd-snapshot-ip-172-31-30-182-1718987822 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-30-182-1718987822 5873696 2024-06-21T16:37:02Z
etcd-snapshot-ip-172-31-30-182-1718987822 file:///var/lib/rancher/k3s/server/db/snapshots/etcd-snapshot-ip-172-31-30-182-1718987822        5873696 2024-06-21T16:37:02Z

on-demand-ip-172-31-30-182-1718987763 is still listed above - after it was supposed to be deleted.

Validation Results:

  • k3s version used for validation:
$ k3s -v
k3s version v1.29.6-rc3+k3s1 (83ae095a)
go version go1.21.11
 $ sudo /usr/local/bin/k3s etcd-snapshot prune 
time="2024-06-21T16:36:02Z" level=warning msg="Unknown flag --etcd-snapshot-schedule-cron found in config.yaml, skipping\n"
time="2024-06-21T16:36:02Z" level=warning msg="Unknown flag --cluster-init found in config.yaml, skipping\n"
time="2024-06-21T16:36:02Z" level=warning msg="Unknown flag --write-kubeconfig-mode found in config.yaml, skipping\n"
time="2024-06-21T16:36:02Z" level=warning msg="Unknown flag --node-external-ip found in config.yaml, skipping\n"
time="2024-06-21T16:36:02Z" level=warning msg="Unknown flag --node-label found in config.yaml, skipping\n"
time="2024-06-21T16:36:02Z" level=warning msg="Cluster CA certificate is not trusted by the host CA bundle, but the token does not include a CA hash. Use the full token from the server's node-token file to enable Cluster CA validation."
time="2024-06-21T16:36:03Z" level=info msg="Snapshot on-demand-ip-172-31-21-205-1718987660 deleted."
time="2024-06-21T16:36:03Z" level=info msg="Snapshot on-demand-ip-172-31-21-205-1718987660 deleted."

$ sudo /usr/local/bin/k3s etcd-snapshot list
Name                                      Location                                                                                            Size    Created
on-demand-ip-172-31-21-205-1718987669     s3://<s3-bucket>/<s3-folder>/on-demand-ip-172-31-21-205-1718987669     5455904 2024-06-21T16:34:29Z
on-demand-ip-172-31-21-205-1718987669     file:///var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-172-31-21-205-1718987669               5455904 2024-06-21T16:34:29Z
on-demand-ip-172-31-21-205-1718987677     s3://<s3-bucket>/<s3-folder>/on-demand-ip-172-31-21-205-1718987677     5500960 2024-06-21T16:34:37Z
on-demand-ip-172-31-21-205-1718987677     file:///var/lib/rancher/k3s/server/db/snapshots/on-demand-ip-172-31-21-205-1718987677               5500960 2024-06-21T16:34:37Z
etcd-snapshot-ip-172-31-21-205-1718987704 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-21-205-1718987704 5562400 2024-06-21T16:35:04Z
etcd-snapshot-ip-172-31-21-205-1718987704 file:///var/lib/rancher/k3s/server/db/snapshots/etcd-snapshot-ip-172-31-21-205-1718987704           5562400 2024-06-21T16:35:04Z
etcd-snapshot-ip-172-31-21-205-1718987764 s3://<s3-bucket>/<s3-folder>/etcd-snapshot-ip-172-31-21-205-1718987764 5779488 2024-06-21T16:36:04Z
etcd-snapshot-ip-172-31-21-205-1718987764 file:///var/lib/rancher/k3s/server/db/snapshots/etcd-snapshot-ip-172-31-21-205-1718987764           5779488 2024-06-21T16:36:04Z

on-demand-ip-172-31-21-205-1718987660 is not on the list post delete.

from k3s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.