From 0ccbb3bacaa5e410b7cd75c301492e4ac45dda17 Mon Sep 17 00:00:00 2001 From: datelier <57349093+datelier@users.noreply.github.com> Date: Mon, 7 Aug 2023 15:59:20 +0900 Subject: [PATCH] modified apiversion capabilities check (#2149) * modified apiversion capabilities check * use nightly image as default on e2e github actions * fix INSERT_COUNT on e2e --------- Co-authored-by: Yusuke Kadowaki --- .github/workflows/e2e-deploy.yml | 4 ++-- charts/vald/templates/agent/hpa.yaml | 6 +++--- charts/vald/templates/agent/networkpolicy.yaml | 4 ---- charts/vald/templates/agent/pdb.yaml | 6 +++--- charts/vald/templates/discoverer/hpa.yaml | 6 +++--- charts/vald/templates/discoverer/networkpolicy.yaml | 4 ---- charts/vald/templates/discoverer/pdb.yaml | 6 +++--- charts/vald/templates/gateway/filter/hpa.yaml | 6 +++--- charts/vald/templates/gateway/filter/ing.yaml | 6 +++--- charts/vald/templates/gateway/filter/networkpolicy.yaml | 4 ---- charts/vald/templates/gateway/filter/pdb.yaml | 6 +++--- charts/vald/templates/gateway/lb/hpa.yaml | 6 +++--- charts/vald/templates/gateway/lb/ing.yaml | 6 +++--- charts/vald/templates/gateway/lb/networkpolicy.yaml | 4 ---- charts/vald/templates/gateway/lb/pdb.yaml | 6 +++--- charts/vald/templates/manager/index/networkpolicy.yaml | 4 ---- charts/vald/templates/manager/index/pdb.yaml | 6 +++--- 17 files changed, 35 insertions(+), 55 deletions(-) diff --git a/.github/workflows/e2e-deploy.yml b/.github/workflows/e2e-deploy.yml index 7e9cf04bfa..57678708f7 100644 --- a/.github/workflows/e2e-deploy.yml +++ b/.github/workflows/e2e-deploy.yml @@ -120,7 +120,7 @@ jobs: go version make E2E_BIND_PORT=8081 \ E2E_DATASET_NAME=${DATASET} \ - E2E_INSERT_COUNT=60000 \ + E2E_INSERT_COUNT=10000 \ E2E_SEARCH_COUNT=10000 \ E2E_SEARCH_BY_ID_COUNT=10000 \ E2E_GET_OBJECT_COUNT=100 \ @@ -213,7 +213,7 @@ jobs: go version make E2E_BIND_PORT=8081 \ E2E_DATASET_NAME=${DATASET} \ - E2E_INSERT_COUNT=60000 \ + E2E_INSERT_COUNT=10000 \ E2E_SEARCH_COUNT=10000 \ E2E_SEARCH_BY_ID_COUNT=10000 \ E2E_GET_OBJECT_COUNT=100 \ diff --git a/charts/vald/templates/agent/hpa.yaml b/charts/vald/templates/agent/hpa.yaml index 03cc817388..119fb27d4b 100644 --- a/charts/vald/templates/agent/hpa.yaml +++ b/charts/vald/templates/agent/hpa.yaml @@ -17,12 +17,12 @@ {{- if and $agent.enabled $agent.hpa.enabled }} {{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }} apiVersion: autoscaling/v2 +{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }} +apiVersion: autoscaling/v1 {{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} apiVersion: autoscaling/v2beta2 -{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }} -apiVersion: autoscaling/v2beta1 {{- else }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: diff --git a/charts/vald/templates/agent/networkpolicy.yaml b/charts/vald/templates/agent/networkpolicy.yaml index 28fa63d353..8eb530ef96 100644 --- a/charts/vald/templates/agent/networkpolicy.yaml +++ b/charts/vald/templates/agent/networkpolicy.yaml @@ -18,11 +18,7 @@ {{- $lb := .Values.gateway.lb -}} {{- $index := .Values.manager.index -}} {{- if .Values.defaults.networkPolicy.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} apiVersion: networking.k8s.io/v1 -{{- end }} kind: NetworkPolicy metadata: name: agent-allow diff --git a/charts/vald/templates/agent/pdb.yaml b/charts/vald/templates/agent/pdb.yaml index dd9b2d78f2..fc5fef6c47 100644 --- a/charts/vald/templates/agent/pdb.yaml +++ b/charts/vald/templates/agent/pdb.yaml @@ -15,10 +15,10 @@ # {{- $agent := .Values.agent -}} {{- if $agent.enabled }} -{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: diff --git a/charts/vald/templates/discoverer/hpa.yaml b/charts/vald/templates/discoverer/hpa.yaml index e6eef2a470..44500848ba 100644 --- a/charts/vald/templates/discoverer/hpa.yaml +++ b/charts/vald/templates/discoverer/hpa.yaml @@ -17,12 +17,12 @@ {{- if $discoverer.hpa.enabled }} {{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }} apiVersion: autoscaling/v2 +{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }} +apiVersion: autoscaling/v1 {{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} apiVersion: autoscaling/v2beta2 -{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }} -apiVersion: autoscaling/v2beta1 {{- else }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: diff --git a/charts/vald/templates/discoverer/networkpolicy.yaml b/charts/vald/templates/discoverer/networkpolicy.yaml index 3fd8df02ab..df7d494805 100644 --- a/charts/vald/templates/discoverer/networkpolicy.yaml +++ b/charts/vald/templates/discoverer/networkpolicy.yaml @@ -18,11 +18,7 @@ {{- $lb := .Values.gateway.lb -}} {{- $index := .Values.manager.index -}} {{- if .Values.defaults.networkPolicy.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} apiVersion: networking.k8s.io/v1 -{{- end }} kind: NetworkPolicy metadata: name: discoverer-allow diff --git a/charts/vald/templates/discoverer/pdb.yaml b/charts/vald/templates/discoverer/pdb.yaml index a69634c0e2..35461e6a39 100644 --- a/charts/vald/templates/discoverer/pdb.yaml +++ b/charts/vald/templates/discoverer/pdb.yaml @@ -15,10 +15,10 @@ # {{- $discoverer := .Values.discoverer -}} {{- if $discoverer.enabled }} -{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: diff --git a/charts/vald/templates/gateway/filter/hpa.yaml b/charts/vald/templates/gateway/filter/hpa.yaml index 85e6e4487f..29935a16e6 100644 --- a/charts/vald/templates/gateway/filter/hpa.yaml +++ b/charts/vald/templates/gateway/filter/hpa.yaml @@ -17,12 +17,12 @@ {{- if and $gateway.enabled $gateway.hpa.enabled }} {{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }} apiVersion: autoscaling/v2 +{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }} +apiVersion: autoscaling/v1 {{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} apiVersion: autoscaling/v2beta2 -{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }} -apiVersion: autoscaling/v2beta1 {{- else }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: diff --git a/charts/vald/templates/gateway/filter/ing.yaml b/charts/vald/templates/gateway/filter/ing.yaml index b26506b7ae..07c6c9574b 100644 --- a/charts/vald/templates/gateway/filter/ing.yaml +++ b/charts/vald/templates/gateway/filter/ing.yaml @@ -15,10 +15,10 @@ # {{- $gateway := .Values.gateway.filter -}} {{- if and $gateway.enabled $gateway.ingress.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} apiVersion: networking.k8s.io/v1 +{{- else }} +apiVersion: networking.k8s.io/v1alpha1 {{- end }} kind: Ingress metadata: diff --git a/charts/vald/templates/gateway/filter/networkpolicy.yaml b/charts/vald/templates/gateway/filter/networkpolicy.yaml index 61142fad7d..d4d4b68374 100644 --- a/charts/vald/templates/gateway/filter/networkpolicy.yaml +++ b/charts/vald/templates/gateway/filter/networkpolicy.yaml @@ -17,11 +17,7 @@ {{- $lb := .Values.gateway.lb -}} {{- $filter := .Values.gateway.filter -}} {{- if .Values.defaults.networkPolicy.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} apiVersion: networking.k8s.io/v1 -{{- end }} kind: NetworkPolicy metadata: name: filter-allow diff --git a/charts/vald/templates/gateway/filter/pdb.yaml b/charts/vald/templates/gateway/filter/pdb.yaml index 5cb62ab1dd..8685c71513 100644 --- a/charts/vald/templates/gateway/filter/pdb.yaml +++ b/charts/vald/templates/gateway/filter/pdb.yaml @@ -15,10 +15,10 @@ # {{- $gateway := .Values.gateway.filter -}} {{- if $gateway.enabled }} -{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: diff --git a/charts/vald/templates/gateway/lb/hpa.yaml b/charts/vald/templates/gateway/lb/hpa.yaml index dc083f02a1..c5da8e8753 100644 --- a/charts/vald/templates/gateway/lb/hpa.yaml +++ b/charts/vald/templates/gateway/lb/hpa.yaml @@ -17,12 +17,12 @@ {{- if and $gateway.enabled $gateway.hpa.enabled }} {{- if (.Capabilities.APIVersions.Has "autoscaling/v2") }} apiVersion: autoscaling/v2 +{{- else if (.Capabilities.APIVersions.Has "autoscaling/v1") }} +apiVersion: autoscaling/v1 {{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta2") }} apiVersion: autoscaling/v2beta2 -{{- else if (.Capabilities.APIVersions.Has "autoscaling/v2beta1") }} -apiVersion: autoscaling/v2beta1 {{- else }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: diff --git a/charts/vald/templates/gateway/lb/ing.yaml b/charts/vald/templates/gateway/lb/ing.yaml index f432c18a1e..7fc157b4a8 100644 --- a/charts/vald/templates/gateway/lb/ing.yaml +++ b/charts/vald/templates/gateway/lb/ing.yaml @@ -15,10 +15,10 @@ # {{- $gateway := .Values.gateway.lb -}} {{- if and $gateway.enabled $gateway.ingress.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1") }} apiVersion: networking.k8s.io/v1 +{{- else }} +apiVersion: networking.k8s.io/v1alpha1 {{- end }} kind: Ingress metadata: diff --git a/charts/vald/templates/gateway/lb/networkpolicy.yaml b/charts/vald/templates/gateway/lb/networkpolicy.yaml index 6e90f00cdb..c2d71460a6 100644 --- a/charts/vald/templates/gateway/lb/networkpolicy.yaml +++ b/charts/vald/templates/gateway/lb/networkpolicy.yaml @@ -19,11 +19,7 @@ {{- $filter := .Values.gateway.filter -}} {{- $discoverer := .Values.discoverer -}} {{- if .Values.defaults.networkPolicy.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} apiVersion: networking.k8s.io/v1 -{{- end }} kind: NetworkPolicy metadata: name: lb-allow diff --git a/charts/vald/templates/gateway/lb/pdb.yaml b/charts/vald/templates/gateway/lb/pdb.yaml index 2af318775e..9fa97f2b79 100644 --- a/charts/vald/templates/gateway/lb/pdb.yaml +++ b/charts/vald/templates/gateway/lb/pdb.yaml @@ -15,10 +15,10 @@ # {{- $gateway := .Values.gateway.lb -}} {{- if $gateway.enabled }} -{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: diff --git a/charts/vald/templates/manager/index/networkpolicy.yaml b/charts/vald/templates/manager/index/networkpolicy.yaml index 01f0d2f94f..1321baea26 100644 --- a/charts/vald/templates/manager/index/networkpolicy.yaml +++ b/charts/vald/templates/manager/index/networkpolicy.yaml @@ -18,11 +18,7 @@ {{- $discoverer := .Values.discoverer -}} {{- $index := .Values.manager.index -}} {{- if .Values.defaults.networkPolicy.enabled }} -{{- if (.Capabilities.APIVersions.Has "networking.k8s.io/v1alpha1") }} -apiVersion: networking.k8s.io/v1alpha1 -{{- else }} apiVersion: networking.k8s.io/v1 -{{- end }} kind: NetworkPolicy metadata: name: index-allow diff --git a/charts/vald/templates/manager/index/pdb.yaml b/charts/vald/templates/manager/index/pdb.yaml index f4977c5546..b80bb643da 100644 --- a/charts/vald/templates/manager/index/pdb.yaml +++ b/charts/vald/templates/manager/index/pdb.yaml @@ -15,10 +15,10 @@ # {{- $index := .Values.manager.index -}} {{- if $index.enabled }} -{{- if (.Capabilities.APIVersions.Has "policy/v1beta1") }} -apiVersion: policy/v1beta1 -{{- else }} +{{- if (.Capabilities.APIVersions.Has "policy/v1") }} apiVersion: policy/v1 +{{- else }} +apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: