diff --git a/examples/config/tutorials/starting-with-porch/blueprints/initialized/.gitignore b/examples/config/tutorials/starting-with-porch/blueprints/initialized/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/initialized/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/Kptfile b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/Kptfile new file mode 100644 index 00000000..44cbe35c --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/Kptfile @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/README.md b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/README.md new file mode 100644 index 00000000..6f2fef01 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/README.md @@ -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/ diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/deployment.yaml b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/deployment.yaml new file mode 100644 index 00000000..9330f2e4 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/deployment.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/package-context.yaml b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/package-context.yaml new file mode 100644 index 00000000..036b4fd0 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function-auto-namespace/package-context.yaml @@ -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 \ No newline at end of file diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/Kptfile b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/Kptfile new file mode 100644 index 00000000..7a79f11e --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/Kptfile @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/README.md b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/README.md new file mode 100644 index 00000000..abb26ef7 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/README.md @@ -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/ diff --git a/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/deployment.yaml b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/deployment.yaml new file mode 100644 index 00000000..11d67f9e --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/blueprints/local-changes/network-function/deployment.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/kind_edge1_cluster.yaml b/examples/config/tutorials/starting-with-porch/kind_edge1_cluster.yaml new file mode 100644 index 00000000..6b36f90a --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/kind_edge1_cluster.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/kind_management_cluster.yaml b/examples/config/tutorials/starting-with-porch/kind_management_cluster.yaml new file mode 100644 index 00000000..4ff69763 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/kind_management_cluster.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/kpt_packages/.gitignore b/examples/config/tutorials/starting-with-porch/kpt_packages/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/kpt_packages/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/examples/config/tutorials/starting-with-porch/metallb-conf.yaml b/examples/config/tutorials/starting-with-porch/metallb-conf.yaml new file mode 100644 index 00000000..57230289 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/metallb-conf.yaml @@ -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 + diff --git a/examples/config/tutorials/starting-with-porch/name-namespace-variant.yaml b/examples/config/tutorials/starting-with-porch/name-namespace-variant.yaml new file mode 100644 index 00000000..ecc87690 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/name-namespace-variant.yaml @@ -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'" diff --git a/examples/config/tutorials/starting-with-porch/porch-repositories.yaml b/examples/config/tutorials/starting-with-porch/porch-repositories.yaml new file mode 100644 index 00000000..9ede4433 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/porch-repositories.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/repos/.gitignore b/examples/config/tutorials/starting-with-porch/repos/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/repos/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/examples/config/tutorials/starting-with-porch/simple-variant.yaml b/examples/config/tutorials/starting-with-porch/simple-variant.yaml new file mode 100644 index 00000000..1960b027 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/simple-variant.yaml @@ -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 diff --git a/examples/config/tutorials/starting-with-porch/tmp_packages_for_deployment/.gitignore b/examples/config/tutorials/starting-with-porch/tmp_packages_for_deployment/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/examples/config/tutorials/starting-with-porch/tmp_packages_for_deployment/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore