-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update presubmit * update go mod and fmt * expand test * fix lint * fix linter * add missing cluster delete * fix vm name overlap * fix path resolution * fix bad indentation * remove interactive mode * remove interactive mode for cp * address comments * fix failure in kubeadm cluster * add sudo back for kubeadm * add unlicensed ixia option * increase boot disk size to avoid space issues * use separate dep cfg * fix filepath * enable nested virt * fix test path * fix flags * revert timeout * use ondatra 1.9 * update srl model * remove p4rt from xrd test
- Loading branch information
Showing
22 changed files
with
1,644 additions
and
396 deletions.
There are no files selected for viewing
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
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
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
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,116 @@ | ||
#!/bin/bash | ||
# Copyright 2023 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -xe | ||
|
||
export PATH=${PATH}:/usr/local/go/bin | ||
gopath=$(go env GOPATH) | ||
export PATH=${PATH}:$gopath/bin | ||
|
||
# Replace exisiting kne repo with new version | ||
rm -r "$HOME/kne" | ||
cp -r /tmp/workspace "$HOME/kne" | ||
|
||
# Rebuild the kne cli | ||
pushd "$HOME/kne/kne_cli" | ||
go build -o kne | ||
cli="$HOME/kne/kne_cli/kne" | ||
popd | ||
|
||
# Deploy a kind cluster | ||
pushd "$HOME" | ||
$cli deploy kne/deploy/kne/kind-bridge.yaml | ||
|
||
kubectl get pods -A | ||
|
||
# Redeploy the same cluster | ||
$cli deploy kne/deploy/kne/kind-bridge.yaml | ||
|
||
kubectl get pods -A | ||
|
||
# Cleanup the kind cluster | ||
kind delete cluster --name kne | ||
|
||
# Create a kind cluster with GAR access and image loading | ||
cat >/tmp/dep-cfg.yaml << EOF | ||
cluster: | ||
kind: Kind | ||
spec: | ||
name: kne | ||
recycle: True | ||
version: v0.17.0 | ||
image: 'kindest/node:v1.26.0' | ||
googleArtifactRegistries: | ||
- us-west1-docker.pkg.dev | ||
containerImages: | ||
'us-west1-docker.pkg.dev/kne-external/kne/networkop/init-wait:ga': 'networkop/init-wait:latest' | ||
config: ${HOME}/kne/kind/kind-no-cni.yaml | ||
additionalManifests: | ||
- ${HOME}/kne/manifests/kind/kind-bridge.yaml | ||
ingress: | ||
kind: MetalLB | ||
spec: | ||
manifest: ${HOME}/kne/manifests/metallb/manifest.yaml | ||
ip_count: 100 | ||
cni: | ||
kind: Meshnet | ||
spec: | ||
manifest: ${HOME}/kne/manifests/meshnet/grpc/manifest.yaml | ||
EOF | ||
|
||
$cli deploy /tmp/dep-cfg.yaml | ||
|
||
kubectl get pods -A | ||
|
||
# Check for existence of preloaded image | ||
if ! docker exec kne-control-plane crictl images | grep "docker.io/networkop/init-wait"; then | ||
echo "Unable to find preloaded image in cluster" | ||
exit 1 | ||
fi | ||
|
||
# Cleanup the kind cluster | ||
kind delete cluster --name kne | ||
|
||
# Create a kubeadm single node cluster | ||
sudo kubeadm init --cri-socket unix:///var/run/cri-dockerd.sock --pod-network-cidr 10.244.0.0/16 | ||
mkdir -p "$HOME"/.kube | ||
sudo cp /etc/kubernetes/admin.conf "$HOME"/.kube/config | ||
sudo chown "$(id -u)":"$(id -g)" "$HOME"/.kube/config | ||
kubectl taint nodes --all node-role.kubernetes.io/control-plane- # allows pods to be scheduled on control plane node | ||
kubectl apply -f "$HOME"/flannel/Documentation/kube-flannel.yml | ||
docker network create multinode | ||
|
||
# Deploy an external cluster | ||
$cli deploy kne/deploy/kne/external-multinode.yaml | ||
|
||
kubectl get pods -A | ||
|
||
# Create a simple lemming topology | ||
$cli create kne/examples/openconfig/lemming.pb.txt | ||
|
||
kubectl get pods -A | ||
|
||
kubectl get services -A | ||
|
||
# Use the KNE cli to interact with the topology | ||
$cli show kne/examples/openconfig/lemming.pb.txt | ||
|
||
$cli topology service kne/examples/openconfig/lemming.pb.txt | ||
|
||
# Delete the topology | ||
|
||
$cli delete kne/examples/openconfig/lemming.pb.txt | ||
|
||
popd |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.