Skip to content

Commit

Permalink
Update readme, fix go-lint, fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielXLee committed Jul 9, 2021
1 parent 8c8e2ed commit 711592a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm,linux/ppc64le,linux/s390x,linux/386,darwin/amd64,darwin/arm64
platforms: linux/amd64,linux/arm64,linux/arm,linux/ppc64le,linux/s390x,darwin
file: ./Dockerfile
push: true
tags: quay.io/danielxlee/cluster-fabric-operator:latest
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# Image repo
IMG_REPO ?= quay.io/danielxlee
# Image URL to use all building/pushing image targets
IMG ?= cluster-fabric-operator:latest
IMG ?= ${IMG_REPO}/cluster-fabric-operator:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

Expand Down Expand Up @@ -60,7 +61,7 @@ goimports: ## Run goimports for controllers and main.go
goimports -w -local github.com/tkestack main.go

lint-go: ## Run lint go
golangci-lint run ./... -c common/config/.golangci.yml
golangci-lint run ./... -c hack/config/.golangci.yml

ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: manifests generate fmt vet ## Run tests.
Expand Down
78 changes: 61 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
<p align="center">
<a href="https://github.com/tkestack/cluster-fabric-operator">
<img src="https://github.com/tkestack/cluster-fabric-operator/workflows/CI%20Pipeline/badge.svg" alt="Github CI">
Expand All @@ -16,11 +12,16 @@
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
</a>
</p>

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Cluster Fabric Operator](#cluster-fabric-operator)
- [Architecture](#architecture)
- [Purpose](#purpose)
- [Supported Features](#supported-features)
- [Getting Started](#getting-started)
- [Getting Started](#getting-started)
- [Example](#example)
- [Prerequisites](#prerequisites)
- [Quickstart](#quickstart)
Expand All @@ -33,6 +34,9 @@ A Golang based fabric operator that will make/oversee Submariner components on t

## Architecture

<div align="center">
<img src="./docs/icons/submariner-arch.png">
</div>

### Purpose

Expand All @@ -43,30 +47,70 @@ The purpose of creating this operator was to provide an easy and production-grad
Here the features which are supported by this operator:-

- Deploy submariner broker
- Join managed cluster to broker
- Join cluster to broker
- Check k8s server version
- Support cloud prepare (AWS, GCE)
- Support components enable/disable
- Support cloud prepare (aws, gcp)
- Support lighthouse, globalnet enable/disable

### Getting Started
## Getting Started

### Example

The configuration of Fabric setup should be described in Fabric CRD. You will find all the examples manifests in [example](./config/samples) folder.

### Prerequisites

Fabric operator requires a Kubernetes cluster of version `>=1.5.0`. If you have just started with Operators, its highly recommended to use latest version of Kubernetes.
Fabric operator requires a Kubernetes cluster of version `>=1.5.0`. If you have just started with Operators, its highly recommended to use latest version of Kubernetes. And the prepare 2 cluster, example `cluster-a` and `cluster-b`

### Quickstart

The setup can be done by using `kustomize`.

```shell
$ git clone https://github.com/tkestack/cluster-fabric-operator.git
```
1. Clone source code

```shell
$ git clone https://github.com/tkestack/cluster-fabric-operator.git
```

1. Deploy broker

- Install fabric operator

```shell
$ kubectl config use-context cluster-a
$ cd cluster-fabric-operator
$ make deploy
```

- Deploy broker on `cluster-a`

```shell
$ kubect -n cluster-fabric-operator-system apply -f .config/samples/operator_v1alpha1_fabric_deploy_broker.yaml
```

- Export `submariner-broker-info` configmap to a yaml file

```shell
$ kubectl -n submariner-k8s-broker get cm submariner-broker-info -oyaml > submariner-k8s-broker.yaml
```

1. Join cluster to broker

- Install fabric operator

```shell
$ kubectl config use-context cluster-b
$ make deploy
```

- Create `submariner-broker-info` configmap

```shell
$ kubectl apply -f submariner-k8s-broker.yaml
```

- Join `cluster-a` to `cluster-b`

```shell
$ cd cluster-fabric-operator
$ make deploy
```
```shell
$ kubectl -n cluster-fabric-operator-system apply -f .config/samples/operator_v1alpha1_fabric_deploy_broker.yaml
```
2 changes: 1 addition & 1 deletion config/samples/operator_v1alpha1_fabric_join_broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: join-broker-sample
spec:
joinConfig:
clusterID: cls-mdl3wn46
clusterID: cluster-b
# forceUDPEncaps: false
# globalnetClusterSize: 0
# healthCheckEnable: true
Expand Down
5 changes: 5 additions & 0 deletions controllers/discovery/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ func networkPluginsDiscovery(dynClient dynamic.Interface, c client.Client) (*Clu
return canalClusterNet, err
}

flannelClusterNet, err := discoverFlannelNetwork(c)
if err != nil || flannelClusterNet != nil {
return flannelClusterNet, err
}

ovnClusterNet, err := discoverOvnKubernetesNetwork(c)
if err != nil || ovnClusterNet != nil {
return ovnClusterNet, err
Expand Down
File renamed without changes.

0 comments on commit 711592a

Please sign in to comment.