Skip to content

Commit

Permalink
Add locality lb settings support on destination rules (#41)
Browse files Browse the repository at this point in the history
* Bootstrapping admiral

* Add circle ci config

* Fix the working directory for builds

* Bootstrapping admiral

Signed-off-by: aattuluri <anil_attuluri@intuit.com>

* Add circle ci config

Signed-off-by: aattuluri <anil_attuluri@intuit.com>

* Fix the working directory for builds

Signed-off-by: aattuluri <anil_attuluri@intuit.com>

* Add build status badge.

Signed-off-by: aattuluri <anil_attuluri@intuit.com>

* Revert "Add build status badge."

This reverts commit a9fa409.

* Working version after major refactor.

* Fix test files.

* Use global traffic policy to update destination rule.

* Minor fixes.

* Update image for admiral

* Add outlier detection for locality load balancing to work

* Undo tag change

* Sample files for demo

* Remove/comment some tests

* Add the needed method

* Commenting out few more tests.

* Remove unwanted files.

* Adding back missing tests.

* Create an alias for logrus.

* Fixing tests.
  • Loading branch information
aattuluri committed Feb 26, 2020
1 parent 12ae5f5 commit 6cf54e6
Show file tree
Hide file tree
Showing 42 changed files with 1,647 additions and 4,815 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PROTOC_ZIP=protoc-$(PROTOC_VER)-osx-x86_64.zip


# ROOT_PACKAGE :: the package (relative to $GOPATH/src) that is the target for code generation
ROOT_PACKAGE=github.com/admiral/admiral
ROOT_PACKAGE=github.com/istio-ecosystem/admiral/admiral
# CUSTOM_RESOURCE_NAME :: the name of the custom resource that we're generating client code for
CUSTOM_RESOURCE_NAME=admiral
# CUSTOM_RESOURCE_VERSION :: the version of the resource
Expand Down Expand Up @@ -66,12 +66,11 @@ api-gen:
go install github.com/golang/protobuf/protoc-gen-go
$(GOCMD) generate ./...
go install k8s.io/code-generator/cmd/deepcopy-gen
$(GOBIN)/deepcopy-gen --input-dirs ./admiral/pkg/apis/admiral/model --bounding-dirs ./admiral/pkg/apis/admiral/model -O zz_generated.deepcopy -o $(GOPATH)/src

crd-gen:
#go get -d -u -fix k8s.io/code-generator
#go get -d -u -fix k8s.io/apimachinery
#go get -d -u -fix k8s.io/gengo
go get -d -u -fix k8s.io/code-generator
go get -d -u -fix k8s.io/apimachinery
go get -d -u -fix k8s.io/gengo
$(GOPATH)/src/k8s.io/code-generator/generate-groups.sh all "$(ROOT_PACKAGE)/pkg/client" "$(ROOT_PACKAGE)/pkg/apis" "$(CUSTOM_RESOURCE_NAME):$(CUSTOM_RESOURCE_VERSION)"

# Cross compilation
Expand Down
7 changes: 2 additions & 5 deletions admiral/cmd/admiral/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"flag"
"fmt"
"github.com/istio-ecosystem/admiral/admiral/pkg/clusters"
"github.com/prometheus/common/log"
"github.com/istio-ecosystem/admiral/admiral/pkg/controller/common"
"istio.io/istio/pkg/log"
"os"
"os/signal"
"syscall"
Expand All @@ -16,7 +16,6 @@ import (
)

var (
loggingOptions = log.DefaultOptions()
ctx, cancel = context.WithCancel(context.Background())
)

Expand All @@ -36,8 +35,7 @@ func GetRootCmd(args []string) *cobra.Command {
if len(args) > 0 {
return fmt.Errorf("%q is an invalid argument", args[0])
}
err := log.Configure(loggingOptions)
return err
return nil
},
Run: func(cmd *cobra.Command, args []string) {
log.Info("Starting Admiral")
Expand Down Expand Up @@ -86,7 +84,6 @@ func GetRootCmd(args []string) *cobra.Command {
"The hostname suffix to customize the cname generated by admiral. Default suffix value will be \"global\"")
rootCmd.PersistentFlags().StringVar(&params.LabelSet.WorkloadIdentityLabel, "workload_identity_label", "identity",
"The workload identity label key, on deployment which holds identity value used to generate cname by admiral. Default label key will be \"identity\"")
loggingOptions.AttachCobraFlags(rootCmd)

return rootCmd
}
Expand Down
21 changes: 12 additions & 9 deletions admiral/pkg/apis/admiral/model/dependency.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admiral/pkg/apis/admiral/model/dependency.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package admiral.global.v1alpha;
option go_package = "model";

// ```
// apiVersion: admiral.global.traffic/v1alpha
// apiVersion: admiral.io/v1alpha1
// kind: Dependency
// metadata:
// name: my-dependency
Expand Down
53 changes: 30 additions & 23 deletions admiral/pkg/apis/admiral/model/globalrouting.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admiral/pkg/apis/admiral/model/globalrouting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option go_package = "model";


// ```
// apiVersion: navarch.global.traffic/v1alpha
// apiVersion: admiral.io/v1alpha1
// kind: GlobalTrafficPolicy
// metadata:
// name: my-routing
Expand Down
4 changes: 2 additions & 2 deletions admiral/pkg/apis/admiral/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6cf54e6

Please sign in to comment.