Skip to content

Commit

Permalink
meshery#5 Displaced all istio references with nsx-sm
Browse files Browse the repository at this point in the history
Signed-off-by: gunjanmimo <[email protected]>
  • Loading branch information
leecalcote authored and gunjanmimo committed Mar 23, 2020
1 parent cbdeb02 commit 48507f9
Show file tree
Hide file tree
Showing 21 changed files with 161 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: actions/setup-go@v1
with:
go-version: ${{ secrets.GO_VERSION }}
- run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
# - run: GOPROXY=direct GOSUMDB=off go get -u golang.org/x/lint/golint; go list ./... | grep -v /vendor/ | xargs -L1 /home/runner/go/bin/golint -set_exit_status
# error_check:
# name: Error check
# runs-on: ubuntu-latest
Expand Down
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM golang:1.13.1 as bd
RUN adduser --disabled-login --gecos "" appuser
WORKDIR /github.com/layer5io/meshery-istio
WORKDIR /github.com/layer5io/meshery-nsx-sm
ADD . .
RUN GOPROXY=direct GOSUMDB=off go build -ldflags="-w -s" -a -o /meshery-istio .
RUN find . -name "*.go" -type f -delete; mv istio /
RUN wget -O /istio.tar.gz https://github.com/istio/istio/releases/download/1.3.0/istio-1.3.0-linux.tar.gz
RUN GOPROXY=direct GOSUMDB=off go build -ldflags="-w -s" -a -o /meshery-nsx-sm .
RUN find . -name "*.go" -type f -delete; mv nsx-sm /
RUN wget -O /nsx-sm.tar.gz https://github.com/nsx-sm/nsx-sm/releases/download/1.3.0/nsx-sm-1.3.0-linux.tar.gz

FROM alpine
RUN apk --update add ca-certificates
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY --from=bd /meshery-istio /app/
COPY --from=bd /istio /app/istio
COPY --from=bd /istio.tar.gz /app/
COPY --from=bd /meshery-nsx-sm /app/
COPY --from=bd /nsx-sm /app/nsx-sm
COPY --from=bd /nsx-sm.tar.gz /app/
COPY --from=bd /etc/passwd /etc/passwd
ENV ISTIO_VERSION=istio-1.3.0
ENV nsx-sm_VERSION=nsx-sm-1.3.0
USER appuser
WORKDIR /app
CMD ./meshery-istio
CMD ./meshery-nsx-sm
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<p style="text-align:center;" align="center"><a href="https://layer5.io/meshery"><img align="center" style="margin-bottom:20px;" src="https://raw.githubusercontent.com/layer5io/layer5/master/assets/images/meshery/meshery-logo-tag-light-text-side.png" width="70%" /></a><br /><br /></p>

[![Docker Pulls](https://img.shields.io/docker/pulls/layer5/meshery-istio.svg)](https://hub.docker.com/r/layer5/meshery-istio)
[![Go Report Card](https://goreportcard.com/badge/github.com/layer5io/meshery-istio)](https://goreportcard.com/report/github.com/layer5io/meshery-istio)
[![Build Status](https://github.com/layer5io/meshery-istio/workflows/Meshery-Istio/badge.svg)](https://github.com/layer5io/meshery-istio/actions)
[![GitHub](https://img.shields.io/github/license/layer5io/meshery-istio.svg)](LICENSE)
[![GitHub issues by-label](https://img.shields.io/github/issues/layer5io/meshery-istio/help%20wanted.svg)](https://github.com/layer5io/meshery-istio/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted")
[![Docker Pulls](https://img.shields.io/docker/pulls/layer5/meshery-nsx-sm.svg)](https://hub.docker.com/r/layer5/meshery-nsx-sm)
[![Go Report Card](https://goreportcard.com/badge/github.com/layer5io/meshery-nsx-sm)](https://goreportcard.com/report/github.com/layer5io/meshery-nsx-sm)
[![Build Status](https://github.com/layer5io/meshery-nsx-sm/workflows/Meshery-NSX-SM/badge.svg)](https://github.com/layer5io/meshery-nsx-sm/actions)
[![GitHub](https://img.shields.io/github/license/layer5io/meshery-nsx-sm.svg)](LICENSE)
[![GitHub issues by-label](https://img.shields.io/github/issues/layer5io/meshery-nsx-sm/help%20wanted.svg)](https://github.com/layer5io/meshery-nsx-sm/issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted")
[![Website](https://img.shields.io/website/https/layer5.io/meshery.svg)](https://layer5.io/meshery/)
[![Twitter Follow](https://img.shields.io/twitter/follow/layer5.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mesheryio)
[![Slack](http://slack.layer5.io/badge.svg)](http://slack.layer5.io)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/layer5io/meshery-istio
module github.com/layer5io/meshery-nsx-sm

go 1.13

require (
github.com/Azure/go-autorest/autorest/adal v0.6.0 // indirect
github.com/aspenmesh/istio-client-go v0.0.0-20190426173040-3e73c27b9ace
github.com/aspenmesh/istio-vet v0.0.0-20190708155745-fac74e54e2e6
github.com/aspenmesh/nsx-sm-client-go v0.0.0-20190426173040-3e73c27b9ace
github.com/aspenmesh/nsx-sm-vet v0.0.0-20190708155745-fac74e54e2e6
github.com/cnf/structhash v0.0.0-20180104161610-62a607eb0224 // indirect
github.com/ghodss/yaml v1.0.0
github.com/gogo/protobuf v1.3.0 // indirect
Expand All @@ -27,7 +27,7 @@ require (
golang.org/x/tools v0.0.0-20191005014404-c9f9432ec4b2 // indirect
google.golang.org/grpc v1.23.0
gopkg.in/inf.v0 v0.9.1 // indirect
istio.io/api v0.0.0-20190905172106-906cbe6415a5 // indirect
nsx-sm.io/api v0.0.0-20190905172106-906cbe6415a5 // indirect
k8s.io/api v0.0.0-20190313235455-40a48860b5ab // indirect
k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1
k8s.io/client-go v11.0.0+incompatible
Expand Down
16 changes: 9 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L
github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/aspenmesh/istio-client-go v0.0.0-20190426173040-3e73c27b9ace h1:m+Xk2zXjEtnTGA4T3zb4+avMrIq6DBMqFJM3FcjGji0=
github.com/aspenmesh/istio-client-go v0.0.0-20190426173040-3e73c27b9ace/go.mod h1:HbtpC/r+MCS1vrS/OIs5vLVohdIh9KgX1utxg+fJ8WE=
github.com/aspenmesh/istio-vet v0.0.0-20190708155745-fac74e54e2e6 h1:kqFjAq0OKfwrqOASkZ3OhEQQGDUsFw5zwBEHsROGoNI=
github.com/aspenmesh/istio-vet v0.0.0-20190708155745-fac74e54e2e6/go.mod h1:8hVDM8l0fEURMlC806jrymafA2y9ty0tSmkx6KWuSSI=
github.com/aspenmesh/nsx-sm-client-go v0.0.0-20190426173040-3e73c27b9ace h1:m+Xk2zXjEtnTGA4T3zb4+avMrIq6DBMqFJM3FcjGji0=
github.com/aspenmesh/nsx-sm-client-go v0.0.0-20190426173040-3e73c27b9ace/go.mod h1:HbtpC/r+MCS1vrS/OIs5vLVohdIh9KgX1utxg+fJ8WE=
github.com/aspenmesh/nsx-sm-vet v0.0.0-20190708155745-fac74e54e2e6 h1:kqFjAq0OKfwrqOASkZ3OhEQQGDUsFw5zwBEHsROGoNI=
github.com/aspenmesh/nsx-sm-vet v0.0.0-20190708155745-fac74e54e2e6/go.mod h1:8hVDM8l0fEURMlC806jrymafA2y9ty0tSmkx6KWuSSI=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cnf/structhash v0.0.0-20180104161610-62a607eb0224 h1:rnCKRrdSBqc061l0CDuYB+7X3w6w8IK/VCSChJXv62g=
github.com/cnf/structhash v0.0.0-20180104161610-62a607eb0224/go.mod h1:pCxVEbcm3AMg7ejXyorUXi6HQCzOIBf7zEDVPtw0/U4=
Expand Down Expand Up @@ -66,6 +66,7 @@ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
Expand All @@ -75,6 +76,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down Expand Up @@ -127,9 +129,9 @@ gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
istio.io/api v0.0.0-20190905172106-906cbe6415a5 h1:FEDTpBQs8Qs0Upw7WeOZjyylwxP6rWcUmm5dquy3Dmo=
istio.io/api v0.0.0-20190905172106-906cbe6415a5/go.mod h1:42cBjnu/rTJcCaKi8nLdIvq0n71RcLrkgZ9IQSvDdSQ=
istio.io/gogo-genproto v0.0.0-20190731221249-06e20ada0df2/go.mod h1:IjvrbUlRbbw4JCpsgvgihcz9USUwEoNTL/uwMtyV5yk=
nsx-sm.io/api v0.0.0-20190905172106-906cbe6415a5 h1:FEDTpBQs8Qs0Upw7WeOZjyylwxP6rWcUmm5dquy3Dmo=
nsx-sm.io/api v0.0.0-20190905172106-906cbe6415a5/go.mod h1:42cBjnu/rTJcCaKi8nLdIvq0n71RcLrkgZ9IQSvDdSQ=
nsx-sm.io/gogo-genproto v0.0.0-20190731221249-06e20ada0df2/go.mod h1:IjvrbUlRbbw4JCpsgvgihcz9USUwEoNTL/uwMtyV5yk=
k8s.io/api v0.0.0-20190313235455-40a48860b5ab h1:DG9A67baNpoeweOy2spF1OWHhnVY5KR7/Ek/+U1lVZc=
k8s.io/api v0.0.0-20190313235455-40a48860b5ab/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA=
k8s.io/apimachinery v0.0.0-20190313205120-d7deff9243b1 h1:IS7K02iBkQXpCeieSiyJjGoLSdVOv2DbPaWHJ+ZtgKg=
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (

"github.com/sirupsen/logrus"

"github.com/layer5io/meshery-istio/istio"
mesh "github.com/layer5io/meshery-istio/meshes"
mesh "github.com/layer5io/meshery-nsx-sm/meshes"
"github.com/layer5io/meshery-nsx-sm/nsx-sm"
)

var (
Expand Down Expand Up @@ -55,7 +55,7 @@ func main() {
s := grpc.NewServer(
// grpc.Creds(credentials.NewServerTLSFromCert(&insecure.Cert)),
)
mesh.RegisterMeshServiceServer(s, &istio.Client{})
mesh.RegisterMeshServiceServer(s, &nsx-sm.Client{})

// Serve gRPC Server
logrus.Infof("Serving gRPC on %s", addr)
Expand Down
12 changes: 6 additions & 6 deletions istio/client.go → nsx-sm/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package istio
package nsx-sm

import (
"time"

"github.com/layer5io/meshery-istio/meshes"
"github.com/layer5io/meshery-nsx-sm/meshes"
"github.com/sirupsen/logrus"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
Expand All @@ -30,16 +30,16 @@ import (
"github.com/ghodss/yaml"
)

// Client represents an Istio client in Meshery
// Client represents an nsx-sm client in Meshery
type Client struct {
config *rest.Config
k8sClientset *kubernetes.Clientset
k8sDynamicClient dynamic.Interface
eventChan chan *meshes.EventsResponse

istioReleaseVersion string
istioReleaseDownloadURL string
istioReleaseUpdatedAt time.Time
nsx-smReleaseVersion string
nsx-smReleaseDownloadURL string
nsx-smReleaseUpdatedAt time.Time
}

func configClient(kubeconfig []byte, contextName string) (*rest.Config, error) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: networking.istio.io/v1alpha3
apiVersion: networking.nsx-sm.io/v1alpha3
kind: DestinationRule
metadata:
name: productpage
Expand All @@ -10,7 +10,7 @@ spec:
name: v1
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
mode: NSX-SM_MUTUAL
connectionPool:
tcp:
maxConnections: 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apiVersion: networking.istio.io/v1alpha3
apiVersion: networking.nsx-sm.io/v1alpha3
kind: DestinationRule
metadata:
name: httpbin
spec:
host: httpbin
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
mode: NSX-SM_MUTUAL
connectionPool:
tcp:
maxConnections: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ spec:
ports:
- containerPort: 80
---
apiVersion: networking.istio.io/v1alpha3
apiVersion: networking.nsx-sm.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
spec:
selector:
istio: ingressgateway
nsx-sm: ingressgateway
servers:
- port:
number: 80
Expand All @@ -46,7 +46,7 @@ spec:
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
apiVersion: networking.nsx-sm.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: smi-adapter-istio
namespace: istio-system
name: smi-adapter-nsx-sm
namespace: nsx-sm-system
spec:
replicas: 1
selector:
matchLabels:
name: smi-adapter-istio
name: smi-adapter-nsx-sm
template:
metadata:
labels:
name: smi-adapter-istio
name: smi-adapter-nsx-sm
annotations:
sidecar.istio.io/inject: "false"
sidecar.nsx-sm.io/inject: "false"
spec:
serviceAccountName: smi-adapter-istio
serviceAccountName: smi-adapter-nsx-sm
containers:
- name: smi-adapter-istio
image: layer5/smi-istio:latest
- name: smi-adapter-nsx-sm
image: layer5/smi-nsx-sm:latest
command:
- smi-adapter-istio
- smi-adapter-nsx-sm
imagePullPolicy: Always
env:
- name: WATCH_NAMESPACE
Expand All @@ -30,4 +30,4 @@ spec:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "smi-adapter-istio"
value: "smi-adapter-nsx-sm"
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: smi-adapter-istio
namespace: istio-system
name: smi-adapter-nsx-sm
namespace: nsx-sm-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: smi-adapter-istio
namespace: istio-system
name: smi-adapter-nsx-sm
namespace: nsx-sm-system
rules:
- apiGroups:
- ""
Expand Down Expand Up @@ -41,7 +41,7 @@ rules:
- apiGroups:
- apps
resourceNames:
- smi-adapter-istio
- smi-adapter-nsx-sm
resources:
- deployments/finalizers
verbs:
Expand All @@ -53,7 +53,7 @@ rules:
verbs:
- '*'
- apiGroups:
- networking.istio.io
- networking.nsx-sm.io
resources:
- '*'
verbs:
Expand All @@ -62,12 +62,12 @@ rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: smi-adapter-istio
name: smi-adapter-nsx-sm
subjects:
- kind: ServiceAccount
name: smi-adapter-istio
namespace: istio-system
name: smi-adapter-nsx-sm
namespace: nsx-sm-system
roleRef:
kind: ClusterRole
name: smi-adapter-istio
name: smi-adapter-nsx-sm
apiGroup: rbac.authorization.k8s.io
Loading

0 comments on commit 48507f9

Please sign in to comment.