diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index bd33ef1..385e2a8 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -5,7 +5,6 @@ resources: - bases/gatling-operator.tech.zozo.com_gatlings.yaml # +kubebuilder:scaffold:crdkustomizeresource -patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD # - patches/webhook_in_gatlings.yaml @@ -19,3 +18,5 @@ patchesStrategicMerge: # the following config is for teaching kustomize how to do kustomization for CRDs. configurations: - kustomizeconfig.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index fc55a6a..9fd8e2b 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -12,10 +12,6 @@ namePrefix: gatling-operator- # commonLabels: # someName: someValue -bases: -- ../crd -- ../rbac -- ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml # - ../webhook @@ -24,11 +20,9 @@ bases: # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. # - ../prometheus -patchesStrategicMerge: # Protect the /metrics endpoint by putting it behind auth. # If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line. -- manager_auth_proxy_patch.yaml # Mount the controller config file for loading manager configurations # through a ComponentConfig type @@ -44,31 +38,11 @@ patchesStrategicMerge: # - webhookcainjection_patch.yaml # the following config is for teaching kustomize how to do var substitution -vars: -# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -# - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# fieldref: -# fieldpath: metadata.namespace -# - name: CERTIFICATE_NAME -# objref: -# kind: Certificate -# group: cert-manager.io -# version: v1 -# name: serving-cert # this name should match the one in certificate.yaml -# - name: SERVICE_NAMESPACE # namespace of the service -# objref: -# kind: Service -# version: v1 -# name: webhook-service -# fieldref: -# fieldpath: metadata.namespace -# - name: SERVICE_NAME -# objref: -# kind: Service -# version: v1 -# name: webhook-service +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../crd +- ../rbac +- ../manager +patches: +- path: manager_auth_proxy_patch.yaml diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 21a5685..29581a4 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,4 +1,8 @@ resources: - manager.yaml - -# This file will get modified by kustomize file. Please don't commit any changes to the git repo! +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +images: +- name: controller + newName: gatling-operator + newTag: 20240214-221927 diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index ed13716..a5a7cbb 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,2 +1,4 @@ resources: - monitor.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index fb5a2b8..7f4e2bc 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -1,18 +1,13 @@ -resources: # All RBAC will be applied under this service account in # the deployment namespace. You may comment out this resource # if your manager will use a service account that exists at # runtime. Be sure to update RoleBinding and ClusterRoleBinding # subjects if changing service account names. +resources: - service_account.yaml - role.yaml - role_binding.yaml - leader_election_role.yaml - leader_election_role_binding.yaml -# Comment the following 4 lines if you want to disable -# the auth proxy (https://github.com/brancz/kube-rbac-proxy) -# which protects your /metrics endpoint. -# - auth_proxy_service.yaml -# - auth_proxy_role.yaml -# - auth_proxy_role_binding.yaml -# - auth_proxy_client_clusterrole.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index 2a16f5c..ff4b925 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -2,3 +2,5 @@ resources: - gatling-notification-slack-secrets.yaml - gatling-operator_v1alpha1_gatling01.yaml - gatling-worker-service-account.yaml +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization diff --git a/gatling/Dockerfile b/gatling/Dockerfile index 91395da..672c990 100644 --- a/gatling/Dockerfile +++ b/gatling/Dockerfile @@ -2,6 +2,22 @@ # https://github.com/denvazh/gatling/tree/master/3.2.1 # # Gatling is a highly capable load testing tool. +FROM maven:3.9.6 AS dependency_stage + +WORKDIR /tmp + +ARG MAVEN_REPO="https://repo.maven.apache.org/maven2/" +ARG MAVEN_ARTIFACTS="\ + com.github.javafaker:javafaker:1.0.2 \ + com.github.mifmif:generex:1.0.2 \ + org.apache.commons:commons-lang3:3.5 \ + org.yaml:snakeyaml:1.23 \ +" + +# Fetch dependencies using Maven +RUN for artifact in $MAVEN_ARTIFACTS; do \ + mvn dependency:copy -Dartifact="$artifact" -DoutputDirectory="/tmp/lib/." -DremoteRepositories="$MAVEN_REPO"; \ + done FROM openjdk:17-jdk-slim-bullseye @@ -9,10 +25,11 @@ FROM openjdk:17-jdk-slim-bullseye WORKDIR /opt # gating version -ENV GATLING_VERSION 3.9.5 +ENV GATLING_VERSION 3.10.4 -# create directory for gatling install -RUN mkdir -p gatling +ENV APP_HOME /opt/gatling +ENV APP_USER gatling +ENV APP_GROUP appgroup # install gatling RUN set -x && mkdir -p gatling && \ @@ -29,8 +46,7 @@ RUN set -x && mkdir -p gatling && \ curl https://rclone.org/install.sh | bash && \ addgroup --system ${APP_GROUP} && \ adduser --system ${APP_USER} --ingroup ${APP_GROUP} --home ${APP_HOME} --no-create-home && \ - chown -R ${APP_USER}:${APP_GROUP} ${APP_HOME} && \ - chown -R ${APP_USER}:${APP_GROUP} /var/log/nginx /var/lib/nginx /usr/share/nginx + chown -R ${APP_USER}:${APP_GROUP} ${APP_HOME} /var/log/nginx /var/lib/nginx /usr/share/nginx USER gatling @@ -44,6 +60,7 @@ VOLUME ["/opt/gatling/conf", "/opt/gatling/results", "/opt/gatling/user-files"] COPY user-files/simulations user-files/simulations COPY user-files/resources user-files/resources COPY conf conf +COPY --from=dependency_stage /tmp/lib ${APP_HOME}/user-files/lib/ # set environment variables ENV PATH /opt/gatling/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin