-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Avarei/docs
update docs and move crd2module.pkl to the correct directory
- Loading branch information
Showing
4 changed files
with
17 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# Composite Resource Definitions - XRDs | ||
|
||
XRDs can be created directly in Pkl or in Yaml. | ||
XRDs can be created directly in Pkl or imported from Yaml. | ||
|
||
Either can be converted to a Pkl Module. | ||
|
||
## Create XRD | ||
## Create a XRD (Skip if you already have a XRD) | ||
When Creating a Pkl file ensure it amends CompositeResourceDefinition | ||
```pkl | ||
amends "package://pkg.pkl-lang.org/github.com/crossplane-contrib/function-pkl/crospslane.contrib.xrd@<version>#/CompositeResourceDefinition.pkl" | ||
|
@@ -14,7 +14,7 @@ view [xrds/ExampleXR.pkl](xrds/ExampleXR.pkl) for more details on how to Build i | |
|
||
running `pkl eval xrds/ExampleXR.pkl` renders the XRD in its Yaml manifest format. | ||
|
||
## Create Module | ||
## Create a Module | ||
Modules can be generated by creating a file like [xrds/xrd2module.pkl](xrds/xrd2module.pkl) | ||
and running `pkl eval <filename> -m <outputDir>`. | ||
This will create the Module in the Output directory. e.g. [crds/XR.pkl](crds/XR.pkl) was created by running: | ||
|
@@ -25,9 +25,9 @@ pkl eval xrds/xrd2module.pkl -m crds | |
yaml manifests can be converted in the same way. | ||
|
||
## Create Managed Resource Modules | ||
Managed Resources and any other CRDs can be converted similarly to XRDs by creating a file like [xrds/crd2module.pkl](xrds/crd2module.pkl) | ||
Managed Resources and any other CRDs can be converted similarly to XRDs by creating a file like [crds/crd2module.pkl](crds/crd2module.pkl) | ||
```bash | ||
pkl eval xrds/crd2module.pkl -m crds | ||
pkl eval crds/crd2module.pkl -m crds | ||
``` | ||
|
||
## Create Pkl file for the Pipeline Step | ||
|
@@ -50,7 +50,7 @@ local request = new crossplane { | |
} | ||
}.Request | ||
``` | ||
To Parse the Request automatically into Pkl Language all K8sResources used must be declared in customResourceTemplates in the specified form. | ||
To Parse the Request into Pkl Language the XRD and all Managed Resources used must be declared in customResourceTemplates. | ||
|
||
## Create a Composition | ||
The Composition itself can be created in [yaml](../../example/full/composition.yaml) or in [pkl](compositions/inline.pkl). The latter is especially useful, if the the function is used with an inline Pkl file. | ||
|
@@ -61,12 +61,12 @@ The Composition itself can be created in [yaml](../../example/full/composition.y | |
|
||
## Resolve Dependencies | ||
Running `pkl project resolve` will download the Project dependencies | ||
> Note: When having multiple Projects in a Repository, which have dependencies among them use | ||
> Note: When having multiple Projects in a Repository, which have dependencies among each other use | ||
> `pkl project resolve ./*/` from the parent directory | ||
## Package Project | ||
Run `pkl project package` to create releasable package artifacts. | ||
> Note: When having multiple Projects in a Repository, which have dependencies among them use | ||
> Note: When having multiple Projects in a Repository, which have dependencies among each other use | ||
> `pkl project package ./*/` from the parent directory | ||
## Release Project | ||
|
@@ -80,4 +80,4 @@ Using pkg.pkl-lang.org as the domain helps with redirecting the requests from | |
- https://github.com/crossplane-contrib/function-pkl/releases/download/[email protected]/[email protected] | ||
|
||
When the Package is released it can be used in the Composition. | ||
See [example/full/composition.yaml](../../example/full/composition.yaml) | ||
See [example/full/composition.yaml](../../example/full/composition.yaml) |
File renamed without changes.