[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-4982":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":16,"starSnapshotCount":16,"syncStatus":19,"lastSyncTime":31,"discoverSource":32},4982,"kustomize","kubernetes-sigs\u002Fkustomize","kubernetes-sigs","Customization of kubernetes YAML configurations","",null,"Go",12068,2389,107,135,0,5,23,2,74.8,"Apache License 2.0",false,"master",true,[26,27],"hacktoberfest","k8s-sig-cli","2026-06-12 04:00:24","# kustomize\n\n`kustomize` lets you customize raw, template-free YAML\nfiles for multiple purposes, leaving the original YAML\nuntouched and usable as is.\n\n`kustomize` targets kubernetes; it understands and can\npatch [kubernetes style] API objects.  It's like\n[`make`], in that what it does is declared in a file,\nand it's like [`sed`], in that it emits edited text.\n\nThis tool is sponsored by [sig-cli] ([KEP]).\n\n - [Installation instructions](https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Finstallation\u002Fkustomize\u002F)\n - [General documentation](https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002F)\n - [Examples](examples)\n\n[![Build Status](https:\u002F\u002Fprow.k8s.io\u002Fbadge.svg?jobs=kustomize-presubmit-master)](https:\u002F\u002Fprow.k8s.io\u002Fjob-history\u002Fkubernetes-jenkins\u002Fpr-logs\u002Fdirectory\u002Fkustomize-presubmit-master)\n[![Go Report Card](https:\u002F\u002Fgoreportcard.com\u002Fbadge\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize)](https:\u002F\u002Fgoreportcard.com\u002Freport\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize)\n\n## kubectl integration\n\nTo find the kustomize version embedded in recent versions of kubectl, run `kubectl version`:\n\n```sh\n> kubectl version --client\nClient Version: v1.31.0\nKustomize Version: v5.4.2\n```\n\nThe kustomize build flow at [v2.0.3] was added\nto [kubectl v1.14][kubectl announcement].  The kustomize\nflow in kubectl remained frozen at v2.0.3 until kubectl v1.21,\nwhich [updated it to v4.0.5][kust-in-kubectl update]. It will\nbe updated on a regular basis going forward, and such updates\nwill be reflected in the Kubernetes release notes.\n\n| Kubectl version | Kustomize version |\n| --------------- | ----------------- |\n| \u003C v1.14         | n\u002Fa               |\n| v1.14-v1.20     | v2.0.3            |\n| v1.21           | v4.0.5            |\n| v1.22           | v4.2.0            |\n| v1.23           | v4.4.1            |\n| v1.24           | v4.5.4            |\n| v1.25           | v4.5.7            |\n| v1.26           | v4.5.7            |\n| v1.27           | v5.0.1            |\n\n[v2.0.3]: https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize\u002Freleases\u002Ftag\u002Fv2.0.3\n[#2506]: https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize\u002Fissues\u002F2506\n[#1500]: https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize\u002Fissues\u002F1500\n[kust-in-kubectl update]: https:\u002F\u002Fgithub.com\u002Fkubernetes\u002Fkubernetes\u002Fblob\u002F4d75a6238a6e330337526e0513e67d02b1940b63\u002FCHANGELOG\u002FCHANGELOG-1.21.md#kustomize-updates-in-kubectl\n\nFor examples and guides for using the kubectl integration please\nsee the [kubernetes documentation].\n\n## Usage\n\n\n### 1) Make a [kustomization] file\n\nIn some directory containing your YAML [resource]\nfiles (deployments, services, configmaps, etc.), create a\n[kustomization] file.\n\nThis file should declare those resources, and any\ncustomization to apply to them, e.g. _add a common\nlabel_.\n\n```\n\nbase: kustomization + resources\n\nkustomization.yaml                                      deployment.yaml                                                 service.yaml\n+---------------------------------------------+         +-------------------------------------------------------+       +-----------------------------------+\n| apiVersion: kustomize.config.k8s.io\u002Fv1beta1 |         | apiVersion: apps\u002Fv1                                   |       | apiVersion: v1                    |\n| kind: Kustomization                         |         | kind: Deployment                                      |       | kind: Service                     |\n| labels:                                     |         | metadata:                                             |       | metadata:                         |\n| - includeSelectors: true                    |         |   name: myapp                                         |       |   name: myapp                     |\n|   pairs:                                    |         | spec:                                                 |       | spec:                             |\n|     app: myapp                              |         |   selector:                                           |       |   selector:                       |\n| resources:                                  |         |     matchLabels:                                      |       |     app: myapp                    |\n|   - deployment.yaml                         |         |       app: myapp                                      |       |   ports:                          |\n|   - service.yaml                            |         |   template:                                           |       |     - port: 6060                  |\n| configMapGenerator:                         |         |     metadata:                                         |       |       targetPort: 6060            |\n|   - name: myapp-map                         |         |       labels:                                         |       +-----------------------------------+\n|     literals:                               |         |         app: myapp                                    |\n|       - KEY=value                           |         |     spec:                                             |\n+---------------------------------------------+         |       containers:                                     |\n                                                        |         - name: myapp                                 |\n                                                        |           image: myapp                                |\n                                                        |           resources:                                  |\n                                                        |             limits:                                   |\n                                                        |               memory: \"128Mi\"                         |\n                                                        |               cpu: \"500m\"                             |\n                                                        |           ports:                                      |\n                                                        |             - containerPort: 6060                     |\n                                                        +-------------------------------------------------------+\n\n```\n\nFile structure:\n\n> ```\n> ~\u002FsomeApp\n> ├── deployment.yaml\n> ├── kustomization.yaml\n> └── service.yaml\n> ```\n\nThe resources in this directory could be a fork of\nsomeone else's configuration.  If so, you can easily\nrebase from the source material to capture\nimprovements, because you don't modify the resources\ndirectly.\n\nGenerate customized YAML with:\n\n```\nkustomize build ~\u002FsomeApp\n```\n\nThe YAML can be directly [applied] to a cluster:\n\n> ```\n> kustomize build ~\u002FsomeApp | kubectl apply -f -\n> ```\n\n\n### 2) Create [variants] using [overlays]\n\nManage traditional [variants] of a configuration - like\n_development_, _staging_ and _production_ - using\n[overlays] that modify a common [base].\n\n```\n\noverlay: kustomization + patches\n\nkustomization.yaml                                      replica_count.yaml                      cpu_count.yaml\n+-----------------------------------------------+       +-------------------------------+       +------------------------------------------+\n| apiVersion: kustomize.config.k8s.io\u002Fv1beta1   |       | apiVersion: apps\u002Fv1           |       | apiVersion: apps\u002Fv1                      |\n| kind: Kustomization                           |       | kind: Deployment              |       | kind: Deployment                         |\n| labels:                                       |       | metadata:                     |       | metadata:                                |\n|  - includeSelectors: true                     |       |   name: myapp                 |       |   name: myapp                            |\n|    pairs:                                     |       | spec:                         |       | spec:                                    |\n|      variant: prod                            |       |   replicas: 80                |       |  template:                               |\n| resources:                                    |       +-------------------------------+       |     spec:                                |\n|   - ..\u002F..\u002Fbase                                |                                               |       containers:                        |\n| patches:                                      |                                               |         - name: myapp                    |\n|   - path: replica_count.yaml                  |                                               |           resources:                     |\n|   - path: cpu_count.yaml                      |                                               |             limits:                      |\n+-----------------------------------------------+                                               |               memory: \"128Mi\"            |\n                                                                                                |               cpu: \"7000m\"               |\n                                                                                                +------------------------------------------+\n```\n\n\nFile structure:\n> ```\n> ~\u002FsomeApp\n> ├── base\n> │   ├── deployment.yaml\n> │   ├── kustomization.yaml\n> │   └── service.yaml\n> └── overlays\n>     ├── development\n>     │   ├── cpu_count.yaml\n>     │   ├── kustomization.yaml\n>     │   └── replica_count.yaml\n>     └── production\n>         ├── cpu_count.yaml\n>         ├── kustomization.yaml\n>         └── replica_count.yaml\n> ```\n\nTake the work from step (1) above, move it into a\n`someApp` subdirectory called `base`, then\nplace overlays in a sibling directory.\n\nAn overlay is just another kustomization, referring to\nthe base, and referring to patches to apply to that\nbase.\n\nThis arrangement makes it easy to manage your\nconfiguration with `git`.  The base could have files\nfrom an upstream repository managed by someone else.\nThe overlays could be in a repository you own.\nArranging the repo clones as siblings on disk avoids\nthe need for git submodules (though that works fine, if\nyou are a submodule fan).\n\nGenerate YAML with\n\n```sh\nkustomize build ~\u002FsomeApp\u002Foverlays\u002Fproduction\n```\n\nThe YAML can be directly [applied] to a cluster:\n\n> ```sh\n> kustomize build ~\u002FsomeApp\u002Foverlays\u002Fproduction | kubectl apply -f -\n> ```\n\n## Community\n\n- [file a bug](https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Fcontributing\u002Fkustomize\u002Fbugs\u002F)\n- [contribute a feature](https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Fcontributing\u002Fkustomize\u002Ffeatures\u002F)\n- [propose a larger enhancement](https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize\u002Ftree\u002Fmaster\u002Fproposals)\n\n### Code of conduct\n\nParticipation in the Kubernetes community\nis governed by the [Kubernetes Code of Conduct].\n\n[`make`]: https:\u002F\u002Fwww.gnu.org\u002Fsoftware\u002Fmake\n[`sed`]: https:\u002F\u002Fwww.gnu.org\u002Fsoftware\u002Fsed\n[DAM]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#declarative-application-management\n[KEP]: https:\u002F\u002Fgithub.com\u002Fkubernetes\u002Fenhancements\u002Fblob\u002Fmaster\u002Fkeps\u002Fsig-cli\u002F2377-Kustomize\u002FREADME.md\n[Kubernetes Code of Conduct]: code-of-conduct.md\n[applied]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#apply\n[base]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#base\n[declarative configuration]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#declarative-application-management\n[kubectl announcement]: https:\u002F\u002Fkubernetes.io\u002Fblog\u002F2019\u002F03\u002F25\u002Fkubernetes-1-14-release-announcement\n[kubernetes documentation]: https:\u002F\u002Fkubernetes.io\u002Fdocs\u002Ftasks\u002Fmanage-kubernetes-objects\u002Fkustomization\u002F\n[kubernetes style]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#kubernetes-style-object\n[kustomization]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#kustomization\n[overlay]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#overlay\n[overlays]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#overlay\n[release page]: https:\u002F\u002Fgithub.com\u002Fkubernetes-sigs\u002Fkustomize\u002Freleases\n[resource]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#resource\n[resources]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#resource\n[sig-cli]: https:\u002F\u002Fgithub.com\u002Fkubernetes\u002Fcommunity\u002Fblob\u002Fmaster\u002Fsig-cli\u002FREADME.md\n[variants]: https:\u002F\u002Fkubectl.docs.kubernetes.io\u002Freferences\u002Fkustomize\u002Fglossary\u002F#variant\n","kustomize 是一个用于 Kubernetes YAML 配置文件自定义的工具，允许用户在不修改原始 YAML 文件的情况下进行多用途定制。其核心功能包括声明式配置和对 Kubernetes API 对象的理解与修补能力，通过创建 kustomization 文件来定义资源及其自定义规则。kustomize 采用 Go 语言编写，支持多种自定义操作如添加标签、注解等，并且可以无缝集成到 kubectl 中使用。适用于需要对 Kubernetes 资源进行灵活配置而不希望直接编辑基础 YAML 文件的各种场景，比如开发、测试及生产环境下的资源配置管理。","2026-06-11 03:01:55","top_language"]