{"id":44787233,"url":"https://github.com/stackitcloud/rename-pvc","last_synced_at":"2026-03-01T00:00:46.885Z","repository":{"id":39970943,"uuid":"455597192","full_name":"stackitcloud/rename-pvc","owner":"stackitcloud","description":"rename-pvc can rename PersistentVolumeClaims (PVCs) inside Kubernetes.","archived":false,"fork":false,"pushed_at":"2026-02-18T12:25:14.000Z","size":182,"stargazers_count":76,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-18T16:44:05.726Z","etag":null,"topics":["krew-plugin","kubernetes","ske"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackitcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-04T15:25:10.000Z","updated_at":"2026-02-18T12:25:16.000Z","dependencies_parsed_at":"2024-06-24T14:38:11.656Z","dependency_job_id":"2253b1f3-a611-434d-beac-23b3c2ae476d","html_url":"https://github.com/stackitcloud/rename-pvc","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/stackitcloud/rename-pvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackitcloud%2Frename-pvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackitcloud%2Frename-pvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackitcloud%2Frename-pvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackitcloud%2Frename-pvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackitcloud","download_url":"https://codeload.github.com/stackitcloud/rename-pvc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackitcloud%2Frename-pvc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29955885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T22:53:01.873Z","status":"ssl_error","status_checked_at":"2026-02-28T22:52:50.699Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["krew-plugin","kubernetes","ske"],"created_at":"2026-02-16T10:00:30.286Z","updated_at":"2026-03-01T00:00:46.863Z","avatar_url":"https://github.com/stackitcloud.png","language":"Go","readme":"# rename-pvc\n\n`rename-pvc` can rename PersistentVolumeClaims (PVCs) inside Kubernetes.\n\n:warning: Be sure to create a backup of your data in the PVC before using `rename-pvc`!\n\n## Installation\n\n### From krew plugin manager\n\nSee [krew install guide.](https://krew.sigs.k8s.io/docs/user-guide/setup/install/)\n\nUpdate krew packages and install `rename-pvc`:\n\n```shell\nkubectl krew update\nkubectl krew install rename-pvc\n```\n\nNow you can use `rename-pvc` with `kubectl rename-pvc`.\n\n### From source\n\nIf you have Go 1.16+, you can directly install by running:\n\n```bash\ngo install github.com/stackitcloud/rename-pvc/cmd/rename-pvc@latest\n```\n\u003e Based on your go configuration the `rename-pvc` binary can be found in `$GOPATH/bin` or `$HOME/go/bin` in case `$GOPATH` is not set.\n\u003e Make sure to add the respective directory to your `$PATH`.\n\u003e [For more information see go docs for further information](https://golang.org/ref/mod#go-install). Run `go env` to view your current configuration.\n\n### From the released binaries\n\nDownload the desired version for your operating system and processor architecture from the [`rename-pvc` releases page](https://github.com/stackitcloud/rename-pvc/releases).\nMake the file executable and place it in a directory available in your `$PATH`.\n\n## Usage\n\nTo rename a PVC from `pvc-name` to `new-pvc-name` run the command:\n\n```shell\nrename-pvc pvc-name new-pvc-name\n```\n\nExample Output:\n\n```shell\nRename PVC from 'pvc-name' in namespace 'default' to 'new-pvc-name' in namespace 'default'? (yes or no) y\nNew PVC with name 'new-pvc-name' created\nClaimRef of PV 'pvc-2dc982d6-72a0-4e80-b1a6-126b108d2adf' is updated to new PVC 'new-pvc-name'\nNew PVC 'new-pvc-name' is bound to PV 'pvc-2dc982d6-72a0-4e80-b1a6-126b108d2adf'\nOld PVC 'pvc-name' is deleted\n```\n\nWith the flag `--target-namespace` it is possible to change the namespace of the newly created PVC. `rename-pvc -n test1 --target-namespace test2 pvc-name pvc-name` will create the new PVC in Namespace `test2`.\n\nTo select the Namespace and Kubernetes cluster you can use the default `kubectl` flags and environment variables (like `--namespace`, `--kubeconfig` or the `KUBECONFIG` environment variable).\nFor all options run `--help`.\n\n```shell\nFlags:\n      --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.\n      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.\n      --as-uid string                  UID to impersonate for the operation.\n      --cache-dir string               Default cache directory (default \"/home/m/.kube/cache\")\n      --certificate-authority string   Path to a cert file for the certificate authority\n      --client-certificate string      Path to a client certificate file for TLS\n      --client-key string              Path to a client key file for TLS\n      --cluster string                 The name of the kubeconfig cluster to use\n      --context string                 The name of the kubeconfig context to use\n  -h, --help                           help for /tmp/go-build4237287669/b001/exe/main\n      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure\n      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.\n  -n, --namespace string               If present, the namespace scope for this CLI request\n      --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default \"0\")\n  -s, --server string                  The address and port of the Kubernetes API server\n  -N, --target-namespace string        Defines in which namespace the new PVC should be created. By default the source PVC's namespace is used.\n      --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used\n      --token string                   Bearer token for authentication to the API server\n      --user string                    The name of the kubeconfig user to use\n  -y, --yes                            Skips confirmation if flag is set\n```\n\n## How does it work?\n\n`rename-pvc` runs the following steps to rename an PVC in your Kubernetes cluster:\n\n1. Creates the new PVC with the `.spec.volumeName` set to the existing PV\n   - This new PVC is now in status `Lost`\n2. Updates the `spec.claimRef` in the `PersistentVolume` to the new PVC\n3. Waits until the new PVC's status is updated to `Bound`\n4. Deletes the old PVC\n\n## Maintainers\n\n| Name                                                 | Email                           |\n|:-----------------------------------------------------|:--------------------------------|\n| [@dergeberl](https://github.com/dergeberl)           | maximilian.geberl@stackit.de    |\n| [@einfachnuralex](https://github.com/einfachnuralex) | alexander.predeschly@stackit.de |\n\n## Contribution\n\nIf you want to contribute to `rename-pvc` please have a look at our [contribution guidelines](CONTRIBUTING.md).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackitcloud%2Frename-pvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackitcloud%2Frename-pvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackitcloud%2Frename-pvc/lists"}