Skip to content

Commit

Permalink
Merge branch 'master' of github.com:argoproj/argo-rollouts into step-…
Browse files Browse the repository at this point in the history
…plugin
  • Loading branch information
zachaller committed Aug 5, 2024
2 parents ef48f19 + 708db68 commit 941e8e0
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-reuse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
cosign-release: 'v2.2.0'

- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Setup tags for container image as a CSV type
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1

- name: Generate release artifacts
run: |
Expand Down
2 changes: 2 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# FAQ

Be sure to read the [Best practices page](../best-practices) as well.

## General

### Does Argo Rollouts depend on Argo CD or any other Argo project?
Expand Down
20 changes: 19 additions & 1 deletion docs/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,23 @@ You should *NOT* use Argo Rollouts for preview/ephemeral environments. For that

The recommended way to use Argo Rollouts is for brief deployments that take 15-20 minutes or maximum 1-2 hours. If you want to run new versions for days or weeks before deciding to promote, then Argo Rollouts is probably not the best solution for you.

Also, if you want to run a wave of multiple versions at the same time (i.e. have 1.1 and 1.2 and 1.3 running at the same time), know that Argo Rollouts was not designed for this scenario.
Keeping parallel releases for long times, complicates the deployment process a lot and opens several questions where different people have different views on how Argo Rollouts should work.

For example let's say that you are testing for a week version 1.3 as stable and 1.4 as preview.
Then somebody deploys 1.5

1. Some people believe that the new state should be 1.3 stable and 1.5 as preview
1. Some people believe that the new state should be 1.4 stable and 1.5 as preview

Currently Argo Rollouts follows the first approach, under the assumption that something was really wrong with 1.4 and 1.5 is the hotfix.

And then let's say that 1.5 has an issue. Some people believe that Argo rollouts should "rollback" to 1.3 while other people think it should rollback to 1.4

Currently Argo Rollouts assumes that the version to rollback is always 1.3 regardless of how many "hotfixes" have been previewed in-between.

All these problems are not present if you make the assumption that each release stays active only for a minimal time and you always create one new version when the previous one has finished.

Also, if you want to run a wave of multiple versions at the same time (i.e. have 1.1 and 1.2 and 1.3 running at the same time), know that Argo Rollouts was not designed for this scenario. Argo Rollouts always works with the assumption that there is one stable/previous version and one preview/next version.

A version that has just been promoted is assumed to be ready for production and has already passed all your tests (either manual or automated).

Expand All @@ -41,6 +57,8 @@ While Argo Rollouts supports manual promotions and other manual pauses, these ar

Ideally you should have proper metrics that tell you in 5-15 minutes if a deployment is successful or not. If you don't have those metrics, then you will miss a lot of value from Argo Rollouts.

If you are doing a deployment right now and then have an actual human looking at logs/metrics/traces for the next 2 hours, adopting Argo Rollouts is not going to help you a lot with automated deployments.

Get your [metrics](../features/analysis) in place first and test them with dry-runs before applying them to production deployments.


Expand Down
12 changes: 11 additions & 1 deletion pkg/kubectl-argo-rollouts/info/pod_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
},
}
restarts := 0
rs := make(map[string]bool, len(pod.Spec.InitContainers))
for _, c := range pod.Spec.InitContainers {
p := c.RestartPolicy
rs[c.Name] = p != nil && *p == corev1.ContainerRestartPolicyAlways
}

totalContainers := len(pod.Spec.Containers)
readyContainers := 0

Expand All @@ -69,7 +75,7 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
continue
case container.State.Terminated != nil:
// initialization is failed
if len(container.State.Terminated.Reason) == 0 {
if container.State.Terminated.Reason == "" {
if container.State.Terminated.Signal != 0 {
reason = fmt.Sprintf("Init:Signal:%d", container.State.Terminated.Signal)
} else {
Expand All @@ -79,6 +85,10 @@ func newPodInfo(pod *corev1.Pod) rollout.PodInfo {
reason = "Init:" + container.State.Terminated.Reason
}
initializing = true
case rs[container.Name] && container.Started != nil && *container.Started:
if container.Ready {
continue
}
case container.State.Waiting != nil && len(container.State.Waiting.Reason) > 0 && container.State.Waiting.Reason != "PodInitializing":
reason = "Init:" + container.State.Waiting.Reason
initializing = true
Expand Down
16 changes: 9 additions & 7 deletions rollout/trafficrouting/traefik/traefik.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ const Type = "Traefik"
const traefikServices = "traefikservices"
const TraefikServiceUpdateError = "TraefikServiceUpdateError"

var (
apiGroupToResource = map[string]string{
defaults.GetTraefikAPIGroup(): traefikServices,
}
)

type ReconcilerConfig struct {
Rollout *v1alpha1.Rollout
Client ClientInterface
Expand All @@ -41,6 +35,13 @@ type Reconciler struct {
Recorder record.EventRecorder
}

func apiGroupToResource(group string) string {
apiGroupToResource := map[string]string{
defaults.GetTraefikAPIGroup(): traefikServices,
}
return apiGroupToResource[group]
}

func (r *Reconciler) sendWarningEvent(id, msg string) {
r.sendEvent(corev1.EventTypeWarning, id, msg)
}
Expand Down Expand Up @@ -71,7 +72,8 @@ func GetMappingGVR() schema.GroupVersionResource {
group := defaults.GetTraefikAPIGroup()
parts := strings.Split(defaults.GetTraefikVersion(), "/")
version := parts[len(parts)-1]
resourceName := apiGroupToResource[group]
resourceName := apiGroupToResource(group)

return schema.GroupVersionResource{
Group: group,
Version: version,
Expand Down

0 comments on commit 941e8e0

Please sign in to comment.