Skip to content

Commit

Permalink
add rollout support to weaver kube
Browse files Browse the repository at this point in the history
In the current implementation, with weaver kube you have to pause the
world when you want to rollout a new version of the app.

In this PR we enable rolling upgrades, a deployment strategy that is
supported by Kubernetes.

In the near future, we might want to provide integration with argo
rollouts (or something else) to enable blue/green and canary
deployments.

Main changes:
* for each component that exports a listener, we create a deployment
  with an unique name; this doesn't change across rollouts, so a rolling
  update will update the existing pods one by one
* one a pod is updated to the new version, whenever it gets a request,
  it will only talk with other services within the same version
* for each public listener, the name should be unique and not deployment
  specific
* also, for jaeger and prometheus, we want unique instances that persist
  across multiple versions (and captures the metrics/traces for all the
  deployer versins of an app)
* Prometheus used to scrape an address that was passed to the pods to
  export metrics on; this doesn't really work across versions; so we
  change the prometheus config to scrape all pods based on a label (the
  label is based on the app name, so it scrapes all pods across all
  versions of the app)

Drawbacks of this approach (things that might not work):
* what if a listener moves between components
* what if a listener is dropped

For now, in all our examples we have a simple listener exported by main.
So we can restrict to be only one listener exported by main, and this
might cover most of the scenarios. However, how to handle listeners
across versions is something to think about.
  • Loading branch information
rgrandl committed Jul 20, 2023
1 parent fbccd26 commit 0e9f46f
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 175 deletions.
22 changes: 10 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
module github.com/ServiceWeaver/weaver-kube

go 1.20
go 1.21

require (
github.com/ServiceWeaver/weaver v0.17.0
github.com/google/uuid v1.3.0
go.opentelemetry.io/otel/exporters/jaeger v1.16.0
go.opentelemetry.io/otel/sdk v1.16.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
google.golang.org/protobuf v1.29.1
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
google.golang.org/protobuf v1.31.0
k8s.io/api v0.26.2
k8s.io/apimachinery v0.27.2
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/BurntSushi/toml v1.2.0 // indirect
github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/cel-go v0.12.5 // indirect
github.com/google/cel-go v0.17.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
go.opentelemetry.io/otel v1.16.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.7.0 // indirect
go.opentelemetry.io/otel/metric v1.16.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
golang.org/x/mod v0.9.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.10.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit 0e9f46f

Please sign in to comment.