Skip to content

Commit

Permalink
Add Book Section on Authoring (#3138)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmaly authored May 12, 2022
1 parent c640b6d commit 449b3e3
Show file tree
Hide file tree
Showing 4 changed files with 461 additions and 5 deletions.
10 changes: 5 additions & 5 deletions site/book/08-package-orchestration/02-quickstart.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
In this quickstart you will use Porch to discover configuration packages
​​In this quickstart you will use Porch to discover configuration packages
in a [sample repository](https://github.com/GoogleContainerTools/kpt-samples).

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

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

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

### kubectl

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

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

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

apiVersion: config.kubernetes.io/v1
Expand Down
58 changes: 58 additions & 0 deletions site/book/08-package-orchestration/03-registering-a-repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
In the following sections of this chapter you will explore package authoring
using Porch. You will need:

* A GitHub repository for your blueprints. An otherwise empty repository with an
initial commit works best. The initial commit is required to establish the
`main` branch.
* A GitHub [Personal Access Token](https://github.com/settings/tokens) with
the `repo` scope for Porch to authenticate with the repository and allow it
to create commits in the repository.

Use the `kpt alpha repo register` command to register your repository with
Porch: The command below uses the repository `deployments.git`.
Your repository name may be different; please update the command with the
correct repository name.

```sh
# Register your Git repository:

GITHUB_USERNAME=<GitHub Username>
GITHUB_TOKEN=<GitHub Personal Access Token>
REPOSITORY_ADDRESS=<Your Repository URL>

$ kpt alpha repo register \
--namespace default \
--name deployments \
--deployment \
--repo-basic-username=${GITHUB_USERNAME} \
--repo-basic-password=${GITHUB_TOKEN} \
${REPOSITORY_ADDRESS}
```

And register the sample repository we used in the [quickstart](./02-quickstart):

```sh
# Register the sample repository:

kpt alpha repo register --namespace default \
https://github.com/GoogleContainerTools/kpt-samples.git
```

?> Refer to the [register command reference][register-doc] for usage.

You now have two repositories registered, and your repository is marked as
deployment repository. This indicates that published packages in the repository
are considered deployment-ready.

```sh
# Query repositories registered with Porch:
$ kpt alpha repo get
NAME TYPE CONTENT DEPLOYMENT READY ADDRESS
deployments git Package true True [Your repository address]
kpt-samples git Package True https://github.com/GoogleContainerTools/kpt-samples.git
```

?> Refer to the [get command reference][get-doc] for usage.

[register-doc]: /reference/cli/alpha/repo/reg/
[get-doc]: /reference/cli/alpha/repo/get/
Loading

0 comments on commit 449b3e3

Please sign in to comment.