Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.2] Support for receiving commands to manipulate Rollouts #4040

Merged
merged 22 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3c19e3b
Add argo rollouts server dependency [ci-skip]
douglascamata Jan 20, 2022
6f5c7c8
go mod tidy && go mod vendor && make generate
LukeShu Jan 31, 2022
4e53409
Sketch a basic implementation for updating in-cluster rollouts
douglascamata Jan 20, 2022
a31d36a
Add missing actions to RolloutCommand pb
douglascamata Jan 20, 2022
94ad4e9
Handle rollout commands coming over grpc
douglascamata Jan 20, 2022
8b598c2
Improve error handling on rollout commands
douglascamata Jan 20, 2022
969c75d
Add table tests for RolloutCommand
douglascamata Jan 24, 2022
b1c4d8b
Inject the Rollouts Getter creation through the Agent
douglascamata Jan 24, 2022
e2fec9a
Add some comments types in rollouts.go
douglascamata Jan 24, 2022
bf3854b
Add changelog entry about rollout commands
douglascamata Jan 25, 2022
eb1af93
Properly pass the context to run rollout commands
douglascamata Jan 28, 2022
dea4c48
Fix rollout action parsing
douglascamata Jan 31, 2022
1019b2d
Add permission for the agent to patch rollouts
douglascamata Jan 31, 2022
a64e90d
Report results of running rollout commands to the cloud
douglascamata Jan 31, 2022
3ddb8e4
Authenticate command result report call
Feb 1, 2022
03b43da
Fix error log when cannot report command result
Feb 1, 2022
1602547
Update release notes with info about the command reports
Feb 1, 2022
0e97d5e
Merge branch 'master' of github.com:emissary-ingress/emissary into dc…
Feb 2, 2022
fa28a62
Update generated files
Feb 2, 2022
a5a26f0
Fix typo in the changelog
Feb 3, 2022
9c07c67
Merge branch 'master' of github.com:emissary-ingress/emissary into dc…
Feb 3, 2022
c71a957
Update generated manifests
Feb 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ Please see the [Envoy documentation](https://www.envoyproxy.io/docs/envoy/latest
`AGENT_CONFIG_RESOURCE_NAME` environment variable in order to allow all components (and not only
the Ambassador Agent) to authenticate requests to Ambassador Cloud.

- Feature: The Emissary agent now receives commands to manipulate Rollouts (pause, continue, and
abort are currently supported) via directives and executes them in the cluster. A report is send
to Ambassador's cloud including the command ID, whether it ran successfully, and an error message
in case there was any. ([4040])

- Security: Emissary has been upgraded from Alpine 3.12 to Alpine 3.15, which incorporates numerous
security patches.

[3906]: https://github.com/emissary-ingress/emissary/issues/3906
[3821]: https://github.com/emissary-ingress/emissary/issues/3821
[4040]: https://github.com/emissary-ingress/emissary/pull/4040

## [2.1.2] January 25, 2022
[2.1.2]: https://github.com/emissary-ingress/emissary/compare/v2.1.0...v2.1.2
Expand Down
31 changes: 17 additions & 14 deletions OPENSOURCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ following Free and Open Source software:
Name Version License(s)
---- ------- ----------
the Go language standard library ("std") v1.17.1 3-clause BSD license
cloud.google.com/go v0.54.0 Apache License 2.0
cloud.google.com/go v0.58.0 Apache License 2.0
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 MIT license
github.com/Azure/go-autorest v14.2.0+incompatible Apache License 2.0
github.com/Azure/go-autorest/autorest v0.11.1 Apache License 2.0
Expand All @@ -13,11 +13,12 @@ following Free and Open Source software:
github.com/Azure/go-autorest/logger v0.2.0 Apache License 2.0
github.com/Azure/go-autorest/tracing v0.6.0 Apache License 2.0
github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd MIT license
github.com/Masterminds/semver v1.4.2 MIT license
github.com/Masterminds/sprig v2.17.1+incompatible MIT license
github.com/Masterminds/goutils v1.1.0 Apache License 2.0
github.com/Masterminds/semver v1.5.0 MIT license
github.com/Masterminds/sprig v2.22.0+incompatible MIT license
github.com/PuerkitoBio/purell v1.1.1 3-clause BSD license
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 3-clause BSD license
github.com/aokoli/goutils v1.1.1 Apache License 2.0
github.com/argoproj/argo-rollouts v1.0.7 Apache License 2.0
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da MIT license
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 MIT license
github.com/census-instrumentation/opencensus-proto v0.2.1 Apache License 2.0
Expand All @@ -27,39 +28,39 @@ following Free and Open Source software:
github.com/datawire/go-mkopensource v0.0.0-20220121154707-b0476e7f8255 Apache License 2.0
github.com/davecgh/go-spew v1.1.1 ISC license
github.com/docker/distribution v2.7.1+incompatible Apache License 2.0
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96 Apache License 2.0
github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c Apache License 2.0
github.com/emicklei/go-restful v2.9.5+incompatible MIT license
github.com/envoyproxy/protoc-gen-validate v0.3.0-java.0.20200609174644-bd816e4522c1 Apache License 2.0
github.com/evanphx/json-patch v4.9.0+incompatible 3-clause BSD license
github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d MIT license
github.com/fatih/camelcase v1.0.0 MIT license
github.com/fatih/color v1.9.0 MIT license
github.com/fatih/color v1.10.0 MIT license
github.com/form3tech-oss/jwt-go v3.2.2+incompatible MIT license
github.com/fsnotify/fsnotify v1.4.9 3-clause BSD license
github.com/getkin/kin-openapi v0.66.0 MIT license
github.com/ghodss/yaml v1.0.0 3-clause BSD license, MIT license
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 3-clause BSD license, MIT license
github.com/go-logr/logr v0.4.0 Apache License 2.0
github.com/go-openapi/jsonpointer v0.19.5 Apache License 2.0
github.com/go-openapi/jsonreference v0.19.3 Apache License 2.0
github.com/go-openapi/spec v0.19.3 Apache License 2.0
github.com/go-openapi/swag v0.19.5 Apache License 2.0
github.com/gobuffalo/flect v0.2.2 MIT license
github.com/gogo/protobuf v1.3.1 3-clause BSD license
github.com/gogo/protobuf v1.3.2 3-clause BSD license
github.com/golang/protobuf v1.4.3 3-clause BSD license
github.com/google/btree v1.0.0 Apache License 2.0
github.com/google/go-cmp v0.5.5 3-clause BSD license
github.com/google/gofuzz v1.1.0 Apache License 2.0
github.com/google/uuid v1.1.2 3-clause BSD license
github.com/googleapis/gnostic v0.5.1 Apache License 2.0
github.com/gorilla/websocket v1.4.2 2-clause BSD license
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 MIT license
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 MIT license
github.com/hashicorp/consul/api v1.3.0 Mozilla Public License 2.0
github.com/hashicorp/go-cleanhttp v0.5.1 Mozilla Public License 2.0
github.com/hashicorp/go-immutable-radix v1.0.0 Mozilla Public License 2.0
github.com/hashicorp/go-rootcerts v1.0.0 Mozilla Public License 2.0
github.com/hashicorp/golang-lru v0.5.4 Mozilla Public License 2.0
github.com/hashicorp/serf v0.8.2 Mozilla Public License 2.0
github.com/huandu/xstrings v1.3.1 MIT license
github.com/huandu/xstrings v1.3.2 MIT license
github.com/imdario/mergo v0.3.11 3-clause BSD license
github.com/inconshreveable/mousetrap v1.0.0 Apache License 2.0
github.com/json-iterator/go v1.1.10 MIT license
Expand All @@ -68,9 +69,11 @@ following Free and Open Source software:
github.com/mailru/easyjson v0.7.0 MIT license
github.com/mattn/go-colorable v0.1.8 MIT license
github.com/mattn/go-isatty v0.0.12 MIT license
github.com/mitchellh/copystructure v1.0.0 MIT license
github.com/mitchellh/go-homedir v1.1.0 MIT license
github.com/mitchellh/go-wordwrap v1.0.0 MIT license
github.com/mitchellh/mapstructure v1.1.2 MIT license
github.com/mitchellh/mapstructure v1.3.3 MIT license
github.com/mitchellh/reflectwalk v1.0.1 MIT license
github.com/moby/term v0.0.0-20200312100748-672ec06f55cd Apache License 2.0
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd Apache License 2.0
github.com/modern-go/reflect2 v1.0.1 Apache License 2.0
Expand All @@ -92,15 +95,15 @@ following Free and Open Source software:
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 3-clause BSD license
golang.org/x/text v0.3.4 3-clause BSD license
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e 3-clause BSD license
golang.org/x/tools v0.0.0-20200904185747-39188db58858 3-clause BSD license
golang.org/x/tools v0.1.0 3-clause BSD license
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 3-clause BSD license
google.golang.org/appengine v1.6.6 Apache License 2.0
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a Apache License 2.0
google.golang.org/grpc v1.34.0 Apache License 2.0
google.golang.org/protobuf v1.25.0 3-clause BSD license
gopkg.in/inf.v0 v0.9.1 3-clause BSD license
gopkg.in/yaml.v2 v2.3.0 Apache License 2.0, MIT license
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 Apache License 2.0, MIT license
gopkg.in/yaml.v2 v2.4.0 Apache License 2.0, MIT license
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b Apache License 2.0, MIT license
k8s.io/api v0.20.4 Apache License 2.0
k8s.io/apiextensions-apiserver v0.20.4 Apache License 2.0
k8s.io/apimachinery v0.20.4 Apache License 2.0
Expand Down
24 changes: 24 additions & 0 deletions api/agent/director.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ service Director {
// Retrieve Directives from the CEPC
rpc Retrieve(Identity) returns (stream Directive) {}

// Reports the result of a command execution to the cloud
rpc ReportCommandResult(CommandResult) returns (CommandResultResponse) {}

rpc RetrieveSnapshot(Identity) returns (stream RawSnapshotChunk) {}
}

Expand Down Expand Up @@ -104,4 +107,25 @@ message Directive {
message Command {
// Log this message if present
string message = 1;
RolloutCommand rolloutCommand = 2;
}

message RolloutCommand {
string name = 1;
string namespace = 2;
enum Action {
PAUSE = 0;
RESUME = 1;
ABORT = 2;
}
Action action = 3;
string command_id = 4;
}

message CommandResult {
string command_id = 1;
bool success = 2;
string message = 3;
}

message CommandResultResponse {}
2 changes: 1 addition & 1 deletion charts/emissary-ingress/templates/ambassador-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ metadata:
rules:
- apiGroups: ["argoproj.io"]
resources: [ "rollouts" ]
verbs: [ "get", "list", "watch" ]
verbs: [ "get", "list", "watch", "patch" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DefaultSnapshotURLFmt = "http://ambassador-admin:%d/snapshot-external"

func run(cmd *cobra.Command, args []string) error {
ctx := cmd.Context()
ambAgent := agent.NewAgent(nil)
ambAgent := agent.NewAgent(nil, agent.NewArgoRolloutsGetter)

// all log things need to happen here because we still allow the agent to run in amb-sidecar
// and amb-sidecar should control all the logging if it's kicking off the agent.
Expand Down
11 changes: 11 additions & 0 deletions docs/releaseNotes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ items:
components (and not only the Ambassador Agent) to authenticate requests to
Ambassador Cloud.

- title: Support received commands to pause, continue and abort a Rollout via Agent directives
type: feature
body: >-
The Emissary agent now receives commands to manipulate Rollouts (pause, continue, and abort are
currently supported) via directives and executes them in the cluster.
A report is send to Ambassador's cloud including the command ID, whether it ran successfully,
and an error message in case there was any.
github:
- title: 4040
link: https://github.com/emissary-ingress/emissary/pull/4040

- title: Update to Alpine 3.15
type: security
body: >-
Expand Down
Loading