Flux: Allow setting "automated" on Functions

Created on 5 Mar 2019  路  5Comments  路  Source: fluxcd/flux

I'm using OpenFaaS in conjunction with Flux, as part of our CI, we build a new tag for the docker image for our functions (to keep it consist with every other pipeline we have).

Setting flux.weave.works/automated: "true" doesn't work for functions, which means that our developers have to tell us when they've pushed a new git commit, unlike our Helm deployed applications everything just works with the same ECR registry.

enhancement

Most helpful comment

What do you think about a new annotation key to address the CRD's image path?
fluxcd.io/image-path: spec.image for OpenFaas,
fluxcd.io/image-path: spec.template.spec.containers[].image for Knative Service.

The value of the annotation may also have multiple comma-separated paths like fluxcd.io/image-path: spec.image1,spec.image2

All 5 comments

@jpds I don't think we have OpenFaaS-support as a priority, however, we are always open to PRs.

What do you think about a new annotation key to address the CRD's image path?
fluxcd.io/image-path: spec.image for OpenFaas,
fluxcd.io/image-path: spec.template.spec.containers[].image for Knative Service.

The value of the annotation may also have multiple comma-separated paths like fluxcd.io/image-path: spec.image1,spec.image2

Another alternative can be using a deployment-wide map configuration for CRD GroupVersionKind to its image path.

crds:
 - group: openfaas.com
   version: v1
   kind: Function
   imagePaths:
    - spec.image
 - group: example.com
   version: v1beta1
   kind: MyCustomCRD
   imagePaths:
    - spec.firstImage
    - spec.secondImage

We also need this to work with CRDs! We are using Agones for instance and we
need the image to auto update for the GameServer in a Fleet.

Kustomize can already replace the image in CRs when generating yamls, so Flux should simply consider all resources with the fluxcd.io/automated: "true" annotation to trigger a release!

I am creating an operator which allows a CRD with one of the values being the the image tag which latelly will be deployed.

apiVersion: example.com/v1beta1
kind: MyOperator
metadata:
  name: my-operator
  namespace: 'example'
spec: 
      repository: xxx
      tag: v1.0.0

It would be very helpful that thorugh annotations like described above, the value of tag is updated by flux.

Like described by @ismailbaskin :

apiVersion: example.com/v1beta1
kind: MyOperator
metadata:
  name: my-operator
  namespace: 'example'
  annotations:
   fluxcd.io/image-path: spec.tag
   fluxcd.io/automated: "true"
spec: 
      repository: xxx
      tag: v1.0.0
Was this page helpful?
0 / 5 - 0 ratings