weaveworks / pipeline-controller

This repository contains the Pipeline CRD and associated controller for Weave GitOps Enterprise.
1 stars 4 forks source link

Distribute Pipeline Templates in WGE #46

Closed sympatheticmoose closed 1 year ago

sympatheticmoose commented 2 years ago

We need to ensure that a user can ensure that our Pipeline templates get installed so that the Create Pipeline experience does not lead operators to an empty template list.

Through the WGE/P-C Helm Chart the user should be able to toggle the installation of these resources, and it should default to true.

They should be distributed by the Helm Chart itself for now.

Acceptance criteria:

jpellizzari commented 1 year ago

Decision: keep these templates in the WGE Helm Chart and distribute them as part of a release. One alternative would be to distribute them separately (in their own repo).

sympatheticmoose commented 1 year ago

Sample:

apiVersion: templates.weave.works/v1alpha1
kind: GitOpsTemplate
metadata:
  name: pipeline-sample
  namespace: flux-system
  labels:
    weave.works/template-type: pipeline
spec:
  description: Sample Pipeline showing visualization of two helm releases across two environments.
  params:
    - name: RESOURCE_NAME 
      description: Name of the Pipeline
    - name: RESOURCE_NAMESPACE
      description: Namespace for the Pipeline on the management cluster
      default: flux-system
    - name: FIRST_CLUSTER_NAME
      description: Name of GitopsCluster object for the first environment
    - name: FIRST_CLUSTER_NAMESPACE
      description: Namespace where this object exists
      default: default
    - name: FIRST_APPLICATION_NAME
      description: Name of the HelmRelease for your application in the first environment
    - name: FIRST_APPLICATION_NAMESPACE
      description: Namespace for this application
      default: flux-system
    - name: SECOND_CLUSTER_NAME
      description: Name of GitopsCluster object for the second environment
    - name: SECOND_CLUSTER_NAMESPACE
      description: Namespace where this object exists
      default: default
    - name: SECOND_APPLICATION_NAME
      description: Name of the HelmRelease for your application in the second environment
    - name: SECOND_APPLICATION_NAMESPACE
      description: Namespace for this application
      default: flux-system
  resourcetemplates:
  - apiVersion: pipelines.weave.works/v1alpha1
    kind: Pipeline
    metadata:
      name: ${RESOURCE_NAME}
      namespace: ${RESOURCE_NAMESPACE}
    spec:
      appRef:
        apiVersion: helm.toolkit.fluxcd.io/v2beta1
        kind: helmrelease
        name: ${APPLICATION_NAME}
      environments:
      - name: First-Environment
        targets:
          - namespace: ${FIRST_APPLICATION_NAMESPACE}
            clusterRef:
              kind: GitopsCluster
              name: ${FIRST_CLUSTER_NAME}
              namespace: ${FIRST_CLUSTER_NAMESPACE}
      - name: Second-Environment
        targets:
          - namespace: ${SECOND_APPLICATION_NAMESPACE}
            clusterRef:
              kind: GitopsCluster
              name: ${SECOND_CLUSTER_NAME}
              namespace: ${SECOND_CLUSTER_NAMESPACE}
enekofb commented 1 year ago

Direction after yesterday conversations

enekofb commented 1 year ago

Request to create repo https://github.com/weaveworks/corp/issues/3341