Skip to content

Commit

Permalink
edits for test
Browse files Browse the repository at this point in the history
  • Loading branch information
jchua99 committed Feb 2, 2024
1 parent fc14fa7 commit 7bd8a76
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 37 deletions.
17 changes: 16 additions & 1 deletion scripts/openyurt-deployer/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Quick set-up `OpenYurt`

## 1. Introduction
## 1.1 Introduction

This program extends [`EasyOpenyurt`](https://github.com/flyinghorse0510/easy_openyurt) to automate the set up process of an `OpenYurt` cluster.

It support setting up a Kubernetes cluster using kubeadm and then deploy `OpenYurt` and Knative on it. It is compatible with vHive stock-only mode.

## 1.2 About [`OpenYurt`](https://openyurt.io/docs/#:~:text=Furthermore%2C%20OpenYurt%20enhances%20node%20reliability,node%20heartbeats%20to%20the%20cloud.)

### Key Features

#### 1. Powerful edge autonomy capability
OpenYurt addresses this issue by implementing a per-node proxy (YurtHub) along with local storage to cache the state of the cloud apiserver. Consequently, when a node loses its connection, the cached states remain accessible to Kubelet, KubeProxy, and any user Pods.

#### 2. Cross NodePool network communication capability

In an edge computing Kubernetes cluster, nodes are often distributed across various geographical regions. Consequently, when relying on a native Container Network Interface (CNI) solution, Pods within different NodePools may be unable to communicate using Pod IP, Service IP, or Node IP, particularly if each NodePool resides within its own isolated LAN. Raven offers a networking solution that enables cross-NodePool communication within an OpenYurt cluster.

#### 3. Multi-NodePool Management

In order to manage applications and traffic in multiple nodepools conveniently, YurtAppSet and YurtAppDaemon are introduced for managing workloads in multi-nodepool, and service topology capability for routing traffic in nodepool.

## 2. Brief overview

**Prerequisite of nodes:**
Expand Down
17 changes: 0 additions & 17 deletions scripts/openyurt-deployer/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,23 +99,6 @@ func jsonEqual(a, b interface{}) bool {

func TestParsingNodeDependencyVersion(t *testing.T) {

// Mock NodesInfo
mockNodesInfo := NodesInfo{
Master: "[email protected]",
// Workers: Workers{
// Cloud: []string{"cloud@host"},
// Edge: []string{"edge@host"},
// },
}

// Define a table of criteria
criteriaTable := map[string]string{
"Golang": "1.19.10",
"containerd": "1.6.18",
"runc": "1.1.4",
"CNI": "1.2.0",
}

// Capture standard output
r, w, err := os.Pipe()
if err != nil {
Expand Down
5 changes: 0 additions & 5 deletions scripts/openyurt-deployer/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,6 @@ func (node *Node) InstallKnativeServing() {
_, err = node.ExecShellCmd("kubectl get pods -n knative-serving")
utils.CheckErrorWithMsg(err, "Verification Failed!")

// // Configure DNS
// logs.WaitPrintf("Configuring DNS")
// _, err = node.ExecShellCmd("kubectl apply -f https://github.com/knative/serving/releases/download/knative-v%s/serving-default-domain.yaml", node.Configs.Knative.KnativeVersion)
// logs.CheckErrorWithTagAndMsg(err, "Failed to configure DNS!")

// enable node selector
utils.WaitPrintf("Enable node selector in knative serving")
_, err = node.ExecShellCmd(`kubectl patch cm config-features -n knative-serving \
Expand Down
14 changes: 0 additions & 14 deletions scripts/openyurt-deployer/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ import (
"testing"
)

var githubRunner = "[email protected]"
var mockNode = Node{
Name: githubRunner,
Client: SetupSSHConn(githubRunner),
NodeRole: "master",
Configs: &NodeConfig{
System: System,
Kube: Kube,
Knative: Knative,
Yurt: Yurt,
Demo: Demo,
},
}

func TestDetectArchofVM(t *testing.T) {
// Call the method to be tested
mockNode.DetectArch()
Expand Down
27 changes: 27 additions & 0 deletions scripts/openyurt-deployer/test_data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

// criteria table for testing ParsingNodeDependencyVersion
var criteriaTable = map[string]string{
"Golang": "1.19.10",
"containerd": "1.6.18",
"runc": "1.1.4",
"CNI": "1.2.0",
}

var mockNodesInfo = NodesInfo{
Master: "[email protected]",
}

var githubRunner = "[email protected]"
var mockNode = Node{
Name: githubRunner,
Client: SetupSSHConn(githubRunner),
NodeRole: "master",
Configs: &NodeConfig{
System: System,
Kube: Kube,
Knative: Knative,
Yurt: Yurt,
Demo: Demo,
},
}

0 comments on commit 7bd8a76

Please sign in to comment.