mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 08:20:59 +00:00
Add benchmark for containerized KRM function in kustomize
This commit is contained in:
16
hack/krmFunctionBenchmark/example_tshirt/execfn/Dockerfile
Normal file
16
hack/krmFunctionBenchmark/example_tshirt/execfn/Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM alpine:latest
|
||||
|
||||
ENV BUILD_HOME=/usr/local/build
|
||||
RUN apk update && apk add --no-cache git go
|
||||
|
||||
RUN mkdir -p $BUILD_HOME
|
||||
|
||||
WORKDIR $BUILD_HOME
|
||||
|
||||
RUN git clone https://github.com/kubernetes-sigs/kustomize.git .
|
||||
RUN git checkout tags/kustomize/v3.6.1
|
||||
WORKDIR $BUILD_HOME/functions/examples/injection-tshirt-sizes/image/
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
RUN go mod download
|
||||
RUN go build -o tshirt .
|
||||
8
hack/krmFunctionBenchmark/example_tshirt/execfn/build.sh
Executable file
8
hack/krmFunctionBenchmark/example_tshirt/execfn/build.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#! /bin/bash
|
||||
|
||||
IMAGE_LABEL="tshirt_example_build:latest"
|
||||
BUILD_HOME=/usr/local/build
|
||||
|
||||
docker build -t $IMAGE_LABEL .
|
||||
|
||||
docker run --rm -v $(pwd):/out $IMAGE_LABEL cp -r $BUILD_HOME/functions/examples/injection-tshirt-sizes/image/tshirt /out
|
||||
20
hack/krmFunctionBenchmark/example_tshirt/execfn/data.yaml
Normal file
20
hack/krmFunctionBenchmark/example_tshirt/execfn/data.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nginx
|
||||
labels:
|
||||
app: nginx
|
||||
annotations:
|
||||
tshirt-size: small # this injects the resource reservations
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nginx
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx
|
||||
@@ -0,0 +1,4 @@
|
||||
resources:
|
||||
- data.yaml
|
||||
transformers:
|
||||
- transf.yaml
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||
kind: tshirt
|
||||
metadata:
|
||||
name: tshirt
|
||||
annotations:
|
||||
config.kubernetes.io/function: |-
|
||||
exec:
|
||||
path: ./tshirt
|
||||
Reference in New Issue
Block a user