argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.69k stars 844 forks source link

Terraform support #1147

Open DanTulovsky opened 3 years ago

DanTulovsky commented 3 years ago

Summary

Would it be possible to have a terraform provider specific to Rollouts?

Use Cases

I use terraform for all of my configs. Right now I am using the 'kubectl' provider to push this out, but would rather have proper terraform support instead.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

jessesuen commented 3 years ago

Hi @DanTulovsky. I'm not sure how this relates to Argo Rollouts, which is a controller that manages ReplicaSets to provide advanced rollout strategies such as blue-green/canary and canary analysis.

Do you mean to ask this in Argo CD?

DanTulovsky commented 3 years ago

Hi @jessesuen. I do mean Argo Rollouts. For examples, for people who use terraform today, given the following manifest:

apiVersion: argoproj.io/v1alpha1               # Create a rollout resource
kind: Rollout
metadata:
  name: quote-server-rollout
  namespace: web
spec:
  replicas: 3
  workloadRef:                                 # Reference an existing Deployment using workloadRef field
    apiVersion: apps/v1
    kind: Deployment
    name: quote-server-http
  strategy:
    canary:
      steps:
        - setWeight: 33
        - pause: {duration: 60s}

you could use the helm provider (but making this part of a custom helm chart), or use the kubectl provider. But it would be better if Argo Rollouts had a custom provider that natively set argoproj.io/v1alpha1 types of manifests.

kostis-codefresh commented 3 years ago

@DanTulovsky while I understand what you are asking wouldn't it make more sense to manage argo rollout apps with Argo and its declarative support -> https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/ ?

In my mind terraform is for instrastructure (i.e. the k8s cluster where argocd and argo-rollouts run on) and argocd should handle all application level stuff. Using terraform for everything may be an overkill

See also Anti-pattern 4 – Mixing application deployment with infrastructure deployment here https://codefresh.io/kubernetes-tutorial/kubernetes-antipatterns-1/

DanTulovsky commented 3 years ago

@kostis-codefresh I suppose if you are already using Argo, then yes, certainly it would make sense.

One safe way to use terraform without mixing infra and deployment is to have to separate instances of terraform, one for infra and one for deployment (which is my case).

You might defer this until https://registry.terraform.io/providers/hashicorp/kubernetes-alpha/latest is released and then decide it's good enough though. :)

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity.