From 8e060dc33b329ed45f8dbe5c023ec543595b5484 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Thu, 7 Mar 2024 10:40:37 -0800 Subject: [PATCH] Enable Nephio --- .github/.wordlist.txt | 2 ++ README.md | 1 + _commons.sh | 23 +++++++++++++++++++++++ _installers.sh | 15 +++++++++++++++ ci/update_versions.sh | 1 + playbooks/krd-vars.yml | 1 + 6 files changed, 43 insertions(+) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index de3f7aba..7ba85ff2 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -83,7 +83,9 @@ METALLB Mirantis MULTUS NDOTS +Nephio NFD +NFs NGINX NodeLocal NODELOCALDNS diff --git a/README.md b/README.md index cb7fcfeb..e06b5c39 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ different scenarios. There are different setups located in the | Kyverno | Kubernetes Native Policy Management | | Tested | | Kubewarden | Kubernetes Native Policy Management | | Tested | | kube-monkey | Netflix's Chaos Monkey for Kubernetes clusters | | Implemented | +| Nephio | Management platform to on-board NFs at scale | | Implemented | ## Quick Deployment diff --git a/_commons.sh b/_commons.sh index 9ed9ed18..0de4c4fe 100755 --- a/_commons.sh +++ b/_commons.sh @@ -356,6 +356,29 @@ function _vercmp { esac } +function _deploy_kpt_pkg { + local pkg=$1 + local repo=${2:-https://github.com/nephio-project/catalog.git} + local dest=${3:-${pkg##*/}} + local revision=${4:-main} + local for_deployment=${5:-false} + + if ! command -v kpt >/dev/null; then + curl -s "https://i.jpillora.com/kptdev/kpt@v$(_get_version kpt)!" | bash + kpt completion bash | sudo tee /etc/bash_completion.d/kpt >/dev/null + fi + + [[ ! $dest =~ "/" ]] || mkdir -p "${dest%/*}" + [ "$(ls -A $dest)" ] || kpt pkg get "$repo/${pkg}@${revision}" "$dest" --for-deployment "$for_deployment" + newgrp docker </dev/null || exit + pkgs="nephio/core/porch " + pkgs+="nephio/core/nephio-operator nephio/optional/resource-backend " + pkgs+="nephio/core/configsync " # Required for access tokens to connect to gitea services + pkgs+="nephio/optional/network-config " # Required for workload cluster provisioning process + + for pkg in $pkgs; do + _deploy_kpt_pkg "$pkg" + done + popd >/dev/null + #kubectl prof -t 5m --lang go -n porch-system -o flamegraph --local-path=/tmp $(kubectl get pods -n porch-system -l app=porch-server -o jsonpath='{.items[*].metadata.name}') +} diff --git a/ci/update_versions.sh b/ci/update_versions.sh index e503729b..a287b511 100755 --- a/ci/update_versions.sh +++ b/ci/update_versions.sh @@ -94,6 +94,7 @@ for img in cainjector controller webhook; do set_kubespray_img_version "$kubespray_defaults" "cert-manager-$img" "cert_manager_version" done +sed -i "s/kpt_version:.*/kpt_version: $(get_version github_release kptdev/kpt)/g" ./playbooks/krd-vars.yml sed -i "s/istio_version:.*/istio_version: $(get_version github_release istio/istio)/g" ./playbooks/krd-vars.yml sed -i "s/cfssl_version:.*/cfssl_version: $(get_version github_release cloudflare/cfssl)/g" ./playbooks/krd-vars.yml sed -i "s/sonobuoy_version:.*/sonobuoy_version: $(get_version github_release vmware-tanzu/sonobuoy)/g" ./playbooks/krd-vars.yml diff --git a/playbooks/krd-vars.yml b/playbooks/krd-vars.yml index 641039d1..c967f956 100644 --- a/playbooks/krd-vars.yml +++ b/playbooks/krd-vars.yml @@ -7,6 +7,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +kpt_version: 1.0.0-beta.49 go_version: 1.15.3 kubespray_version: v2.24.1 istio_version: 1.18.2