mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Convert docs to docsy
This commit is contained in:
10
site/content/en/contributing/_index.md
Normal file
10
site/content/en/contributing/_index.md
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
title: "Contributing"
|
||||
linkTitle: "Contributing"
|
||||
type: docs
|
||||
menu:
|
||||
main:
|
||||
weight: 99
|
||||
---
|
||||
|
||||
Follow are resources for Kustomize contributors.
|
||||
57
site/content/en/contributing/bugs/_index.md
Normal file
57
site/content/en/contributing/bugs/_index.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "Filing Bugs"
|
||||
linkTitle: "Filing Bugs"
|
||||
type: docs
|
||||
weight: 10
|
||||
description: >
|
||||
How to file bugs against Kustomize
|
||||
---
|
||||
|
||||
|
||||
[krusty package]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty
|
||||
[reusable custom transformer test]: https://github.com/kubernetes-sigs/kustomize/tree/master/api/krusty/customconfigreusable_test.go
|
||||
|
||||
File issues as desired, but if you've found a problem
|
||||
with how `kustomize build` works, please report
|
||||
|
||||
* the output of `kustomize version`,
|
||||
* the input (the content of `kustomization.yaml`
|
||||
and any files it refers to),
|
||||
* the expected YAML output.
|
||||
|
||||
## If you have `go` installed
|
||||
|
||||
kustomize has a simple test harness in the [krusty
|
||||
package] for specifying a kustomization's input and the
|
||||
expected output.
|
||||
|
||||
Copy one of those tests, e.g. this [reusable custom
|
||||
transformer test], to a new test file in the
|
||||
krusty package.
|
||||
|
||||
Insert the inputs you want to use, and run it as
|
||||
you'd run the reusable custom transformer test:
|
||||
|
||||
```
|
||||
(cd api; go test -run TestReusableCustomTransformers ./krusty)
|
||||
```
|
||||
|
||||
The output will demonstrate the bug or missing feature.
|
||||
|
||||
Record this output in the test file in a call to
|
||||
`AssertActualEqualsExpected`, per all the other tests
|
||||
in the [krusty package]. This makes the test pass,
|
||||
albeit with output demonstrating behavior you
|
||||
presumably want to change.
|
||||
|
||||
Send the new test in a PR, along with commentary (in
|
||||
the test) on what you'd prefer to see.
|
||||
|
||||
The person who fixes the bug then has a clear bug
|
||||
reproduction and a test to modify when the bug is
|
||||
fixed.
|
||||
|
||||
Any bug fix first requires a test demonstrating the bug
|
||||
(so we have permanent regression coverage), so if the
|
||||
_bug reporter_ does this, it saves time and avoids
|
||||
misunderstandings.
|
||||
22
site/content/en/contributing/community/_index.md
Normal file
22
site/content/en/contributing/community/_index.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "Community Engagment"
|
||||
linkTitle: "Community"
|
||||
type: docs
|
||||
weight: 20
|
||||
description: >
|
||||
Joining SIG-CLI and the Kubernetes community
|
||||
---
|
||||
|
||||
[CLI special interest group]: https://github.com/kubernetes/community/tree/master/sig-cli#cli-special-interest-group
|
||||
[contributor roles]: https://github.com/kubernetes/community/blob/master/community-membership.md#community-membership
|
||||
[mailing list]: https://groups.google.com/forum/#!forum/kubernetes-sig-cli
|
||||
[bi-weekly meetings]: https://docs.google.com/document/d/1r0YElcXt6G5mOWxwZiXgGu_X6he3F--wKwg-9UBc29I/edit?usp=sharing
|
||||
|
||||
Kustomize is a sub project of the Kubernetes [CLI special interest group] and follows the Kubernetes
|
||||
project [contributor roles].
|
||||
|
||||
If you are interested in contributing towards Kustomize or getting more involved with the community,
|
||||
reach out on the [mailing list] or join one of the [bi-weekly meetings] (alternating Wednesdays at
|
||||
9:00am Pacific Time).
|
||||
|
||||
|
||||
62
site/content/en/contributing/docs/_index.md
Normal file
62
site/content/en/contributing/docs/_index.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: "Writing Docs"
|
||||
linkTitle: "Writing Docs"
|
||||
type: docs
|
||||
weight: 30
|
||||
description: >
|
||||
How to make Kustomize docs contributions
|
||||
---
|
||||
|
||||
Kustomize uses [Docsy](https://www.docsy.dev) for the site, and was
|
||||
forked from the [docsy-example](https://github.com/google/docsy-example)
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- [Install hugo](https://gohugo.io/getting-started/installing/#fetch-from-github)
|
||||
- Clone kustomize
|
||||
- `git clone git@github.com:kubernetes-sigs/kustomize && cd kustomize/`
|
||||
|
||||
## Development
|
||||
|
||||
The docs are in the `site` directory
|
||||
|
||||
```shell script
|
||||
cd site/
|
||||
```
|
||||
|
||||
To view the docs run
|
||||
|
||||
```shell script
|
||||
hugo serve
|
||||
```
|
||||
|
||||
```shell script
|
||||
...
|
||||
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
|
||||
Web Server is available at http://localhost:1313/kustomize/ (bind address 127.0.0.1)
|
||||
```
|
||||
|
||||
and visit the URL that is printed
|
||||
|
||||
## Publishing
|
||||
|
||||
The `site` content is compiled by Hugo into the `docs` folder using the hugo command:
|
||||
|
||||
```shell script
|
||||
hugo
|
||||
```
|
||||
|
||||
```shell script
|
||||
| EN
|
||||
-------------------+-----
|
||||
Pages | 99
|
||||
Paginator pages | 0
|
||||
Non-page files | 0
|
||||
Static files | 47
|
||||
Processed images | 0
|
||||
Aliases | 2
|
||||
Sitemaps | 1
|
||||
Cleaned | 0
|
||||
```
|
||||
|
||||
Add the `site` and `docs` folders to a commit, and create a PR.
|
||||
57
site/content/en/contributing/howitworks/_index.md
Normal file
57
site/content/en/contributing/howitworks/_index.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "Writing Code"
|
||||
linkTitle: "Writing Code"
|
||||
type: docs
|
||||
weight: 40
|
||||
description: >
|
||||
How Kustomize is implemented
|
||||
---
|
||||
|
||||
Call stack when running `kustomize build`, with links to code.
|
||||
|
||||
## Run build
|
||||
|
||||
* [RunBuild](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/kustomize/internal/commands/build/build.go#L121)
|
||||
* [MakeKustomizer](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/krusty/kustomizer.go#L32)
|
||||
* [Run](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/krusty/kustomizer.go#L47): performs a kustomization. It uses its internal filesystem reference to read the file at the given path argument, interpret it as a kustomization.yaml file, perform the kustomization it represents, and return the resulting resources.
|
||||
* Create factories
|
||||
* [tranformer.NewFactoryImpl](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/k8sdeps/transformer/factory.go#L17)
|
||||
* [resmap.NewFactory](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/resmap/factory.go#L21)
|
||||
* [resource.NewFactory](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/resource/factory.go#L23)
|
||||
* [kustruct.NewKunstructuredFactoryImpl](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/k8sdeps/kunstruct/factory.go#L28)
|
||||
* [loader.NewLoader](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/loader/loader.go#L19)
|
||||
* [validator.NewKustValidator](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/k8sdeps/validator/validators.go#L23)
|
||||
* [NewKustTarget](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L38)
|
||||
* [Load](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L54)
|
||||
* [MakeCustomizeResMap](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L109): details in next section
|
||||
* [emitResources](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/kustomize/internal/commands/build/build.go#L143)
|
||||
|
||||
## Make resource map
|
||||
|
||||
* [makeCustomizeResMap](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L117)
|
||||
* [AccumulateTarget](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L196): returns a new ResAccumulator, holding customized resources and the data/rules used to do so. The name back references and vars are not yet fixed.
|
||||
* [accummulateResources](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L302): fills the given resourceAccumulator with resources read from the given list of paths.
|
||||
* Merge config from builtin and CRDs
|
||||
* [runGenerators](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L239)
|
||||
* [configureBuiltinGenerators](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget_configplugin.go#L28)
|
||||
* ConfigMapGenerator
|
||||
* SecretGenerator
|
||||
* [configureExternalGenerators]()
|
||||
* Iterate all generators
|
||||
* [runTransfomers](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L274)
|
||||
* [configureBuiltinTransformers](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget_configplugin.go#L44)
|
||||
* PatchStrategicMergeTransformer
|
||||
* PatchTransformer
|
||||
* NamespaceTransformer
|
||||
* PrefixSuffixTransformer
|
||||
* LabelTransformer
|
||||
* AnnotationsTransformer
|
||||
* PatchJson6902Transformer
|
||||
* ReplicaCountTransformer
|
||||
* ImageTagTransformer
|
||||
* [configureExternalTransformers](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L291)
|
||||
* [MergeVars](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L64)
|
||||
* The following steps must be done last, not as part of the recursion implicit in AccumulateTarget.
|
||||
* [addHashesToNames](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/target/kusttarget.go#L153)
|
||||
* [FixBackReferences](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L160): Given that names have changed (prefixs/suffixes added), fix all the back references to those names.
|
||||
* [ResolveVars](https://github.com/kubernetes-sigs/kustomize/blob/c7d78970fb86782dbdded3a93944b774f826071f/api/internal/accumulator/resaccumulator.go#L141)
|
||||
46
site/content/en/contributing/mac/_index.md
Normal file
46
site/content/en/contributing/mac/_index.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "MacOS Dev Guide"
|
||||
linkTitle: "MacOS Dev Guide"
|
||||
type: docs
|
||||
weight: 50
|
||||
description: >
|
||||
How to develop on MacOS
|
||||
---
|
||||
|
||||
First install the tools to build and run tests
|
||||
|
||||
### Install go 1.13
|
||||
|
||||
[Instructions](https://golang.org/doc/install)
|
||||
|
||||
Add `go` to your PATH
|
||||
|
||||
### Install kubeval
|
||||
|
||||
[Instructions](https://github.com/instrumenta/kubeval)
|
||||
|
||||
```sh
|
||||
go get github.com/instrumenta/kubeval
|
||||
```
|
||||
|
||||
Add `kubeval` to your PATH
|
||||
|
||||
### Install gnu tools
|
||||
|
||||
[Instructions](https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/)
|
||||
|
||||
```sh
|
||||
brew install coreutils wget gnu-sed tree
|
||||
```
|
||||
|
||||
Add the new tools to your PATH
|
||||
|
||||
## Make everything
|
||||
|
||||
Verify your install by running `make`:
|
||||
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
Be default, this runs all tests needed to qualify a pull request.
|
||||
61
site/content/en/contributing/windows/_index.md
Normal file
61
site/content/en/contributing/windows/_index.md
Normal file
@@ -0,0 +1,61 @@
|
||||
---
|
||||
title: "Windows Dev Guide"
|
||||
linkTitle: "Windows Dev Guide"
|
||||
type: docs
|
||||
weight: 60
|
||||
description: >
|
||||
How to develop on Windows
|
||||
---
|
||||
|
||||
This is the PowerShell script to run all go tests for Kustomize on a windows based platform which mimics /build/pre-commit.sh
|
||||
|
||||
## Pre-Reqs:
|
||||
- PowerShell installed
|
||||
- PowerShell Core is supported
|
||||
- go installed
|
||||
- golangci-lint installed
|
||||
- mdrip installed
|
||||
|
||||
This script should output to the current console and return an exit code if all tests are successful(0) or any failed(1).
|
||||
|
||||
### If you are tryin to run these tests locally you can follow these instructions.
|
||||
|
||||
Assume:
|
||||
- Running a stock Windows 10 system
|
||||
- Local Admin rights.
|
||||
- You can open [PowerShell as administrator](http://lmgtfy.com/?iie=1&q=How+to+open+powershell+as+administrator)
|
||||
- You should be knowledgeable enough to pull source for packages into your GO ```src``` directory
|
||||
- Yes, this means you also need to know a bit about **git** usually
|
||||
|
||||
|
||||
#### Step 1 - Install Go
|
||||
- [Install Go](https://golang.org/dl/) - please use the msi
|
||||
- If you use chocolatey - it's using the zip not msi and assumptions on where go is located are made for you.
|
||||
#### Step 2 - Install Go Packages
|
||||
- Open new PowerShell Administrative window
|
||||
- Install golangci-lint
|
||||
- ```go get -u github.com/golangci/golangci-lint/cmd/golangci-lint```
|
||||
- Install mdrip
|
||||
- ```go get github.com/monopole/mdrip```
|
||||
|
||||
You should now be able to issue these commands and see comparable responses
|
||||
|
||||
```
|
||||
C:\...> golangci-lint --help
|
||||
Smart, fast linters runner. Run it in cloud for every GitHub pull request on https://golangci.com
|
||||
...
|
||||
|
||||
C:\...> mdrip --help
|
||||
Usage: C:\_go\bin\mdrip.exe {fileName}...
|
||||
...
|
||||
```
|
||||
|
||||
#### Step 3 - Get Source and Test
|
||||
- In your GoRoot src
|
||||
- ```Example: C:\_go\src```
|
||||
- Navigate to the Kustomize `travis` directory
|
||||
- ```Example: C:\_go\src\sigs.k8s.io\kustomize\travis```
|
||||
- Now Execute:
|
||||
- ```.\Invoke-PreCommit.ps1```
|
||||
|
||||
This should run all pre-commit tests thus defined in the script.
|
||||
Reference in New Issue
Block a user