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

Restore tutorial example configuration files #117

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kpt.dev/v1
kind: Kptfile

metadata:
name: network-function-auto-namespace
annotations:
config.kubernetes.io/local-config: "true"

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
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/
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kpt.dev/v1
kind: Kptfile

metadata:
name: network-function
annotations:
config.kubernetes.io/local-config: "true"

info:
description: network function blueprint
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/
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
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
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
15 changes: 15 additions & 0 deletions examples/config/tutorials/starting-with-porch/metallb-conf.yaml
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

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'"
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
18 changes: 18 additions & 0 deletions examples/config/tutorials/starting-with-porch/simple-variant.yaml
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Loading