Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
1. fix typos;
2. fix clusterrole rules;
3. use os package instead of deprecated io/ioutil;
4. update go modules.
  • Loading branch information
zhangzujian committed Dec 20, 2021
1 parent 7199d21 commit d18323a
Show file tree
Hide file tree
Showing 14 changed files with 106 additions and 94 deletions.
8 changes: 4 additions & 4 deletions cmd/daemon/cniserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
_ "net/http/pprof" // #nosec
"os"
"strings"
"time"

Expand Down Expand Up @@ -81,11 +81,11 @@ func CmdMain() {
}

func mvCNIConf() error {
data, err := ioutil.ReadFile("/kube-ovn/01-kube-ovn.conflist")
data, err := os.ReadFile("/kube-ovn/01-kube-ovn.conflist")
if err != nil {
return err
}
return ioutil.WriteFile("/etc/cni/net.d/01-kube-ovn.conflist", data, 0444)
return os.WriteFile("/etc/cni/net.d/01-kube-ovn.conflist", data, 0444)
}

func Retry(attempts int, sleep int, f func(configuration *daemon.Configuration) error, ctrl *daemon.Configuration) (err error) {
Expand All @@ -103,7 +103,7 @@ func Retry(attempts int, sleep int, f func(configuration *daemon.Configuration)
}

func initChassisAnno(cfg *daemon.Configuration) error {
chassisID, err := ioutil.ReadFile(util.ChassisLoc)
chassisID, err := os.ReadFile(util.ChassisLoc)
if err != nil {
klog.Errorf("read chassis file failed, %v", err)
return err
Expand Down
4 changes: 3 additions & 1 deletion dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ rules:
- apiGroups:
- "kubeovn.io"
resources:
- vpcs
- vpcs/status
- vpc-nat-gateways
- subnets
- subnets/status
- ips
Expand Down Expand Up @@ -1415,7 +1418,6 @@ rules:
- vlans
- provider-networks
- provider-networks/status
- networks
- security-groups
- security-groups/status
- htbqoses
Expand Down
1 change: 0 additions & 1 deletion dist/images/update/1.7-1.8.2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ rules:
- vlans
- provider-networks
- provider-networks/status
- networks
- security-groups
- security-groups/status
verbs:
Expand Down
2 changes: 1 addition & 1 deletion docs/dpdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dpdk-hugepage-dir=/dev/hugepages
## To Install

1. Download the installation script:
`wget https://raw.githubusercontent.com/alauda/kube-ovn/release-1.7/dist/images/install.sh`
`wget https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.7/dist/images/install.sh`

2. Use vim to edit the script variables to meet your requirement

Expand Down
14 changes: 7 additions & 7 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ Kube-OVN provides a one script install to easily install a high-available, produ
1. Download the stable release installer scripts.

For Kubernetes version>=1.16:
`wget https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/dist/images/install.sh`
`wget https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/dist/images/install.sh`

If you want to try the latest developing Kube-OVN, try the script below:
`wget https://raw.githubusercontent.com/alauda/kube-ovn/master/dist/images/install.sh`
`wget https://raw.githubusercontent.com/kubeovn/kube-ovn/master/dist/images/install.sh`

2. Use vim to edit the script variables to meet your requirement:
```bash
Expand Down Expand Up @@ -63,22 +63,22 @@ For Kubernetes version before 1.17 please use the following command to add the n
`kubectl label node <Node on which to deploy OVN DB> kube-ovn/role=master`
2. Install Kube-OVN related CRDs:

`kubectl apply -f https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/yamls/crd.yaml`
`kubectl apply -f https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/yamls/crd.yaml`
3. Get ovn.yaml and replace `$addresses` in the file with IP address of the node that will host the OVN DB and the OVN Control Plane:

`curl -O https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/yamls/ovn.yaml`
`curl -O https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/yamls/ovn.yaml`

`sed -i 's/\$addresses/<Node IP>/g' ovn.yml`
4. Install native OVS and OVN components:

`kubectl apply -f ovn.yaml`
5. Install the Kube-OVN Controller and CNI plugins:

`kubectl apply -f https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/yamls/kube-ovn.yaml`
`kubectl apply -f https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/yamls/kube-ovn.yaml`

For high-available ovn db, see [High Availability](high-availability.md).

If you want to enable IPv6 on default subnet and node subnet, please apply https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/yamls/kube-ovn-ipv6.yaml on Step 3.
If you want to enable IPv6 on default subnet and node subnet, please apply https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/yamls/kube-ovn-ipv6.yaml on Step 3.

## More Configuration

Expand Down Expand Up @@ -198,7 +198,7 @@ kubectl create -n kube-system configmap admin-conf --from-file=config=admin.conf
1. Remove Kubernetes resources:

```bash
wget https://raw.githubusercontent.com/alauda/kube-ovn/release-1.8/dist/images/cleanup.sh
wget https://raw.githubusercontent.com/kubeovn/kube-ovn/release-1.8/dist/images/cleanup.sh
bash cleanup.sh
```

Expand Down
2 changes: 1 addition & 1 deletion docs/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can use the command downside to install Cert-Manager
And the help document refers to [cert-manager](https://cert-manager.io/docs/installation/).

## Webhook installation
The wehook has not been added to the `install.sh` script. So it should be installed manullay with the command `kubectl apply -f yamls/webhook.yaml`.
The webhook has not been added to the `install.sh` script. So it should be installed manually with the command `kubectl apply -f yamls/webhook.yaml`.

After installation, you can find a pod in kube-system the same namespace as other pods.

Expand Down
68 changes: 34 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/vishvananda/netlink v1.1.1-0.20211101163509-b10eb8fe5cf6
golang.org/x/sys v0.0.0-20211210111614-af8b64212486
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
google.golang.org/grpc v1.40.0
gopkg.in/k8snetworkplumbingwg/multus-cni.v3 v3.7.2
k8s.io/api v0.23.0
k8s.io/apimachinery v0.23.0
k8s.io/client-go v0.23.0
k8s.io/api v0.23.1
k8s.io/apimachinery v0.23.1
k8s.io/client-go v0.23.1
k8s.io/klog/v2 v2.30.0
k8s.io/sample-controller v0.23.0
sigs.k8s.io/controller-runtime v0.0.0-20211208212546-f236f0345ad2
k8s.io/sample-controller v0.23.1
sigs.k8s.io/controller-runtime v0.11.0
)

require (
Expand All @@ -48,7 +48,7 @@ require (
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-ini/ini v1.42.0 // indirect
github.com/go-logr/logr v1.2.1 // indirect
github.com/go-logr/logr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.5 // indirect
Expand Down Expand Up @@ -88,7 +88,7 @@ require (
github.com/stretchr/objx v0.3.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f // indirect
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/text v0.3.7 // indirect
Expand All @@ -103,8 +103,8 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/apiextensions-apiserver v0.23.0 // indirect
k8s.io/component-base v0.23.0 // indirect
k8s.io/apiextensions-apiserver v0.23.1 // indirect
k8s.io/component-base v0.23.1 // indirect
k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b // indirect
moul.io/http2curl v1.0.0 // indirect
Expand All @@ -116,28 +116,28 @@ require (
replace (
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
github.com/greenpau/ovsdb => github.com/alauda/ovsdb v0.0.0-20210113100339-040cf3e76c28
k8s.io/api => k8s.io/api v0.23.0
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.0
k8s.io/apimachinery => k8s.io/apimachinery v0.23.0
k8s.io/apiserver => k8s.io/apiserver v0.23.0
k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.0
k8s.io/client-go => k8s.io/client-go v0.23.0
k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.0
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.0
k8s.io/code-generator => k8s.io/code-generator v0.23.0
k8s.io/component-base => k8s.io/component-base v0.23.0
k8s.io/component-helpers => k8s.io/component-helpers v0.23.0
k8s.io/controller-manager => k8s.io/controller-manager v0.23.0
k8s.io/cri-api => k8s.io/cri-api v0.23.0
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.0
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.0
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.0
k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.0
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.0
k8s.io/kubectl => k8s.io/kubectl v0.23.0
k8s.io/kubelet => k8s.io/kubelet v0.23.0
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.0
k8s.io/metrics => k8s.io/metrics v0.23.0
k8s.io/mount-utils => k8s.io/mount-utils v0.23.0
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.0
k8s.io/api => k8s.io/api v0.23.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.1
k8s.io/apimachinery => k8s.io/apimachinery v0.23.1
k8s.io/apiserver => k8s.io/apiserver v0.23.1
k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.1
k8s.io/client-go => k8s.io/client-go v0.23.1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.1
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.1
k8s.io/code-generator => k8s.io/code-generator v0.23.1
k8s.io/component-base => k8s.io/component-base v0.23.1
k8s.io/component-helpers => k8s.io/component-helpers v0.23.1
k8s.io/controller-manager => k8s.io/controller-manager v0.23.1
k8s.io/cri-api => k8s.io/cri-api v0.23.1
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.1
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.1
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.1
k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.1
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.1
k8s.io/kubectl => k8s.io/kubectl v0.23.1
k8s.io/kubelet => k8s.io/kubelet v0.23.1
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.1
k8s.io/metrics => k8s.io/metrics v0.23.1
k8s.io/mount-utils => k8s.io/mount-utils v0.23.1
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.1
)

0 comments on commit d18323a

Please sign in to comment.