支持在不使用补丁的情况下自定义功能图像
My actions before raising this issue
- Followed the troubleshooting guide
- Read/searched the docs
- Searched past issues
Why do you need this?
I want to use different images for the same function, based on the environment in which the function runs (dev/staging/prod)
Who is this for?
Private usage. What company is this for? Are you listed in the ADOPTERS.md file?
Expected Behaviour
I would like the ability to define a Kustomization Component with image replacement, like this:
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
images:
- name: tasks
newName: registry/tasks
newTag: devapiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
images:
- name: tasks
newName: registry/tasks
newTag: prodAnd have it impact my base function definition:
apiVersion: openfaas.com/v1
kind: Function
metadata:
name: tasks
namespace: openfaas-fn
spec:
name: tasks
image: tasksAnd within each env I will have the following kustomization.yaml:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base/tasks
components:
- ../dev/extension-apiapiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base/tasks
components:
- ../prod/extension-apiSuch that when I run
kubectl kustomize envs/dev/tasks
The resulting yaml for the function would be:
apiVersion: openfaas.com/v1
kind: Function
metadata:
name: tasks
namespace: openfaas-fn
spec:
name: tasks
image: registry/tasks:devand when I run
kubectl kustomize envs/prod/tasks
The resulting yaml for the function would be:
apiVersion: openfaas.com/v1
kind: Function
metadata:
name: tasks
namespace: openfaas-fn
spec:
name: tasks
image: registry/tasks:prodCurrent Behaviour
When defining the files as the above structure, the component is ignored, and running kubectl kustomize simply produces the same yaml as the base yaml, without replacing the image.
Are you a GitHub Sponsor (Yes/No?)
Check at: https://GitHub.com/sponsors/openfaas
- Yes
- No
List All Possible Solutions and Workarounds
内容来源: openfaas/faas