Skip to content

Commit 449b3e3

Browse files
authored
Add Book Section on Authoring (#3138)
1 parent c640b6d commit 449b3e3

File tree

4 files changed

+461
-5
lines changed

4 files changed

+461
-5
lines changed

site/book/08-package-orchestration/02-quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this quickstart you will use Porch to discover configuration packages
1+
​​In this quickstart you will use Porch to discover configuration packages
22
in a [sample repository](https://github.com/GoogleContainerTools/kpt-samples).
33

44
You will use the kpt CLI - the new `kpt alpha` command sub-groups to interact
@@ -37,7 +37,7 @@ kpt-samples git Package True https://github.com/GoogleContaine
3737
From the output you can see that:
3838

3939
* the repository was registered by the name `kpt-samples`. This was chosen
40-
by kpt automatically from the repsitory URL, but can be overriden
40+
by kpt automatically from the repository URL, but can be overridden
4141
* it is a `git` repository (OCI repositories are also supported, though
4242
currently with some limitations)
4343
* the repository is *not* a deployment repository. Repository can be marked
@@ -89,7 +89,7 @@ within the directory specified. By default Porch will analyze the whole
8989
repository.
9090

9191
The `secretRef` can contain a name of a Kubernetes [Secret][secret] resource
92-
whith authentication credentials for Porch to access the repository.
92+
with authentication credentials for Porch to access the repository.
9393

9494
### kubectl
9595

@@ -124,7 +124,7 @@ kpt-samples-afcf4d1fac605a60ba1ea4b87b5b5b82e222cb69 basens v0 true
124124
?> The `r` prefix of the `rpkg` command group stands for `remote`. The commands
125125
in the `kpt alpha rpkg` group interact with packages managed (remotely) by Porch
126126
server. The commands in the `rpkg` group are similar to the `kpt pkg` commands
127-
except that they operate on remote packges managed by Porch server rather than
127+
except that they operate on remote packages managed by Porch server rather than
128128
on a local disk.
129129

130130
The output shows that Porch discovered the `basens` package, and found two
@@ -150,7 +150,7 @@ You can use the command to output the resources as a
150150
directory:
151151

152152
```sh
153-
# View contents of the basens/v0 packge revision
153+
# View contents of the basens/v0 package revision
154154
$ kpt alpha rpkg pull kpt-samples-afcf4d1fac605a60ba1ea4b87b5b5b82e222cb69 -ndefault
155155

156156
apiVersion: config.kubernetes.io/v1
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
In the following sections of this chapter you will explore package authoring
2+
using Porch. You will need:
3+
4+
* A GitHub repository for your blueprints. An otherwise empty repository with an
5+
initial commit works best. The initial commit is required to establish the
6+
`main` branch.
7+
* A GitHub [Personal Access Token](https://github.com/settings/tokens) with
8+
the `repo` scope for Porch to authenticate with the repository and allow it
9+
to create commits in the repository.
10+
11+
Use the `kpt alpha repo register` command to register your repository with
12+
Porch: The command below uses the repository `deployments.git`.
13+
Your repository name may be different; please update the command with the
14+
correct repository name.
15+
16+
```sh
17+
# Register your Git repository:
18+
19+
GITHUB_USERNAME=<GitHub Username>
20+
GITHUB_TOKEN=<GitHub Personal Access Token>
21+
REPOSITORY_ADDRESS=<Your Repository URL>
22+
23+
$ kpt alpha repo register \
24+
--namespace default \
25+
--name deployments \
26+
--deployment \
27+
--repo-basic-username=${GITHUB_USERNAME} \
28+
--repo-basic-password=${GITHUB_TOKEN} \
29+
${REPOSITORY_ADDRESS}
30+
```
31+
32+
And register the sample repository we used in the [quickstart](./02-quickstart):
33+
34+
```sh
35+
# Register the sample repository:
36+
37+
kpt alpha repo register --namespace default \
38+
https://github.com/GoogleContainerTools/kpt-samples.git
39+
```
40+
41+
?> Refer to the [register command reference][register-doc] for usage.
42+
43+
You now have two repositories registered, and your repository is marked as
44+
deployment repository. This indicates that published packages in the repository
45+
are considered deployment-ready.
46+
47+
```sh
48+
# Query repositories registered with Porch:
49+
$ kpt alpha repo get
50+
NAME TYPE CONTENT DEPLOYMENT READY ADDRESS
51+
deployments git Package true True [Your repository address]
52+
kpt-samples git Package True https://github.com/GoogleContainerTools/kpt-samples.git
53+
```
54+
55+
?> Refer to the [get command reference][get-doc] for usage.
56+
57+
[register-doc]: /reference/cli/alpha/repo/reg/
58+
[get-doc]: /reference/cli/alpha/repo/get/

0 commit comments

Comments
 (0)