Skip to content

Commit

Permalink
Merge branch 'argoproj:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
n888 authored Jun 12, 2023
2 parents 913b203 + 3308401 commit 0950873
Show file tree
Hide file tree
Showing 13 changed files with 276 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-reuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ jobs:

- name: Build and push container image
id: image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 #v4.0.0
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf #v4.1.0
with:
context: .
platforms: ${{ inputs.platforms }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push (controller-image)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf # v4.1.0
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -94,7 +94,7 @@ jobs:
sbom: false

- name: Build and push (plugin-image)
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 # v4.0.0
uses: docker/build-push-action@44ea916f6c540f9302d50c2b1e5a8dc071f15cdf # v4.1.0
with:
context: .
target: kubectl-argo-rollouts
Expand Down
5 changes: 2 additions & 3 deletions docs/analysis/datadog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ spec:
apiVersion: v2
interval: 5m
query: |
sum:requests.error.count{service:{{args.service-name}}} /
sum:requests.request.count{service:{{args.service-name}}}
sum:requests.error.rate{service:{{args.service-name}}}
```
The field `apiVersion` refers to the API version of Datadog (v1 or v2). Default value is `v1` if this is omitted.

!!! note
Datadog is moving away from the legacy v1 API. Rate limits imposed by Datadog are therefore stricter when using v1. It is recommended to switch to v2 soon. If you switch to v2, you will not need to change any other field aside from `apiVersion`.
Datadog is moving away from the legacy v1 API. Rate limits imposed by Datadog are therefore stricter when using v1. It is recommended to switch to v2 soon. If you switch to v2, you will not be able to use formulas (operations between individual queries).

Datadog api and app tokens can be configured in a kubernetes secret in argo-rollouts namespace.

Expand Down
12 changes: 12 additions & 0 deletions docs/features/specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ spec:
requiredDuringSchedulingIgnoredDuringExecution: {}
preferredDuringSchedulingIgnoredDuringExecution:
weight: 1 # Between 1 - 100

# activeMetadata will be merged and updated in-place into the ReplicaSet's spec.template.metadata
# of the active pods. +optional
activeMetadata:
labels:
role: active

# Metadata which will be attached to the preview pods only during their preview phase.
# +optional
previewMetadata:
labels:
role: preview

# Canary update strategy
canary:
Expand Down
3 changes: 2 additions & 1 deletion docs/features/traffic-management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ Service Meshes fill this missing functionality in Kubernetes. They introduce new

## How does Argo Rollouts enable traffic management?

Argo Rollouts enables traffic management by manipulating the Service Mesh resources to match the intent of the Rollout. Argo Rollouts currently supports the following service meshes:
Argo Rollouts enables traffic management by manipulating the Service Mesh resources to match the intent of the Rollout. Argo Rollouts currently supports the following traffic providers:

- [AWS ALB Ingress Controller](alb.md)
- [Ambassador Edge Stack](ambassador.md)
- [Apache APISIX](apisix.md)
- [Google Cloud](google-cloud.md)
- [Gateway API](plugins.md)
- [Istio](istio.md)
- [Kong Ingress](kong.md)
- [Nginx Ingress Controller](nginx.md)
- [Service Mesh Interface (SMI)](smi.md)
- [Traefik Proxy](traefik.md)
Expand Down
22 changes: 22 additions & 0 deletions docs/features/traffic-management/kong.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Kong Ingress

With the introduction of the Kubernetes Gateway API it is now possible to use Argo Rollouts with all compliant implementations that support it. The integration is available with the [Argo Rollouts Gateway API plugin](https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/) currently hosted in Argo Labs.

Useful resources:

* [The Gateway API specification](https://gateway-api.sigs.k8s.io/)
* [Support of the Gateway API in Kong](https://docs.konghq.com/kubernetes-ingress-controller/latest/concepts/gateway-api/)
* [Argo Rollouts Plugin capabilities](../plugins/)
* [Plugin for the Gateway API](https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi)

The process involves the following steps:

1. Installing the Gateway API CRDs in your cluster
1. Installing Kong and enabling the Gateway API support feature
1. Creating a GatewayClass and Gateway resources
1. Installing Argo Rollouts + gateway API plugin in the cluster
1. Defining a Rollout that takes advantage of the plugin

For a full application that includes all manifests see the [plugin example](https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-gatewayapi/tree/main/examples/kong).


9 changes: 6 additions & 3 deletions docs/getting-started/appmesh/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ respectively. In addition, there is a virtual-service named `rollout-demo-vsvc`
virtual-router CR named `rollout-demo-vrouter`. This virtual-router need have at least one route with action to forward
traffic to the canary and stable virtual-nodes. Initially weight for canary is set to 0% while for stable it is 100%.
During rollout, controller will modify the weights on route(s) based on the configuraiton defined in
`steps[N].setWeight`.
`steps[N].setWeight`.

The canary and stable services are configured to be headless. This is necessary to allow App Mesh to properly handle
conneciton pooling as pods are reassigned from canary to stable.

To summarize, run the following commands to deploy a service:

Expand All @@ -69,8 +72,8 @@ To summarize, run the following commands to deploy a service:
* A rollout

```shell
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/appmesh/canary-service.yaml
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/docs/getting-started/appmesh/canary-rollout.yaml
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/examples/appmesh/canary-service.yaml
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-rollouts/master/examples/appmesh/canary-rollout.yaml
```
## 2. Verify service

Expand Down
12 changes: 8 additions & 4 deletions examples/appmesh/canary-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ metadata:
name: my-svc-canary
namespace: argo-examples
spec:
clusterIP: None
ports:
- port: 80
targetPort: http
Expand All @@ -55,6 +56,7 @@ metadata:
name: my-svc-stable
namespace: argo-examples
spec:
clusterIP: None
ports:
- port: 80
targetPort: http
Expand Down Expand Up @@ -114,11 +116,12 @@ spec:
rollouts-pod-template-hash: canary-tbd
listeners:
- portMapping:
port: 80
port: 8080
protocol: http
serviceDiscovery:
dns:
hostname: my-svc-canary.argo-examples.svc.cluster.local
responseType: ENDPOINTS

---
apiVersion: appmesh.k8s.aws/v1beta2
Expand All @@ -133,11 +136,12 @@ spec:
rollouts-pod-template-hash: stable-tbd
listeners:
- portMapping:
port: 80
port: 8080
protocol: http
serviceDiscovery:
dns:
hostname: my-svc-stable.argo-examples.svc.cluster.local
responseType: ENDPOINTS

---
apiVersion: appmesh.k8s.aws/v1beta2
Expand Down Expand Up @@ -176,8 +180,8 @@ spec:
containers:
- name: wrk
image: argoproj/load-tester:latest
command:
command:
- /bin/sh
- -c
- -c
- -x
- "while true; do wrk -t10 -c40 -d2m -s report.lua http://my-svc.argo-examples/color; jq -e '.errors_ratio <= 0.35 and .latency_avg_ms < 100' report.json; done"
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.3
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-plugin v1.4.9
github.com/hashicorp/go-plugin v1.4.10
github.com/influxdata/influxdb-client-go/v2 v2.12.3
github.com/juju/ansiterm v1.0.0
github.com/machinebox/graphql v0.2.2
Expand All @@ -29,11 +29,11 @@ require (
github.com/prometheus/common v0.42.0
github.com/prometheus/common/sigv4 v0.1.0
github.com/servicemeshinterface/smi-sdk-go v0.5.0
github.com/sirupsen/logrus v1.9.2
github.com/sirupsen/logrus v1.9.3
github.com/soheilhy/cmux v0.1.5
github.com/spaceapegames/go-wavefront v1.8.1
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/tj/assert v0.0.3
github.com/valyala/fasttemplate v1.2.2
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj
github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU=
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU=
github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s=
github.com/hashicorp/go-plugin v1.4.10 h1:xUbmA4jC6Dq163/fWcp8P3JuHilrHHMLNRxzGQJ9hNk=
github.com/hashicorp/go-plugin v1.4.10/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0=
github.com/hashicorp/go-retryablehttp v0.5.1/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ=
github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
Expand Down Expand Up @@ -632,8 +632,8 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.2 h1:oxx1eChJGI6Uks2ZC4W1zpLlVgqB8ner4EuQwV4Ik1Y=
github.com/sirupsen/logrus v1.9.2/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/slack-go/slack v0.12.1 h1:X97b9g2hnITDtNsNe5GkGx6O2/Sz/uC20ejRZN6QxOw=
github.com/slack-go/slack v0.12.1/go.mod h1:hlGi5oXA+Gt+yWTPP0plCdRKmjsDxecdHxYQdlMQKOw=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
Expand Down Expand Up @@ -672,8 +672,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y=
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ nav:
- AWS ALB: features/traffic-management/alb.md
- Google Cloud: features/traffic-management/google-cloud.md
- Istio: features/traffic-management/istio.md
- Kong: features/traffic-management/kong.md
- NGINX: features/traffic-management/nginx.md
- Plugins: features/traffic-management/plugins.md
- SMI: features/traffic-management/smi.md
Expand Down
20 changes: 16 additions & 4 deletions rollout/trafficrouting/nginx/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ func (r *Reconciler) buildCanaryIngress(stableIngress *networkingv1.Ingress, nam
canaryServiceName := r.cfg.Rollout.Spec.Strategy.Canary.CanaryService
annotationPrefix := defaults.GetCanaryIngressAnnotationPrefixOrDefault(r.cfg.Rollout)

// Set up canary ingress resource, we do *not* have to duplicate `spec.tls` in a canary, only
// `spec.rules`
desiredCanaryIngress := &networkingv1.Ingress{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -78,6 +76,14 @@ func (r *Reconciler) buildCanaryIngress(stableIngress *networkingv1.Ingress, nam
},
}

// Preserve TLS from stable ingress
if stableIngress.Spec.TLS != nil {
desiredCanaryIngress.Spec.TLS = make([]networkingv1.IngressTLS, len(stableIngress.Spec.TLS))
for it := 0; it < len(stableIngress.Spec.TLS); it++ {
stableIngress.Spec.TLS[it].DeepCopyInto(&desiredCanaryIngress.Spec.TLS[it])
}
}

// Preserve ingressClassName from stable ingress
if stableIngress.Spec.IngressClassName != nil {
desiredCanaryIngress.Spec.IngressClassName = stableIngress.Spec.IngressClassName
Expand Down Expand Up @@ -136,8 +142,6 @@ func (r *Reconciler) buildLegacyCanaryIngress(stableIngress *extensionsv1beta1.I
canaryServiceName := r.cfg.Rollout.Spec.Strategy.Canary.CanaryService
annotationPrefix := defaults.GetCanaryIngressAnnotationPrefixOrDefault(r.cfg.Rollout)

// Set up canary ingress resource, we do *not* have to duplicate `spec.tls` in a canary, only
// `spec.rules`
desiredCanaryIngress := &extensionsv1beta1.Ingress{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Expand All @@ -148,6 +152,14 @@ func (r *Reconciler) buildLegacyCanaryIngress(stableIngress *extensionsv1beta1.I
},
}

// Preserve TLS from stable ingress
if stableIngress.Spec.TLS != nil {
desiredCanaryIngress.Spec.TLS = make([]extensionsv1beta1.IngressTLS, len(stableIngress.Spec.TLS))
for it := 0; it < len(stableIngress.Spec.TLS); it++ {
stableIngress.Spec.TLS[it].DeepCopyInto(&desiredCanaryIngress.Spec.TLS[it])
}
}

// Preserve ingressClassName from stable ingress
if stableIngress.Spec.IngressClassName != nil {
desiredCanaryIngress.Spec.IngressClassName = stableIngress.Spec.IngressClassName
Expand Down
Loading

0 comments on commit 0950873

Please sign in to comment.