Docs and examples use config.k8s.io/function annotation

- Update function docs to recommend new annotation
- Update examples to use config.k8s.io/function annotation
This commit is contained in:
Prachi Pendse
2020-01-03 10:52:56 +05:30
parent 2880c2ae5d
commit 5ee6380b1c
14 changed files with 49 additions and 44 deletions

View File

@@ -15,7 +15,7 @@ Resource configuration, and looks for invalid configuration.
## Function invocation
The function is invoked by authoring a [local Resource](local-resource)
with `metadata.configFn` and running:
with `metadata.annotations.[config.k8s.io/function]` and running:
kustomize config run local-resource/

View File

@@ -4,9 +4,10 @@
apiVersion: examples.config.kubernetes.io/v1beta1
kind: Validator
metadata:
configFn:
container:
image: gcr.io/kustomize-functions/example-tshirt:v0.1.0
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kustomize-functions/example-tshirt:v0.1.0
---
apiVersion: apps/v1
kind: Deployment

View File

@@ -25,7 +25,7 @@ function input, and writing the function output.
## Function invocation
The function is invoked by authoring a [local Resource](local-resource)
with `metadata.configFn` and running:
with `metadata.annotations.[config.k8s.io/function]` and running:
kustomize config run local-resource/

View File

@@ -5,8 +5,9 @@ apiVersion: examples.config.kubernetes.io/v1beta1 # call `kustomize config run`
kind: Nginx
metadata:
name: demo
configFn:
container:
image: gcr.io/kustomize-functions/example-nginx:v0.1.0
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kustomize-functions/example-nginx:v0.1.0
spec:
replicas: 4

View File

@@ -20,7 +20,7 @@ heavy lifting of implementing the function interface.
## Function invocation
The function is invoked by authoring a [local Resource](local-resource)
with `metadata.configFn` and running:
with `metadata.annotations.[config.k8s.io/function]` and running:
kustomize config run local-resource/

View File

@@ -6,8 +6,9 @@ apiVersion: examples.config.kubernetes.io/v1beta1
kind: CockroachDB
metadata:
name: demo
configFn:
container:
image: gcr.io/kustomize-functions/example-cockroachdb:v0.1.0
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kustomize-functions/example-cockroachdb:v0.1.0
spec:
replicas: 3

View File

@@ -18,7 +18,7 @@ the `API` struct definition in [main.go](image/main.go) for documentation.
## Function invocation
The function is invoked by authoring a [local Resource](local-resource)
with `metadata.configFn` and running:
with `metadata.annotations.[config.k8s.io/function]` and running:
kustomize config run local-resource/

View File

@@ -4,9 +4,10 @@
apiVersion: examples.config.kubernetes.io/v1beta1
kind: Kubeval
metadata:
configFn:
container:
image: gcr.io/kustomize-functions/example-validator-kubeval:v0.1.0
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kustomize-functions/example-validator-kubeval:v0.1.0
spec:
strict: true
ignoreMissingSchemas: true

View File

@@ -15,7 +15,7 @@ Resource configuration, and looks for invalid configuration.
## Function invocation
The function is invoked by authoring a [local Resource](local-resource)
with `metadata.configFn` and running:
with `metadata.annotations.[config.k8s.io/function]` and running:
kustomize config run local-resource/

View File

@@ -4,9 +4,10 @@
apiVersion: examples.config.kubernetes.io/v1beta1
kind: Validator
metadata:
configFn:
container:
image: gcr.io/kustomize-functions/example-validator:v0.1.0
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kustomize-functions/example-validator:v0.1.0
---
apiVersion: apps/v1 # this should fail validation
kind: Deployment