Skip to content

Commit ed7dcc3

Browse files
Debulleting the Porch - Guides pages (#557)
* Debulleting the Porch - Guides pages * Implementing comments Signed-off-by: Dominika Schweier <dominika.schweier@nokia.com> * address review suggestions, fix some cli output formatting --------- Signed-off-by: Dominika Schweier <dominika.schweier@nokia.com> Co-authored-by: Mózes László Máté <laszlo.mozes@nokia.com>
1 parent 692d424 commit ed7dcc3

12 files changed

Lines changed: 213 additions & 409 deletions

File tree

docs/content/en/docs/4_tutorials_and_how-tos/working_with_package_revisions/_index.md

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: A group of guides outlining how to interact with Package Revisions
77

88
## Prerequisites
99

10-
- Porch deployed on a Kubernetes cluster [Setup Porch Guide]({{% relref "/docs/3_getting_started/installing-porch.md" %}}).
11-
- **Porchctl** CLI tool installed [Setup Porchctl Guide]({{% relref "/docs/3_getting_started/installing-porchctl.md" %}}).
12-
- A Git repository registered with Porch [Setup Repositories Guide]({{% relref "/docs/4_tutorials_and_how-tos/working_with_porch_repositories/repository-registration.md" %}}).
10+
- Porch deployed on a Kubernetes cluster. See, [Setup Porch Guide]({{% relref "/docs/3_getting_started/installing-porch.md" %}}).
11+
- **Porchctl** CLI tool installed. See, [Setup Porchctl Guide]({{% relref "/docs/3_getting_started/installing-porchctl.md" %}}).
12+
- A Git repository registered with Porch. See, [Setup Repositories Guide]({{% relref "/docs/4_tutorials_and_how-tos/working_with_porch_repositories/repository-registration.md" %}}).
1313
- **Kubectl** configured to access your cluster.
1414

1515
---
@@ -27,12 +27,14 @@ PackageRevisions are Kubernetes resources that represent versioned collections o
2727

2828
**PackageRevision Operations:**
2929

30-
- **Creation**: `init`, `clone`, `copy` - Create new PackageRevisions from scratch, existing packages, or new revisions
31-
- **Inspection**: `get` - List and view PackageRevision information and metadata
32-
- **Content Management**: `pull`, `push` - Move PackageRevision content between Git repositories and local filesystem
33-
- **Lifecycle Management**: `propose`, `approve`, `reject` - Control PackageRevision workflow states
34-
- **Upgrading**: `upgrade` - Create new revision upgrading downstream to more recent upstream package
35-
- **Deletion**: `propose-delete`, `del` - Propose deletion of published PackageRevisions, then delete them
30+
| Operation | Git Command | Description |
31+
|----------------------|--------------------------------|-------------------------------------------------------------------------------|
32+
| Creation | `init`, `clone`, `copy` | Create new PackageRevisions from scratch, existing packages, or new revisions |
33+
| Inspection | `get` | List and view PackageRevision information and metadata |
34+
| Content Management | `pull`, `push` | Move PackageRevision content between Git repositories and local filesystem |
35+
| Lifecycle Management | `propose`, `approve`, `reject` | Control PackageRevision workflow states |
36+
| Upgrading | `upgrade` | Create new revision upgrading downstream to more recent upstream package |
37+
| Deletion | `propose-delete`, `del` | Propose deletion of published PackageRevisions, then delete them |
3638

3739
---
3840

@@ -44,36 +46,31 @@ PackageRevisions follow a structured lifecycle with three main states:
4446
- **Proposed**: Ready for review, contents are immutable. To make further changes, reject back to Draft. Revision number remains 0.
4547
- **Published**: Approved and immutable. Revision number increments to 1+.
4648

47-
**Lifecycle Transitions:**
49+
PackageRevisions use the following lifecycle transitions:
4850

49-
1. **Draft → Proposed**: `porchctl rpkg propose` - Signal readiness for review
50-
2. **Proposed → Published**: `porchctl rpkg approve` - Approve and make immutable
51-
3. **ProposedDraft**: `porchctl rpkg reject` - Return for more work
52-
53-
**Additional States:**
54-
55-
- **DeletionProposed**: PackageRevision marked for deletion, pending approval
51+
| Transition | Command | Meaning |
52+
|----------------------------------|--------------------------------|-------------------------------------|
53+
| **DraftProposed** | `porchctl rpkg propose` | Signal readiness for review |
54+
| **Proposed → Published** | `porchctl rpkg approve` | Approve and make immutable |
55+
| **Proposed → Draft** | `porchctl rpkg reject` | Return for more work |
56+
| **Published → DeletionProposed** | `porchctl rpkg propose-delete` | Mark for deletion, pending approval |
57+
| **DeletionProposed → Published** | `porchctl rpkg reject` | Reject deletion proposal |
5658

5759
---
5860

5961
## PackageRevision Naming
6062

61-
Porch generates PackageRevision names automatically using a consistent format:
63+
Porch generates PackageRevision names automatically using the `{repositoryName}.{packageName}.{workspaceName}` format. An example PackageRevision naming would be `porch-test.my-first-package.v1`.
6264

63-
- **Format**: `{repositoryName}.{packageName}.{workspaceName}`
64-
- **Example**: `porch-test.my-first-package.v1`
65-
66-
**Name Components:**
65+
The name consists of the following components:
6766

6867
- **Repository Name**: Name of the registered Git repository
6968
- **Package Name**: Logical name for the package (can have multiple revisions)
7069
- **Workspace Name**: Unique identifier within the package (maps to Git branch/tag)
7170

72-
**Important Notes:**
73-
74-
- Workspace names must be unique within a package
75-
- Multiple PackageRevisions can share the same package name with different workspaces
76-
- Published PackageRevisions get tagged in Git using the workspace name
71+
{{% alert title="Note" color="primary" %}}
72+
Workspace names must be unique within a package. Multiple PackageRevisions can share the same package name with different workspaces and published PackageRevisions get tagged in Git using the workspace name.
73+
{{% /alert %}}
7774

7875
---
7976

@@ -87,11 +84,7 @@ PackageRevisions contain structured configuration files that can be modified thr
8784
2. **Modify**: Edit files locally using standard tools
8885
3. **Push**: Upload changes back to Porch (triggers pipeline rendering)
8986

90-
**Pipeline Processing:**
91-
92-
- KRM functions defined in the Kptfile automatically transform resources
93-
- Functions run when PackageRevisions are pushed to Porch
94-
- Common functions: set-namespace, apply-replacements, search-replace
87+
KRM functions defined in the Kptfile automatically transform resources; they run when PackageRevisions are pushed to Porch. Common examples include `set-namespace`, `apply-replacements`, and `search-replace`.
9588

9689
**Content Structure:**
9790

@@ -116,16 +109,9 @@ PackageRevisions are stored in Git repositories registered with Porch:
116109
- **Proposed**: Stored in `proposed/{workspace}` branch
117110
- **Published**: Tagged as `{workspace}` and stored in main branch
118111

119-
**Repository Types:**
120-
121-
- **Blueprint Repositories**: Contain upstream package templates for cloning
122-
- **Deployment Repositories**: Store deployment-ready packages (marked with `--deployment` flag)
123-
124-
**Synchronization:**
112+
Porch differentiates two types of repositories: "blueprint" and "deployment". Blueprint repositories are meant to contain upstream package templates for cloning, while deployment repositories should store deployment-ready packages. The latter are marked with the `--deployment` flag.
125113

126-
- Porch automatically syncs with Git repositories
127-
- Manual sync: `porchctl repo sync <repository-name>`
128-
- Periodic sync can be configured with cron expressions
114+
Porch automatically syncs with Git repositories, however you can perform a manual sync with the `porchctl repo sync <repository-name>` command. You can also configure periodic sync with cron expressions.
129115

130116
---
131117

@@ -135,33 +121,33 @@ Common issues when working with PackageRevisions and their solutions:
135121

136122
**PackageRevision stuck in Draft?**
137123

138-
- Check readiness conditions: `porchctl rpkg get <PACKAGE-REVISION> -o yaml | grep -A 5 conditions`
139-
- Verify all required fields are populated in the Kptfile
140-
- Check for pipeline function errors in Porch server logs
124+
- Check readiness conditions with the `porchctl rpkg get <PACKAGE-REVISION> -o yaml | grep -A 5 conditions` command
125+
- Verify that all required fields are populated in the Kptfile
126+
- Check for pipeline function errors in the Porch server logs
141127

142128
**Push fails with conflict?**
143129

144-
- Pull the latest version first: `porchctl rpkg pull <PACKAGE-REVISION> ./dir`
145-
- The PackageRevision may have been modified by someone else
130+
- Pull the latest version first with the `porchctl rpkg pull <PACKAGE-REVISION> <directory>` command
131+
- Check if the PackageRevision has been modified by someone else
146132
- Resolve conflicts locally and push again
147133

148134
**Cannot modify Published PackageRevision?**
149135

150136
- Published PackageRevisions are immutable by design
151-
- Create a new revision using `porchctl rpkg copy`
137+
- Create a new revision with the `porchctl rpkg copy` command
152138
- Use the copying workflow to create editable versions
153139

154140
**PackageRevision not found?**
155141

156-
- Verify the exact PackageRevision name: `porchctl rpkg get --namespace default`
157-
- Check you're using the correct namespace
142+
- Verify the exact PackageRevision name with the `porchctl rpkg get --namespace default` command
143+
- Check if you are using the correct namespace
158144
- Ensure the repository is registered and synchronized
159145

160146
**Permission denied errors?**
161147

162-
- Check RBAC permissions: `kubectl auth can-i get packagerevisions -n default`
163-
- Verify service account has proper roles for PackageRevision operations
164-
- Ensure repository authentication is configured correctly
148+
- Check RBAC permissions with the `kubectl auth can-i get packagerevisions -n default` command
149+
- Verify that the service account has proper roles for PackageRevision operations
150+
- Ensure the repository authentication is configured correctly
165151

166152
**Errors about "placeholder package revision"?**
167153

@@ -172,10 +158,10 @@ Common issues when working with PackageRevisions and their solutions:
172158

173159
**Pipeline functions failing?**
174160

175-
- Check function image availability and version
176-
- Verify function configuration in Kptfile
177-
- Review function logs in Porch server output during push operations
178-
- **To save work-in-progress despite failures**: Add `porch.kpt.dev/push-on-render-failure: "true"` annotation to the PackageRevision
161+
- Check the function image availability and version
162+
- Verify the function configuration in Kptfile
163+
- Review the function logs in the Porch server output during push operations
164+
- To save work-in-progress despite failures, add the `porch.kpt.dev/push-on-render-failure: "true"` annotation to the PackageRevision
179165
```bash
180166
kubectl annotate packagerevision <name> porch.kpt.dev/push-on-render-failure=true
181167
```

docs/content/en/docs/4_tutorials_and_how-tos/working_with_package_revisions/cloning-packages.md

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ First, list available PackageRevisions to find one to clone:
5858
porchctl rpkg get --namespace default
5959
```
6060

61-
**Example output:**
61+
Example output:
6262

6363
```bash
6464
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
@@ -67,11 +67,7 @@ blueprints.wordpress.v1 wordpress v1 3 t
6767
deployments.my-app.v1 my-app v1 1 true Published deployments
6868
```
6969

70-
**What to look for:**
71-
72-
- Published PackageRevisions from blueprint repositories are good candidates for cloning
73-
- Note the full NAME (e.g., `blueprints.nginx.main`)
74-
- Check the REPOSITORY column to identify the source repository
70+
Look for published PackageRevisions from blueprint repositories that are good candidates for cloning. Note the full NAME (e.g., `blueprints.nginx.main`) and check the REPOSITORY column to identify the source repository.
7571

7672
---
7773

@@ -88,22 +84,15 @@ porchctl rpkg clone \
8884
--workspace v1
8985
```
9086

91-
**What this does:**
92-
93-
- Creates a new PackageRevision based on `blueprints.nginx.main`
94-
- Names the new PackageRevision `my-nginx` (package name)
95-
- Places it in the `deployments` repository (different from source)
96-
- Uses `v1` as the workspace name
97-
- Starts in `Draft` lifecycle state
98-
- Maintains an upstream reference to `blueprints.nginx.main`
87+
This command creates a new PackageRevision based on `blueprints.nginx.main` and names the new PackageRevision `my-nginx` (package name). The package is placed in the `deployments` repository (different from source) and receives `v1` as the workspace name. This PackageRevision starts in `Draft` lifecycle state. An upstream reference to `blueprints.nginx.main` is maintained.
9988

100-
**Verify the clone was created:**
89+
Verify the clone was created:
10190

10291
```bash
10392
porchctl rpkg get --namespace default --name my-nginx
10493
```
10594

106-
**Example output:**
95+
Example output:
10796

10897
```bash
10998
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
@@ -120,7 +109,7 @@ After cloning, you can modify the new PackageRevision. Pull it locally:
120109
porchctl rpkg pull deployments.my-nginx.v1 ./my-nginx --namespace default
121110
```
122111

123-
**Make your changes:**
112+
Make your changes:
124113

125114
```bash
126115
vim ./my-nginx/Kptfile
@@ -150,7 +139,7 @@ pipeline:
150139
namespace: production
151140
```
152141
153-
**Push the changes back:**
142+
Push the changes back:
154143
155144
```bash
156145
porchctl rpkg push deployments.my-nginx.v1 ./my-nginx --namespace default
@@ -166,32 +155,32 @@ Once you're satisfied with the changes, propose the PackageRevision:
166155
porchctl rpkg propose deployments.my-nginx.v1 --namespace default
167156
```
168157

169-
**Verify the state change:**
158+
Verify the state change:
170159

171160
```bash
172161
porchctl rpkg get deployments.my-nginx.v1 --namespace default
173162
```
174163

175-
**Example output:**
164+
Example output:
176165

177166
```bash
178167
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
179168
deployments.my-nginx.v1 my-nginx v1 0 false Proposed deployments
180169
```
181170

182-
**Approve to publish:**
171+
Approve to publish:
183172

184173
```bash
185174
porchctl rpkg approve deployments.my-nginx.v1 --namespace default
186175
```
187176

188-
**Verify publication:**
177+
Verify publication:
189178

190179
```bash
191180
porchctl rpkg get deployments.my-nginx.v1 --namespace default
192181
```
193182

194-
**Example output:**
183+
Example output:
195184

196185
```bash
197186
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
@@ -259,13 +248,13 @@ Common issues when cloning PackageRevisions and how to resolve them.
259248

260249
**Clone fails with "repository not found"?**
261250

262-
- Verify the target repository exists: `porchctl repo get --namespace default`
263-
- Check the repository name is correct
251+
- Verify the target repository exists with the `porchctl repo get --namespace default` command
252+
- Check that the repository name is correct
264253
- Ensure you have permission to write to the target repository
265254

266255
**Clone fails with "source not found"?**
267256

268-
- Verify the source PackageRevision exists: `porchctl rpkg get --namespace default`
257+
- Verify the source PackageRevision exists with the `porchctl rpkg get --namespace default` command
269258
- Check the exact name including repository, package, and workspace
270259
- Ensure you have permission to read the source PackageRevision
271260

@@ -278,19 +267,19 @@ Common issues when cloning PackageRevisions and how to resolve them.
278267
**Clone fails with "workspace already exists"?**
279268

280269
- The workspace name must be unique within the package in the target repository
281-
- Choose a different workspace name: `--workspace v2` or `--workspace prod`
282-
- List existing workspaces: `porchctl rpkg get --namespace default --name <package>`
270+
- Choose a different workspace name, `--workspace v2` or `--workspace prod`
271+
- List existing workspaces with the `porchctl rpkg get --namespace default --name <package>` command
283272

284273
**Cloned PackageRevision has unexpected content?**
285274

286275
- The clone includes all resources from the source at the time of cloning
287-
- Pull and inspect: `porchctl rpkg pull <name> ./dir --namespace default`
276+
- Pull and inspect with the `porchctl rpkg pull <name> ./dir --namespace default` command
288277
- Make corrections and push back
289278

290279
**Need to clone within the same repository?**
291280

292281
- Use `porchctl rpkg copy` instead of `clone` for same-repository operations
293-
- The `copy` command is simpler and doesn't maintain upstream references
282+
- The `copy` command is simpler and does not maintain upstream references
294283
- See [Copying Package Revisions Guide]({{% relref "/docs/4_tutorials_and_how-tos/working_with_package_revisions/copying-packages.md" %}})
295284

296285
---

0 commit comments

Comments
 (0)