mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
Add benchmark for containerized KRM function in kustomize
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: label_namespace
|
||||
annotations:
|
||||
config.kubernetes.io/function: |-
|
||||
container:
|
||||
image: gcr.io/kpt-functions/label-namespace@sha256:4f030738d6d25a207641ca517916431517578bd0eb8d98a8bde04e3bb9315dcd
|
||||
data:
|
||||
label_name: my-ns-name
|
||||
label_value: function-test
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: my-namespace
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: another-namespace
|
||||
@@ -0,0 +1,5 @@
|
||||
resources:
|
||||
- data1.yaml
|
||||
- data2.yaml
|
||||
transformers:
|
||||
- containerfn.yaml
|
||||
15
hack/krmFunctionBenchmark/label_namespace/execfn/Dockerfile
Normal file
15
hack/krmFunctionBenchmark/label_namespace/execfn/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM alpine:latest
|
||||
|
||||
ENV BUILD_HOME=/usr/local/build
|
||||
RUN apk update && apk add --no-cache git nodejs npm
|
||||
RUN npm install -g typescript
|
||||
|
||||
RUN mkdir -p $BUILD_HOME
|
||||
|
||||
WORKDIR $BUILD_HOME
|
||||
|
||||
RUN git clone https://github.com/GoogleContainerTools/kpt-functions-sdk.git .
|
||||
RUN git checkout tags/release-kpt-functions-v0.14.2
|
||||
WORKDIR $BUILD_HOME/ts/hello-world/
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
8
hack/krmFunctionBenchmark/label_namespace/execfn/build.sh
Executable file
8
hack/krmFunctionBenchmark/label_namespace/execfn/build.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#! /bin/bash
|
||||
|
||||
IMAGE_LABEL="label_namespace_build:latest"
|
||||
BUILD_HOME=/usr/local/build
|
||||
|
||||
docker build -t $IMAGE_LABEL .
|
||||
|
||||
docker run --rm -v $(pwd):/out $IMAGE_LABEL cp -r $BUILD_HOME/ts/hello-world/dist $BUILD_HOME/ts/hello-world/node_modules /out
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: my-namespace
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: another-namespace
|
||||
11
hack/krmFunctionBenchmark/label_namespace/execfn/execfn.yaml
Normal file
11
hack/krmFunctionBenchmark/label_namespace/execfn/execfn.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: label_namespace
|
||||
annotations:
|
||||
config.kubernetes.io/function: |-
|
||||
exec:
|
||||
path: ./fn.sh
|
||||
data:
|
||||
label_name: my-ns-name
|
||||
label_value: function-test
|
||||
3
hack/krmFunctionBenchmark/label_namespace/execfn/fn.sh
Executable file
3
hack/krmFunctionBenchmark/label_namespace/execfn/fn.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /bin/bash
|
||||
|
||||
node ./dist/label_namespace_run.js
|
||||
@@ -0,0 +1,5 @@
|
||||
resources:
|
||||
- data1.yaml
|
||||
- data2.yaml
|
||||
transformers:
|
||||
- execfn.yaml
|
||||
Reference in New Issue
Block a user