Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kpt alpha to use porchctl #115

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/en/docs/guides/install-guides/install-on-byoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ your environment and choices.
- `kubectl` [installed ](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/)on your workstation
- `kpt` [installed](https://kpt.dev/installation/kpt-cli) on your workstation
(version v1.0.0-beta.43 or later)
- `porchctl` [installed](https://github.com/nephio-project/porch/releases) on your workstation
- Sudo-less `docker`, `podman`, or `nerdctl`. If using `podman` or `nerdctl`,
you must set the
[`KPT_FN_RUNTIME`](https://kpt.dev/reference/cli/fn/render/?id=environment-variables)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Register the edge repository using kpt cli or nephio web-ui.
GITHUB_USERNAME=<Github Username>
GITHUB_TOKEN=<GitHub Token>

kpt alpha repo register \
porchctl repo register \
--namespace default \
--repo-basic-username=${GITHUB_USERNAME} \
--repo-basic-password=${GITHUB_TOKEN} \
Expand Down
22 changes: 11 additions & 11 deletions content/en/docs/guides/install-guides/package-transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ weight: 7
- [kpt pkg get](#kpt-pkg-get)
- [kpt fn render](#kpt-fn-render)
- [kpt live init](#kpt-live-init)
- [kpt alpha rpkg for the Workload clusters](#kpt-alpha-rpkg-for-workload-clusters)
- [porchctl rpkg for the Workload clusters](#porchctl-rpkg-for-workload-clusters)
- [Create workload cluster package](#create-workload-cluster-package)
- [Configure the package](#configure-the-package)
- [Propose the package](#propose-the-package)
Expand Down Expand Up @@ -189,9 +189,9 @@ metadata:
labels:
cli-utils.sigs.k8s.io/inventory-id: 0123456789abcdef0123456789abcdef01234567-0123456789abcdef012
```
# kpt alpha rpkg for Workload clusters
# porchctl rpkg for Workload clusters

The `kpt alpha rpkg` suite of commands that act on `Repository` resources on the
The `porchctl rpkg` suite of commands that act on `Repository` resources on the
kubernetes cluster in scope. The packages in the `Repository` resources are
*remote packages (rpkg)*.

Expand All @@ -208,7 +208,7 @@ nephio-example-packages git Package false True https://github.c
To see all the remote packages that are available:

<details>
<summary>$ kpt alpha rpkg get</summary>
<summary>$ porchctl rpkg get</summary>

```bash
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
Expand Down Expand Up @@ -250,7 +250,7 @@ nephio-example-packages-dc0b55fb7a17d107e834417a2c9d8fb37f36d7cb vlanindex
<summary>To see the versions of a particular package:</summary>

```bash
$ kpt alpha rpkg get --name nephio-workload-cluster
$ porchctl rpkg get --name nephio-workload-cluster
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
nephio-example-packages-05707c7acfb59988daaefd85e3f5c299504c2da1 nephio-workload-cluster main main false Published nephio-example-packages
nephio-example-packages-781e1c17d63eed5634db7b93307e1dad75a92bce nephio-workload-cluster v1 v1 false Published nephio-example-packages
Expand All @@ -275,7 +275,7 @@ creates the blueprint package for the workload cluster in the management
repository.

```bash
kpt alpha rpkg clone -n default nephio-example-packages-7895e28d847c0296a204007ed577cd2a4222d1ea --repository mgmt regional
porchctl rpkg clone -n default nephio-example-packages-7895e28d847c0296a204007ed577cd2a4222d1ea --repository mgmt regional
```

During the clone operation, the command above performs the following operations:
Expand Down Expand Up @@ -309,15 +309,15 @@ file](https://github.com/nephio-project/test-infra/tree/main/e2e/provision).
1. Get the name of the package:

```bash
kpt alpha rpkg get | egrep '(NAME|regional)'
porchctl rpkg get | egrep '(NAME|regional)'
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional v1 false Draft mgmt
```

2. Pull the package to get a local copy of it

```bash
kpt alpha rpkg pull -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
porchctl rpkg pull -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
```
3. Set the Nephio labels on the package

Expand All @@ -337,7 +337,7 @@ labels:
5. Push the updated package back to the draft branch on the repository:

```bash
kpt alpha rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
porchctl rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
[RUNNING] "gcr.io/kpt-fn/apply-replacements:v0.1.1"
[PASS] "gcr.io/kpt-fn/apply-replacements:v0.1.1"
```
Expand All @@ -347,7 +347,7 @@ kpt alpha rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 reg
Propose the package:

```bash
kpt alpha rpkg propose -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
porchctl rpkg propose -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 proposed
```

Expand All @@ -361,7 +361,7 @@ workload cluster using all the `PackageVariant` components specified in the
`nephio-workload-cluster` kpt package.

```bash
kpt alpha rpkg approve -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
porchctl rpkg approve -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 approved
```

Expand Down
30 changes: 15 additions & 15 deletions content/en/docs/guides/user-guides/exercise-1-free5gc.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ oai-core-packages git Package false True https://github

Since those are Ready, you can deploy a package from the
[catalog-infra-capi](https://github.com/nephio-project/catalog/tree/main/infra/capi) repository into the mgmt
repository. To do this, you retrieve the Package Revision name using `kpt alpha rpkg get`, clone that specific Package
Revision via the `kpt alpha rpkg clone` command, then propose and approve the resulting package revision. You want to
repository. To do this, you retrieve the Package Revision name using `porchctl rpkg get`, clone that specific Package
Revision via the `porchctl rpkg clone` command, then propose and approve the resulting package revision. You want to
use the latest revision of the nephio-workload-cluster package, which you can get with the command below (your latest
revision may be different):

```bash
kpt alpha rpkg get --name nephio-workload-cluster
porchctl rpkg get --name nephio-workload-cluster
```

<details>
Expand All @@ -113,7 +113,7 @@ Then, use the NAME from that in the `clone` operation, and the resulting Package
and `approve` operations:

```bash
kpt alpha rpkg clone -n default catalog-infra-capi-b0ae9512aab3de73bbae623a3b554ade57e15596 --repository mgmt regional
porchctl rpkg clone -n default catalog-infra-capi-b0ae9512aab3de73bbae623a3b554ade57e15596 --repository mgmt regional
```

<details>
Expand All @@ -131,7 +131,7 @@ and the `set-labels` function to do this.
To pull the package to a local directory, use the `rpkg pull` command:

```bash
kpt alpha rpkg pull -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
porchctl rpkg pull -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
```

The package is now in the `regional` directory. So you can execute the `set-labels` function against the package
Expand Down Expand Up @@ -160,7 +160,7 @@ In any case, you now can push the package with the labels applied back to the
repository:

```bash
kpt alpha rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
porchctl rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 regional
```

<details>
Expand All @@ -175,7 +175,7 @@ kpt alpha rpkg push -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 reg
Finally, you propose and approve the package.

```bash
kpt alpha rpkg propose -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
porchctl rpkg propose -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
```

<details>
Expand All @@ -187,7 +187,7 @@ mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868 proposed
</details>

```bash
kpt alpha rpkg approve -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
porchctl rpkg approve -n default mgmt-08c26219f9879acdefed3469f8c3cf89d5db3868
```

<details>
Expand Down Expand Up @@ -863,7 +863,7 @@ This way you retrieve the downstream target name of the package. You can also re
Next create a new package revision from the existing UPF package.

```bash
kpt alpha rpkg copy -n default edge01-6b26ca0f4fdf83212a73faff159bd013b41207ee --workspace upf-scale-package
porchctl rpkg copy -n default edge01-6b26ca0f4fdf83212a73faff159bd013b41207ee --workspace upf-scale-package
```
<details>
<summary>The output is similar to:</summary>
Expand All @@ -877,7 +877,7 @@ The output contains the package revision of our newly cloned upf package. Pull t
choice (in the example you can use /tmp/upf-scale-package).

```bash
kpt alpha rpkg pull -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42 /tmp/upf-scale-package
porchctl rpkg pull -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42 /tmp/upf-scale-package
```
You can inspect the contents of the package in the chosen directory. The UPF configuration is located in the
capacity.yaml file.
Expand Down Expand Up @@ -953,9 +953,9 @@ Next, progress through the package lifecycle stages by pushing the changes to th
the changes and approving them.

```bash
kpt alpha rpkg push -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42 /tmp/upf-scale-package
kpt alpha rpkg propose -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42
kpt alpha rpkg approve -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42
porchctl rpkg push -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42 /tmp/upf-scale-package
porchctl rpkg propose -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42
porchctl rpkg approve -n default edge01-40c616e5d87053350473d3ffa1387a9a534f8f42
```
<details>
<summary>The output is similar to:</summary>
Expand Down Expand Up @@ -988,9 +988,9 @@ edge01-40c616e5d87053350473d3ffa1387a9a534f8f42 approved
```
</details>

You can check the current lifecycle stage of a package using the `kpt alpha rpkg get` command.
You can check the current lifecycle stage of a package using the `porchctl rpkg get` command.
```bash
kpt alpha rpkg get | grep free5gc-upf
porchctl rpkg get | grep free5gc-upf
```

<details>
Expand Down