Skip to content

Commit

Permalink
Enable Nephio
Browse files Browse the repository at this point in the history
  • Loading branch information
electrocucaracha committed Mar 21, 2024
1 parent 3808e78 commit 8e060dc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ METALLB
Mirantis
MULTUS
NDOTS
Nephio
NFD
NFs
NGINX
NodeLocal
NODELOCALDNS
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 23 additions & 0 deletions _commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<BASH
kpt fn render $dest
BASH
kpt live init "$dest" --force
newgrp docker <<BASH
kpt live apply $dest
BASH
}

function _run_ansible_cmd {
local playbook=$1
local log=$2
Expand Down
15 changes: 15 additions & 0 deletions _installers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,18 @@ function install_virtink {
kubectl apply -f "https://github.com/smartxworks/virtink/releases/download/$virtink_version/virtink.yaml"
wait_for_pods virtink-system
}

# install_nephio() - Installs Nephio project
function install_nephio {
pushd "$(mktemp -d -t "nephio-pkg-XXX")" >/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}')
}
1 change: 1 addition & 0 deletions ci/update_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions playbooks/krd-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e060dc

Please sign in to comment.