{"id":44480254,"url":"https://github.com/zak905/kubectl-resource-backup","last_synced_at":"2026-02-12T23:18:07.632Z","repository":{"id":286896186,"uuid":"936301431","full_name":"zak905/kubectl-resource-backup","owner":"zak905","description":"kubectl plugin for backing up resources to local disk","archived":false,"fork":false,"pushed_at":"2026-01-02T20:25:02.000Z","size":107,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-09T09:26:57.500Z","etag":null,"topics":["hacktoberfest","krew","kubectl","kubectl-plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zak905.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"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":"2025-02-20T21:25:26.000Z","updated_at":"2026-01-02T20:23:56.000Z","dependencies_parsed_at":"2025-06-18T19:38:34.937Z","dependency_job_id":"a88da05a-bb11-4436-b28f-f4e43c32efd3","html_url":"https://github.com/zak905/kubectl-resource-backup","commit_stats":null,"previous_names":["zak905/kubectl-backup","zak905/kubectl-resource-backup"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/zak905/kubectl-resource-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zak905%2Fkubectl-resource-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zak905%2Fkubectl-resource-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zak905%2Fkubectl-resource-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zak905%2Fkubectl-resource-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zak905","download_url":"https://codeload.github.com/zak905/kubectl-resource-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zak905%2Fkubectl-resource-backup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29385973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T22:07:52.078Z","status":"ssl_error","status_checked_at":"2026-02-12T22:07:49.026Z","response_time":55,"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":["hacktoberfest","krew","kubectl","kubectl-plugin"],"created_at":"2026-02-12T23:18:07.563Z","updated_at":"2026-02-12T23:18:07.618Z","avatar_url":"https://github.com/zak905.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resource-backup\n\nkubectl plugin that backs up Kubernetes objects (including CRDs) to the local file system. Before saving any resource, the plugin does some additional processing to remove:\n- the status stanza if the object has any.\n- the server generated fields from the object metadata.\n- any field with a `null` value.\n\nThe plugin aims to make the saved objects look like the original creation request. However, the plugin does not remove the fields that has a default value (unlike the neat [plugin](https://github.com/itaysk/kubectl-neat)) because it's not possible to make a distinction between a value set by a creation/update request and a value set by a controller or a mutating admission webhook. If we take the deployment of an ingress-ngix below as an example, the fields surrounded with ascii boxes will be removed from the saved objects.\n\n```yaml\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  annotations:\n    deployment.kubernetes.io/revision: \"1\"\n#removed ----------------------------------------------------|\n  creationTimestamp: \"2023-10-01T15:45:42Z\"                 #|\n  generation: 1                                             #|\n#------------------------------------------------------------|\n  labels:\n    app.kubernetes.io/component: controller\n    app.kubernetes.io/instance: ingress-nginx\n    app.kubernetes.io/name: ingress-nginx\n  name: ingress-nginx-controller\n  namespace: ingress-nginx\n#removed ----------------------------------------------------|\n  resourceVersion: \"8039704\"                                #|\n  uid: 63e16d11-a32e-498a-a8d8-f1b9df9d15a0                 #|\n#------------------------------------------------------------|\nspec:\n  progressDeadlineSeconds: 600\n  replicas: 1\n  revisionHistoryLimit: 10\n  selector:\n    matchLabels:\n      app.kubernetes.io/component: controller\n      app.kubernetes.io/instance: ingress-nginx\n      app.kubernetes.io/name: ingress-nginx\n  strategy:\n    rollingUpdate:\n      maxSurge: 25%\n      maxUnavailable: 1\n    type: RollingUpdate\n  template:\n    metadata:\n#removed ----------------------------------------------------|\n      creationTimestamp: null                               #|\n#------------------------------------------------------------|\n      labels:\n        app.kubernetes.io/component: controller\n        app.kubernetes.io/instance: ingress-nginx\n        app.kubernetes.io/name: ingress-nginx\n        gcp-auth-skip-secret: \"true\"\n    spec:\n      containers:\n      - args:\n        - /nginx-ingress-controller\n        - --election-id=ingress-nginx-leader\n        - --controller-class=k8s.io/ingress-nginx\n        - --watch-ingress-without-class=true\n        - --configmap=$(POD_NAMESPACE)/ingress-nginx-controller\n        - --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services\n        - --udp-services-configmap=$(POD_NAMESPACE)/udp-services\n        - --validating-webhook=:8443\n        - --validating-webhook-certificate=/usr/local/certificates/cert\n        - --validating-webhook-key=/usr/local/certificates/key\n        env:\n        - name: POD_NAME\n          valueFrom:\n            fieldRef:\n              apiVersion: v1\n              fieldPath: metadata.name\n        - name: POD_NAMESPACE\n          valueFrom:\n            fieldRef:\n              apiVersion: v1\n              fieldPath: metadata.namespace\n        - name: LD_PRELOAD\n          value: /usr/local/lib/libmimalloc.so\n        image: registry.k8s.io/ingress-nginx/controller:v1.8.1@sha256:e5c4824e7375fcf2a393e1c03c293b69759af37a9ca6abdb91b13d78a93da8bd\n        imagePullPolicy: IfNotPresent\n        lifecycle:\n          preStop:\n            exec:\n              command:\n              - /wait-shutdown\n        livenessProbe:\n          failureThreshold: 5\n          httpGet:\n            path: /healthz\n            port: 10254\n            scheme: HTTP\n          initialDelaySeconds: 10\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 1\n        name: controller\n        ports:\n        - containerPort: 80\n          hostPort: 80\n          name: http\n          protocol: TCP\n        - containerPort: 443\n          hostPort: 443\n          name: https\n          protocol: TCP\n        - containerPort: 8443\n          name: webhook\n          protocol: TCP\n        readinessProbe:\n          failureThreshold: 3\n          httpGet:\n            path: /healthz\n            port: 10254\n            scheme: HTTP\n          initialDelaySeconds: 10\n          periodSeconds: 10\n          successThreshold: 1\n          timeoutSeconds: 1\n        resources:\n          requests:\n            cpu: 100m\n            memory: 90Mi\n        securityContext:\n          allowPrivilegeEscalation: true\n          capabilities:\n            add:\n            - NET_BIND_SERVICE\n            drop:\n            - ALL\n          runAsUser: 101\n        terminationMessagePath: /dev/termination-log\n        terminationMessagePolicy: File\n        volumeMounts:\n        - mountPath: /usr/local/certificates/\n          name: webhook-cert\n          readOnly: true\n      dnsPolicy: ClusterFirst\n      nodeSelector:\n        kubernetes.io/os: linux\n        minikube.k8s.io/primary: \"true\"\n      restartPolicy: Always\n      schedulerName: default-scheduler\n      securityContext: {}\n      serviceAccount: ingress-nginx\n      serviceAccountName: ingress-nginx\n      terminationGracePeriodSeconds: 0\n      tolerations:\n      - effect: NoSchedule\n        key: node-role.kubernetes.io/master\n        operator: Equal\n      volumes:\n      - name: webhook-cert\n        secret:\n          defaultMode: 420\n          secretName: ingress-nginx-admission\n#removed--------------------------------------------------------------------------------------------------|\nstatus:                                                                                                   #|\n  availableReplicas: 1                                                                                    #|\n  conditions:                                                                                             #|\n  - lastTransitionTime: \"2023-10-01T15:45:54Z\"                                                            #|\n    lastUpdateTime: \"2023-10-01T15:45:54Z\"                                                                #|\n    message: Deployment has minimum availability.                                                         #|\n    reason: MinimumReplicasAvailable                                                                      #|\n    status: \"True\"                                                                                        #|\n    type: Available                                                                                       #|\n  - lastTransitionTime: \"2023-10-01T15:45:54Z\"                                                            #|\n    lastUpdateTime: \"2023-10-01T15:49:21Z\"                                                                #|\n    message: ReplicaSet \"ingress-nginx-controller-7799c6795f\" has successfully progressed.                #|\n    reason: NewReplicaSetAvailable                                                                        #|\n    status: \"True\"                                                                                        #|\n    type: Progressing                                                                                     #|\n  observedGeneration: 1                                                                                   #|\n  readyReplicas: 1                                                                                        #|\n  replicas: 1                                                                                             #|\n  updatedReplicas: 1                                                                                      #|\n#---------------------------------------------------------------------------------------------------------|\n```\n# Installation\n\n  ```sh\n  kubectl krew install resource-backup\n  ```\n\n# Usage:\n\n```\nusage: kubectl resource-backup [\u003cflags\u003e] \u003ckind\u003e\n\n\nFlags:\n      --[no-]help            Show context-sensitive help (also try --help-long and --help-man).\n  -n, --namespace=\"default\"  if the resource is namespaced, this flag sets the namespace scope\n      --dir=\".\"              the directory where the resources will be saved\n      --[no-]zip             generates a zip archive containing the saved resources\n      --[no-]version         Show application version.\n\nArgs:\n  \u003ckind\u003e  the Kubernetes resource kind to backup in lower case. e.g issuer, deployment, service...\n\n\n```\n\nFor example, assuming that the namespace `ns` contains three deployments: `deployment1`, `deployment2`, `deployment3`.\n\nRunning `kubectl resource-backup deployment -n ns` would result in the creation of 3 yaml files in the current directory with the name of the deployments: `deployment1_deployment_ns.yaml`, `deployment2_deployment_ns.yaml`, `deployment3_deployment_ns.yaml`\n\n# Naming\n\nThe saved object files are named as follow: NAME_TYPE_NAMESPACE.yaml. For example, `deployment1_deployment_ns.yaml`\n\nif the resource is not namespaced the namespace is omitted. \n\n\n# Planned features: \n\n- adding the all namespaces flag `-all` for saving a resource from all namespaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzak905%2Fkubectl-resource-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzak905%2Fkubectl-resource-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzak905%2Fkubectl-resource-backup/lists"}