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

Kubeadm upgrade apply failed when the etcd-data is not /var/lib/etcd #3044

Closed
alfadb opened this issue Apr 18, 2024 · 1 comment
Closed

Kubeadm upgrade apply failed when the etcd-data is not /var/lib/etcd #3044

alfadb opened this issue Apr 18, 2024 · 1 comment
Labels
area/etcd kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Milestone

Comments

@alfadb
Copy link

alfadb commented Apr 18, 2024

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version (use kubeadm version):

kubeadm version: &version.Info{Major:"1", Minor:"30", GitVersion:"v1.30.0", GitCommit:"7c48c2bd72b9bf5c44d21d7338cc7bea77d0ad2a", GitTreeState:"clean", BuildDate:"2024-04-17T17:34:08Z", GoVersion:"go1.22.2", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Kubernetes version (use kubectl version): v1.29.3
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): Debian GNU/Linux 12 (bookworm)
  • Kernel (e.g. uname -a): Linux host 6.5.13-5-pve x86_64 GNU/Linux
  • Container runtime (CRI) (e.g. containerd, cri-o): containerd
  • Container networking plugin (CNI) (e.g. Calico, Cilium): flannel

What happened?

My etcd dir on host is not /var/lib/etcd, when I execute sudo kubeadm upgrade apply v1.30.0, I got this error:

[upgrade/config] Making sure the configuration is correct:
[preflight] Running pre-flight checks.
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'
[upgrade] Running cluster health checks
[upgrade/version] You have chosen to change the cluster version to "v1.30.0"
[upgrade/versions] Cluster version: v1.29.3
[upgrade/versions] kubeadm version: v1.30.0
[upgrade] Are you sure you want to proceed? [y/N]: y
[upgrade/prepull] Pulling images required for setting up a Kubernetes cluster
[upgrade/prepull] This might take a minute or two, depending on the speed of your internet connection
[upgrade/prepull] You can also perform this action in beforehand using 'kubeadm config images pull'
[upgrade/apply] Upgrading your Static Pod-hosted control plane to version "v1.30.0" (timeout: 5m0s)...
[upgrade/etcd] Upgrading to TLS for etcd
[upgrade/apply] FATAL: failed to back up etcd data, output: "cp: cannot stat '/var/lib/etcd': No such file or directory\n": exit status 1
To see the stack trace of this error execute with --v=5 or higher

My /etc/kubernetes/manifests/etcd.yaml file like this:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubeadm.kubernetes.io/etcd.advertise-client-urls: https://192.168.50.3:2379
  creationTimestamp: null
  labels:
    component: etcd
    tier: control-plane
  name: etcd
  namespace: kube-system
spec:
  ...
  volumes:
  - hostPath:
      path: /etc/kubernetes/pki/etcd
      type: DirectoryOrCreate
    name: etcd-certs
  - hostPath:
      path: /main/data/etcd
      type: DirectoryOrCreate
    name: etcd-data

I Changed the etcd-data's path to /main/data/etcd.

What you expected to happen?

Correct upgrade

How to reproduce it (as minimally and precisely as possible)?

Change host /var/lib/etcd to another path.

Anything else we need to know?

None.

@neolit123
Copy link
Member

My etcd dir on host is not /var/lib/etcd, when I execute sudo kubeadm upgrade apply v1.30.0, I got this error:

this is not supported.

a lot of kubeadm paths on the hosts are hardcoded, including /etc/kubernetes, /var/lib/etcd, /var/lib/kubelet

symlinks is what we recommend to users, but there are no plans to support customization of these dirs.

@neolit123 neolit123 added kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Apr 18, 2024
@neolit123 neolit123 added this to the v1.31 milestone Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/etcd kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

2 participants