Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor import sequence and fix typo #93

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ same node, with this second interface assigned to the ``cnf`` network namespace.
## Helm Chart Installation and Clear

`Nauti` is pretty easy to install with `Helm`. Make sure you already have at least 2 Kubernetes clusters,
please refer to this installation guide. [Helm Chart Page](https://nauti-io.github.io/nauti-charts/
please refer to this installation guide [Helm Chart Page](https://nauti-io.github.io/nauti-charts/).

After the installation, add cross cluster DNS config segment, in `coredns` configmap, and restart coredns pods.
The `cluster-ip` of `crossdns` is a static cluster IP, usually `10.96.0.11` , check before setting.
Expand Down
4 changes: 2 additions & 2 deletions cmd/ep-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"path/filepath"
"time"

"github.com/google/uuid"
"github.com/sirupsen/logrus"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/informers"
Expand All @@ -19,8 +17,10 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/klog/v2"

"github.com/google/uuid"
"github.com/nauti-io/nauti/pkg/controller/endpoint"
"github.com/nauti-io/nauti/pkg/controller/endpointslice"
"github.com/sirupsen/logrus"
)

var (
Expand Down
5 changes: 2 additions & 3 deletions deploy/hub/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ Your release is named {{ .Release.Name }}.

Continue to install nauti-agent on clusters, and install nauti-agent in cluster by:

helm install nauti-agent mcs/nauti-agent --namespace nauti-system --create-namespace \
--set hub.hubURL=https://{{ .Values.tunnel.endpoint }}:6443 \
--set tunnel.globalcidr={{ .Values.tunnel.cidr }} --set tunnel.cidr=10.113.0.0/16 --set cluster.clusterID=cluster1
helm install nauti-agent nauti/nauti-agent --namespace nauti-system --create-namespace \
--set hub.hubURL=https://{{ .Values.tunnel.endpoint }}:6443 --set cluster.clusterID=cluster1
12 changes: 6 additions & 6 deletions pkg/cnf/CNFManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ import (
"sync"
"time"

"github.com/kelseyhightower/envconfig"
syncerConfig "github.com/nauti-io/nauti/pkg/config"
"github.com/nauti-io/nauti/pkg/controller/syncer"
tunnelcontroller "github.com/nauti-io/nauti/pkg/controller/tunnel"
octopusClientset "github.com/nauti-io/nauti/pkg/generated/clientset/versioned"
kubeinformers "github.com/nauti-io/nauti/pkg/generated/informers/externalversions"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand All @@ -24,7 +18,13 @@ import (
"k8s.io/klog/v2"
mcsv1a1 "sigs.k8s.io/mcs-api/pkg/apis/v1alpha1"

"github.com/kelseyhightower/envconfig"
syncerConfig "github.com/nauti-io/nauti/pkg/config"
"github.com/nauti-io/nauti/pkg/controller/syncer"
tunnelcontroller "github.com/nauti-io/nauti/pkg/controller/tunnel"
"github.com/nauti-io/nauti/pkg/dedinic"
octopusClientset "github.com/nauti-io/nauti/pkg/generated/clientset/versioned"
kubeinformers "github.com/nauti-io/nauti/pkg/generated/informers/externalversions"
"github.com/nauti-io/nauti/pkg/known"
"github.com/nauti-io/nauti/pkg/tunnel"
"github.com/nauti-io/nauti/utils"
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/endpointslice/endpointslice.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"time"

"golang.org/x/time/rate"

v1 "k8s.io/api/core/v1"
discovery "k8s.io/api/discovery/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down
16 changes: 0 additions & 16 deletions pkg/controller/mcs/serviceexport_controller.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
Copyright 2022 The Clusternet Authors.

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

http://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.
*/

package mcs

import (
Expand Down
4 changes: 0 additions & 4 deletions pkg/controller/syncer/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,3 @@ func generateSliceName(clusterName, namespace, name string) string {

return fmt.Sprintf("%s-%s-%s", namespacePart, namePart, hashPart[8:24])
}

// func (a *Syncer) getObjectNameWithClusterID(name, namespace string) string {
// return generateSliceName(a.ClusterID, namespace, name)
// }
9 changes: 1 addition & 8 deletions pkg/known/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ package known
import "time"

const (
LabelValueManagedBy = "mcs.nauti.io"
OriginName = "origin-name"
OriginNamespace = "origin-namespace"
LabelSourceNamespace = "submariner-io/originatingNamespace"
LabelSourceCluster = "syncer.nauti.io/sourceCluster"
LabelSourceName = "syncer.nauti.io/sourceName"
LabelOriginNameSpace = "syncer.nauti.io/sourceNamespace"
LabelValueManagedBy = "mcs.nauti.io"
)

const (
MaxNamespaceLength = 10
MaxNameLength = 10
MaxClusternName = 10
)

type RouteOperation int
Expand Down
16 changes: 0 additions & 16 deletions utils/endpointslice.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
Copyright 2022 The Clusternet Authors.

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

http://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.
*/

package utils

import (
Expand Down
20 changes: 2 additions & 18 deletions utils/kubeconfig.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/*
Copyright 2021 The Clusternet Authors.

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

http://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.
*/

package utils

import (
Expand Down Expand Up @@ -55,8 +39,8 @@ func createBasicKubeConfig(serverURL, clusterName, userName string, caCert []byt

// CreateKubeConfigWithToken creates a KubeConfig object with access to the API server with a token
func CreateKubeConfigWithToken(serverURL, token string, caCert []byte) *clientcmdapi.Config {
userName := "clusternet"
clusterName := "clusternet-cluster"
userName := "nauti"
clusterName := "nauti-cluster"
config := createBasicKubeConfig(serverURL, clusterName, userName, caCert)
config.AuthInfos[userName] = &clientcmdapi.AuthInfo{
Token: token,
Expand Down
Loading