Repository navigation
Experimental Rudder implementation - #2079
Conversation
|
@technosophos @adamreese please share your feedback. If the implementation is correct, should this code be merged, or should the part in which Rudder is actually incorporated into helm pod also be part of this PR? Checking out CI issues now. |
| // regular manifests | ||
| b := bytes.NewBufferString(r.Manifest) | ||
| if err := s.env.KubeClient.Create(r.Namespace, b, req.Timeout, req.Wait); err != nil { | ||
| if err := s.ReleaseModule.Create(r, req, s.env); err != nil { |
There was a problem hiding this comment.
This makes me happy. It is a very clean integration.
| p.StringVarP(&grpcAddr, "listen", "l", ":44134", "address:port to listen on") | ||
| p.StringVar(&store, "storage", storageConfigMap, "storage driver to use. One of 'configmap' or 'memory'") | ||
| p.BoolVar(&enableTracing, "trace", false, "enable rpc tracing") | ||
| p.BoolVar(&remoteReleaseModules, "experimental-release", false, "enable experimental release modules") |
There was a problem hiding this comment.
Glad you implemented it this way.
|
|
||
| "k8s.io/helm/pkg/kube" | ||
| "k8s.io/helm/pkg/proto/hapi/release" | ||
| "k8s.io/helm/pkg/rudder" |
There was a problem hiding this comment.
This appears to have not been checked in.
There was a problem hiding this comment.
Indeed. Sorry about that! I thought there was an issue with CI building against older version of Helm :D.
|
@nebril Looking good! I'm pleased to see that the interface is looking really clean. I was worried that there might be a major release server refactor lurking. But it looks good. Which version of |
|
@technosophos I am using libprotoc 3.2.0 . I don't have a lot of experience with protobuffs, so I am not sure what caused all of these binary changes there. |
|
Okay, I just read through all of the code, and it is exactly on track. It feels like a very clean separation of concerns. I think you can just keep on going with the upgrade/delete/rollback logic. I'll add @adamreese and I as reviewers on the issue. I'm also going to cc @fibonacci1729, who's the resident expert on gRPC. |
| if err != nil { | ||
| grpclog.Printf("error when creating release: %s", err) | ||
| } | ||
| return &release.InstallReleaseResponse{}, err |
There was a problem hiding this comment.
An oversight on my part.
| func (r *ReleaseModuleServiceServer) InstallRelease(ctx context.Context, in *release.InstallReleaseRequest) (*release.InstallReleaseResponse, error) { | ||
| grpclog.Print("install") | ||
| b := bytes.NewBufferString(in.Release.Manifest) | ||
| err := kubeClient.Create(in.Release.Namespace, b, 500, false) |
There was a problem hiding this comment.
are you sure that we shouldn't wait here? because 500 seconds of timeout without waiting is meaningless
There was a problem hiding this comment.
This timeout should be derived from the request, I did not include passing parameteres from InstallReleaseRequest sent to tiller to rudder yet.
|
|
||
| grpclog.Print("Server starting") | ||
| grpcServer.Serve(lis) | ||
| grpclog.Print("Server started") |
There was a problem hiding this comment.
i think this is unreachable
|
Per the new developer workflow guidelines, I have removed the |
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package hapi.services.rudder; |
There was a problem hiding this comment.
services there looks like reminder from some refactors, right?
| limitations under the License. | ||
| */ | ||
|
|
||
| package main // import "k8s.io/helm/cmd/rudder" |
There was a problem hiding this comment.
With other packages such comment have a sense, but with main?
| return &rudderAPI.InstallReleaseResponse{}, err | ||
| } | ||
|
|
||
| // DeleteRelease is not implemented |
There was a problem hiding this comment.
Shouldn't that be implemented in this PR?
| return nil, nil | ||
| } | ||
|
|
||
| // RollbackRelease is not implemented |
| // ReleaseModuleServiceServer provides implementation for rudderAPI.ReleaseModuleServiceServer | ||
| type ReleaseModuleServiceServer struct{} | ||
|
|
||
| // Version is not yet implemented |
There was a problem hiding this comment.
Still need to fix this comment.
| return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait) | ||
| } | ||
|
|
||
| func (m *LocalReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) { |
| return env.KubeClient.Create(r.Namespace, b, req.Timeout, req.Wait) | ||
| } | ||
|
|
||
| func (m *LocalReleaseModule) Update(current, target *release.Release, req *services.UpdateReleaseRequest, env *environment.Environment) error { |
| return env.KubeClient.Update(target.Namespace, c, t, req.Recreate, req.Timeout, req.Wait) | ||
| } | ||
|
|
||
| func (m *LocalReleaseModule) Rollback(current, target *release.Release, req *services.RollbackReleaseRequest, env *environment.Environment) error { |
| return err | ||
| } | ||
|
|
||
| func (m *RemoteReleaseModule) Status(r *release.Release, req *services.GetReleaseStatusRequest, env *environment.Environment) (string, error) { |
technosophos
left a comment
There was a problem hiding this comment.
Reviewed the most recent batch of changes, and I think we are good to merge. I will double-check with @adamreese today.
| type ReleaseModuleServiceServer struct{} | ||
|
|
||
| // Version returns Rudder version based on helm version | ||
| func (r *ReleaseModuleServiceServer) Version(ctx context.Context, in *rudderAPI.VersionReleaseRequest) (*rudderAPI.VersionReleaseResponse, error) { |
There was a problem hiding this comment.
Does this get called anywhere?
There was a problem hiding this comment.
It is required by the proto, but we haven't added a call for it anywhere. The intention was to make this available for (a) logging, and (b) the future toggle switch that allows choosing which rudder to run for a given release.
There was a problem hiding this comment.
Matts comment is correct, I have nothing further to add.
| docker-binary: GOFLAGS += -a -installsuffix cgo | ||
| docker-binary: | ||
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/tiller $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/tiller | ||
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build -o $(BINDIR)/rudder $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' k8s.io/helm/cmd/rudder |
There was a problem hiding this comment.
Can you move this to a different target so CI won't need to build it.
|
|
||
| ENV HOME /tmp | ||
|
|
||
| COPY . / |
There was a problem hiding this comment.
This should only copy the tiller binary to cut the image size in half.
|
|
||
| ENV HOME /tmp | ||
|
|
||
| COPY . / |
There was a problem hiding this comment.
This should only copy the rudder binary to cut the image size in half. feels deja vu
|
Bumping to 2.5 to clear off for today's release. |
This change introduces the concept of Rudders - pluggable modules that Tiller communicates with via grpc, which allow to decouple orchestration logic from Tiller into separate service. This commit consists of simple Rudder implementation which does exactly the same thing as built in Tiller orchestrator - it creates all k8s objects from provided manifest without orchestrating them. --experimental-release flag is introduced to enable this behaviour. This change allows to use the service and tiller outside of the cluster. Following commits will add Rudder to helm deployment.
Added dockerfiles for rudder service and tiller run with --experimental-release flag
Both local and remote Release module implement release status check.
Extracted delete specific code from ReleaseServer to external function which is called from both Local and Remote ReleaseModules. Made getVersionSet function from tiller package exported.
Added make target Lowered docker image sizes Updated ruder.pb.go
|
@adamreese fixed the stuff you mentioned, please review :) |
|
Re-reviewed and it looks good still. |
This change introduces the concept of Rudders - pluggable modules that
Tiller communicates with via grpc, which allow to decouple orchestration
logic from Tiller into separate service.
This commit consists of simple Rudder implementation which does exactly
the same thing as built in Tiller orchestrator - it creates all k8s
objects from provided manifest without orchestrating them.
--experimental-release flag is introduced to enable this behaviour.
This change allows to use the service and tiller outside of the cluster.
Following commits will add Rudder to helm deployment.
It is the first PR in effort to implement #1924