-
Notifications
You must be signed in to change notification settings - Fork 18
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 #14 from Nordix/starting-with-porch
Added porch tutorial
- Loading branch information
Showing
18 changed files
with
2,209 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
**/.KptRevisionMetadata |
13 changes: 13 additions & 0 deletions
13
docs/tutorials/starting-with-porch/blueprints/network-function-auto-namespace/Kptfile
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: kpt.dev/v1 | ||
kind: Kptfile | ||
|
||
metadata: | ||
name: network-function-auto-namespace | ||
|
||
info: | ||
description: Network Function with automatic namespace setting Blueprint | ||
|
||
pipeline: | ||
mutators: | ||
- image: gcr.io/kpt-fn/set-namespace:v0.4.1 | ||
configPath: package-context.yaml |
25 changes: 25 additions & 0 deletions
25
...orials/starting-with-porch/blueprints/network-function-auto-namespace/README.md
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Network Function | ||
|
||
## Description | ||
Network Function with automatic namespace Blueprint | ||
|
||
## Usage | ||
|
||
### Fetch the package | ||
``` | ||
kpt pkg get $GIT_HOST/$GIT_USERNAME/$GIT_BLUEPRINTS_REPO[@VERSION] network-function-auto-namespace | ||
``` | ||
Details: https://kpt.dev/reference/cli/pkg/get/ | ||
|
||
### View package content | ||
``` | ||
kpt pkg tree network-function-auto-namespace | ||
``` | ||
Details: https://kpt.dev/reference/cli/pkg/tree/ | ||
|
||
### Apply the package | ||
``` | ||
kpt live init network-function-auto-namespace | ||
kpt live apply network-function-auto-namespace --reconcile-timeout=2m --output=table | ||
``` | ||
Details: https://kpt.dev/reference/cli/live/ |
17 changes: 17 additions & 0 deletions
17
.../tutorials/starting-with-porch/blueprints/network-function-auto-namespace/deployment.yaml
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: network-function-auto-namespace | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: network-function-auto-namespace | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: network-function-auto-namespace | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:latest |
8 changes: 8 additions & 0 deletions
8
...rials/starting-with-porch/blueprints/network-function-auto-namespace/package-context.yaml
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: kptfile.kpt.dev | ||
annotations: | ||
config.kubernetes.io/local-config: "true" | ||
data: | ||
name: default-namespace-name |
8 changes: 8 additions & 0 deletions
8
docs/tutorials/starting-with-porch/blueprints/network-function/Kptfile
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: kpt.dev/v1 | ||
kind: Kptfile | ||
|
||
metadata: | ||
name: network-function | ||
|
||
info: | ||
description: Network Function Blueprint |
25 changes: 25 additions & 0 deletions
25
docs/tutorials/starting-with-porch/blueprints/network-function/README.md
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Network Function | ||
|
||
## Description | ||
Network Function Blueprint | ||
|
||
## Usage | ||
|
||
### Fetch the package | ||
``` | ||
kpt pkg get $GIT_HOST/$GIT_USERNAME/$GIT_BLUEPRINTS_REPO[@VERSION] network-function | ||
``` | ||
Details: https://kpt.dev/reference/cli/pkg/get/ | ||
|
||
### View package content | ||
``` | ||
kpt pkg tree network-function | ||
``` | ||
Details: https://kpt.dev/reference/cli/pkg/tree/ | ||
|
||
### Apply the package | ||
``` | ||
kpt live init network-function | ||
kpt live apply network-function --reconcile-timeout=2m --output=table | ||
``` | ||
Details: https://kpt.dev/reference/cli/live/ |
17 changes: 17 additions & 0 deletions
17
docs/tutorials/starting-with-porch/blueprints/network-function/deployment.yaml
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: network-function | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: network-function | ||
template: | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: network-function | ||
spec: | ||
containers: | ||
- name: nginx | ||
image: nginx:latest |
14 changes: 14 additions & 0 deletions
14
docs/tutorials/starting-with-porch/kind_edge1_cluster.yaml
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
|
||
name: edge1 | ||
networking: | ||
apiServerAddress: 127.0.0.1 | ||
apiServerPort: 31001 | ||
podSubnet: 10.98.0.0/16 | ||
serviceSubnet: 10.198.0.0/16 | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 30000 | ||
hostPort: 32001 |
16 changes: 16 additions & 0 deletions
16
docs/tutorials/starting-with-porch/kind_management_cluster.yaml
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
|
||
name: management | ||
networking: | ||
apiServerAddress: 127.0.0.1 | ||
apiServerPort: 31000 | ||
podSubnet: 10.97.0.0/16 | ||
serviceSubnet: 10.197.0.0/16 | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 30000 | ||
hostPort: 32000 | ||
- containerPort: 3000 # Gitea NodePort | ||
hostPort: 30600 |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: metallb.io/v1beta1 | ||
kind: IPAddressPool | ||
metadata: | ||
name: example | ||
namespace: metallb-system | ||
spec: | ||
addresses: | ||
- 172.18.255.200-172.18.255.250 | ||
--- | ||
apiVersion: metallb.io/v1beta1 | ||
kind: L2Advertisement | ||
metadata: | ||
name: empty | ||
namespace: metallb-system | ||
|
21 changes: 21 additions & 0 deletions
21
docs/tutorials/starting-with-porch/name-namespace-variant.yaml
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: config.porch.kpt.dev/v1alpha2 | ||
kind: PackageVariantSet | ||
|
||
metadata: | ||
name: network-function-auto-namespace | ||
namespace: porch-demo | ||
|
||
spec: | ||
upstream: | ||
repo: management | ||
package: network-function-auto-namespace | ||
revision: v1 | ||
targets: | ||
- repositories: | ||
- name: edge1 | ||
packageNames: | ||
- network-function-auto-namespace-x | ||
- network-function-auto-namespace-y | ||
template: | ||
downstream: | ||
packageExpr: "target.package + '-cumulonimbus'" |
59 changes: 59 additions & 0 deletions
59
docs/tutorials/starting-with-porch/porch-repositories.yaml
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: Repository | ||
|
||
metadata: | ||
name: edge1 | ||
namespace: porch-demo | ||
|
||
spec: | ||
description: edge1 | ||
content: Package | ||
deployment: true | ||
type: git | ||
git: | ||
repo: http://172.18.255.200:3000/nephio/edge1.git | ||
directory: / | ||
branch: main | ||
createBranch: true | ||
secretRef: | ||
name: gitea | ||
|
||
--- | ||
|
||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: Repository | ||
|
||
metadata: | ||
name: management | ||
namespace: porch-demo | ||
|
||
spec: | ||
description: management | ||
content: Package | ||
deployment: false | ||
type: git | ||
git: | ||
repo: http://172.18.255.200:3000/nephio/management.git | ||
directory: / | ||
branch: main | ||
secretRef: | ||
name: gitea | ||
|
||
--- | ||
|
||
apiVersion: config.porch.kpt.dev/v1alpha1 | ||
kind: Repository | ||
|
||
metadata: | ||
name: external-blueprints | ||
namespace: porch-demo | ||
|
||
spec: | ||
description: External blueprints | ||
content: Package | ||
deployment: false | ||
type: git | ||
git: | ||
repo: https://github.com/nephio-project/free5gc-packages.git | ||
directory: / | ||
branch: main |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: config.porch.kpt.dev/v1alpha2 | ||
kind: PackageVariantSet | ||
|
||
metadata: | ||
name: network-function | ||
namespace: porch-demo | ||
|
||
spec: | ||
upstream: | ||
repo: management | ||
package: network-function | ||
revision: v1 | ||
targets: | ||
- repositories: | ||
- name: edge1 | ||
packageNames: | ||
- network-function-b | ||
- network-function-c |
2 changes: 2 additions & 0 deletions
2
docs/tutorials/starting-with-porch/tmp_pacakges_for_deployment/.gitignore
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |