Skip to content

Commit

Permalink
ci: add job for sidecar container feature
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont committed Feb 21, 2024
1 parent d4f3afa commit e04a2b9
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 73 deletions.
34 changes: 17 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ parameters:
e2e_param_cniNetworkPlugin:
type: string
default: flannel
e2e_param_legacyKDS:
type: boolean
default: false
e2e_param_sidecarContainers:
type: string
default: ""
# See https://circleci.com/docs/2.0/configuration-reference/#commands-requires-version-21.
commands:
install_build_tools:
Expand Down Expand Up @@ -265,8 +265,8 @@ jobs:
description: The CNI networking plugin to use [flannel | calico]
type: string
default: flannel
legacyKDS:
description: if should run tests with new implementation of KDS
sidecarContainers:
description: if should run tests with sidecar containers
type: boolean
default: false
executor:
Expand All @@ -285,7 +285,7 @@ jobs:
- {equal: [calico, << parameters.cniNetworkPlugin >>]}
- {equal: [kindIpv6, << parameters.k8sVersion >>]}
- {equal: [arm64, << parameters.arch >>]}
- {equal: [true, << parameters.legacyKDS >>]}
# - {equal: [true, << parameters.sidecarContainers >>]}
- {equal: [<< pipeline.parameters.first_k8s_version >>, << parameters.k8sVersion >>]}
steps:
- halt_non_priority_job
Expand Down Expand Up @@ -362,8 +362,8 @@ jobs:
export MAKE_PARAMETERS="-j2"
fi
if [[ "<< parameters.legacyKDS >>" == true ]]; then
export KUMA_LEGACY_KDS=true
if [[ "<< parameters.sidecarContainers >>" == true ]]; then
export KUMA_EXPERIMENTAL_SIDECAR_CONTAINERS=true
fi
if [[ "<< parameters.target >>" == "" ]]; then
Expand Down Expand Up @@ -403,8 +403,8 @@ jobs:
description: The CNI networking plugin to use [flannel | calico]
type: string
default: flannel
legacyKDS:
description: if should run tests with new implementation of KDS
sidecarContainers:
description: if should run tests with sidecar containers
type: boolean
executor:
name: vm-<< parameters.arch >>
Expand Down Expand Up @@ -471,8 +471,8 @@ jobs:
export MAKE_PARAMETERS="-j2"
fi
if [[ "<< parameters.legacyKDS >>" == true ]]; then
export KUMA_LEGACY_KDS=true
if [[ "<< parameters.sidecarContainers >>" == true ]]; then
export KUMA_EXPERIMENTAL_SIDECAR_CONTAINERS=true
fi
if [[ "<< parameters.target >>" == "" ]]; then
Expand Down Expand Up @@ -625,14 +625,14 @@ workflows:
arch: [amd64, arm64]
requires: [build, go_cache-<< matrix.arch >>]
- e2e:
name: << matrix.target >>:<< matrix.arch >>-<< matrix.k8sVersion >>-legacy-kds
name: << matrix.target >>:<< matrix.arch >>-<< matrix.k8sVersion >>-sidecar-containers
matrix:
alias: legacy-kds
alias: sidecar-containers
parameters:
k8sVersion: [<< pipeline.parameters.last_k8s_version >>]
target: [multizone]
target: [kubernetes]
arch: [amd64]
legacyKDS: [true]
sidecarContainers: [true]
requires: [build, go_cache-amd64]
- e2e:
name: << matrix.target >>:<< matrix.arch >>-<< matrix.k8sVersion >>-calico
Expand Down Expand Up @@ -661,6 +661,6 @@ workflows:
k8sVersion: << pipeline.parameters.e2e_param_k8sVersion >>
target: << pipeline.parameters.e2e_param_target >>
arch: << pipeline.parameters.e2e_param_arch >>
legacyKDS: << pipeline.parameters.e2e_param_legacyKDS >>
sidecarContainers: {not: {equal: [<< pipeline.parameters.e2e_param_sidecarContainers >>, ""]}}
cniNetworkPlugin: << pipeline.parameters.e2e_param_cniNetworkPlugin >>
parallelism: << pipeline.parameters.e2e_param_parallelism >>
6 changes: 3 additions & 3 deletions .github/workflows/build-test-distribute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,23 @@ jobs:
"arch": ["amd64"],
"parallelism": [4],
"cniNetworkPlugin": ["flannel"],
"legacyKDS": [false]
"sidecarContainers": [""]
},
"test_e2e_env": {
"target": ["kubernetes", "universal", "multizone"],
"k8sVersion": ["kind", "kindIpv6", "${{ env.K8S_MIN_VERSION }}", "${{ env.K8S_MAX_VERSION }}"],
"arch": ["amd64"],
"parallelism": [1],
"cniNetworkPlugin": ["flannel"],
"legacyKDS": [false],
"sidecarContainers": [""],
"exclude":[
{"target": "kubernetes", "k8sVersion":"kind"},
{"target": "multizone", "k8sVersion":"kind"},
{"target":"universal", "k8sVersion":"${{ env.K8S_MIN_VERSION }}"},
{"target":"universal", "k8sVersion":"${{ env.K8S_MAX_VERSION }}"}
],
"include":[
{"legacyKDS": true, "k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "multizone", "arch": "amd64"},
{"sidecarContainers": "sidecarContainers", "k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "kubernetes", "arch": "amd64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "multizone", "arch": "arm64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "kubernetes", "arch": "arm64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "universal", "arch": "arm64"},
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:
E2E_PARAM_K8S_VERSION: ${{ fromJSON(inputs.matrix).k8sVersion }}
E2E_PARAM_CNI_NETWORK_PLUGIN: ${{ fromJSON(inputs.matrix).cniNetworkPlugin }}
E2E_PARAM_ARCH: ${{ fromJSON(inputs.matrix).arch }}
E2E_PARAM_LEGACY_KDS: ${{ fromJSON(inputs.matrix).legacyKDS }}
E2E_PARAM_SIDECAR_CONTAINERS: ${{ fromJSON(inputs.matrix).sidecarContainers }}
E2E_PARAM_TARGET: ${{ fromJSON(inputs.matrix).target }}
E2E_PARAM_PARALLELISM: ${{ fromJSON(inputs.matrix).parallelism }}
CI_TOOLS_DIR: /home/runner/work/kuma/kuma/.ci_tools
Expand Down Expand Up @@ -124,8 +124,8 @@ jobs:
export MAKE_PARAMETERS="-j2"
fi
if [[ "${{ env.E2E_PARAM_LEGACY_KDS }}" == "true" ]]; then
export KUMA_LEGACY_KDS=true
if [[ "${{ env.E2E_PARAM_SIDECAR_CONTAINERS }}" != "" ]]; then
export KUMA_EXPERIMENTAL_SIDECAR_CONTAINERS=true
fi
if [[ "${{ env.E2E_PARAM_TARGET }}" == "" ]]; then
Expand Down
88 changes: 45 additions & 43 deletions test/framework/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,50 @@ var _ config.Config = E2eConfig{}
type E2eConfig struct {
config.BaseConfig

KumaImageRegistry string `json:"imageRegistry,omitempty" envconfig:"KUMA_GLOBAL_IMAGE_REGISTRY"`
KumaImageTag string `json:"imageTag,omitempty" envconfig:"KUMA_GLOBAL_IMAGE_TAG"`
KumaNamespace string `json:"namespace,omitempty"`
KumaServiceName string `json:"serviceName,omitempty"`
HelmChartPath string `json:"helmChartPath,omitempty"`
HelmSubChartPrefix string `json:"helmSubChartPrefix,omitempty"`
HelmChartName string `json:"helmChartName,omitempty"`
HelmRepoUrl string `json:"helmRepoUrl,omitempty"`
HelmGlobalExtraYaml string `json:"HelmGlobalExtraYaml,omitempty"`
CNIApp string `json:"CNIApp,omitempty"`
CNINamespace string `json:"CNINamespace,omitempty"`
CNIConf CniConf `json:"CNIConf,omitempty"`
KumaGlobalZoneSyncServiceName string `json:"globalZoneSyncServiceName,omitempty"`
KumaUniversalEnvVars map[string]string `json:"universalEnvVars,omitempty"`
KumaZoneUniversalEnvVars map[string]string `json:"universalZoneEnvVars,omitempty"`
KumaK8sCtlFlags map[string]string `json:"k8sCtlFlags,omitempty"`
KumaZoneK8sCtlFlags map[string]string `json:"k8sZoneCtlFlags,omitempty"`
DefaultObservabilityNamespace string `json:"observabilityNamespace,omitempty"`
DefaultGatewayNamespace string `json:"gatewayNamespace,omitempty"`
KumactlImageRepo string `json:"ctlImageRepo,omitempty" envconfig:"KUMACTL_IMAGE_REPOSITORY"`
KumaCPImageRepo string `json:"cpImageRepo,omitempty" envconfig:"KUMA_CP_IMAGE_REPOSITORY"`
KumaDPImageRepo string `json:"dpImageRepo,omitempty" envconfig:"KUMA_DP_IMAGE_REPOSITORY"`
KumaInitImageRepo string `json:"initImageRepo,omitempty" envconfig:"KUMA_INIT_IMAGE_REPOSITORY"`
KumaCNIImageRepo string `json:"cniImageRepo,omitempty" envconfig:"KUMA_CNI_IMAGE_REPOSITORY"`
KumaUniversalImageRepo string `json:"universalImageRepo,omitempty"`
XDSApiVersion string `json:"xdsVersion,omitempty" envconfig:"API_VERSION"`
K8sType K8sType `json:"k8sType,omitempty" envconfig:"KUMA_K8S_TYPE"`
IPV6 bool `json:"ipv6,omitempty" envconfig:"IPV6"`
UseHostnameInsteadOfIP bool `json:"useHostnameInsteadOfIP,omitempty" envconfig:"KUMA_USE_HOSTNAME_INSTEAD_OF_ID"`
UseLoadBalancer bool `json:"useLoadBalancer,omitempty" envconfig:"KUMA_USE_LOAD_BALANCER"`
CIDR string `json:"kumaCidr,omitempty"`
DefaultClusterStartupRetries int `json:"defaultClusterStartupRetries,omitempty" envconfig:"KUMA_DEFAULT_RETRIES"`
DefaultClusterStartupTimeout time.Duration `json:"defaultClusterStartupTimeout,omitempty" envconfig:"KUMA_DEFAULT_TIMEOUT"`
KumactlBin string `json:"kumactlBin,omitempty" envconfig:"KUMACTLBIN"`
ZoneEgressApp string `json:"zoneEgressApp,omitempty" envconfig:"KUMA_ZONE_EGRESS_APP"`
ZoneIngressApp string `json:"zoneIngressApp,omitempty" envconfig:"KUMA_ZONE_INGRESS_APP"`
Arch string `json:"arch,omitempty" envconfig:"ARCH"`
OS string `json:"os,omitempty" envconfig:"OS"`
KumaCpConfig KumaCpConfig `json:"kumaCpConfig,omitempty" envconfig:"KUMA_CP_CONFIG"`
UniversalE2ELogsPath string `json:"universalE2ELogsPath,omitempty" envconfig:"UNIVERSAL_E2E_LOGS_PATH"`
CleanupLogsOnSuccess bool `json:"cleanupLogsOnSuccess,omitempty" envconfig:"CLEANUP_LOGS_ON_SUCCESS"`
KumaLegacyKDS bool `json:"kumaLegacyKDS,omitempty" envconfig:"KUMA_LEGACY_KDS"`
VersionsYamlPath string `json:"versionsYamlPath,omitempty" envconfig:"VERSIONS_YAML_PATH"`
KumaImageRegistry string `json:"imageRegistry,omitempty" envconfig:"KUMA_GLOBAL_IMAGE_REGISTRY"`
KumaImageTag string `json:"imageTag,omitempty" envconfig:"KUMA_GLOBAL_IMAGE_TAG"`
KumaNamespace string `json:"namespace,omitempty"`
KumaServiceName string `json:"serviceName,omitempty"`
HelmChartPath string `json:"helmChartPath,omitempty"`
HelmSubChartPrefix string `json:"helmSubChartPrefix,omitempty"`
HelmChartName string `json:"helmChartName,omitempty"`
HelmRepoUrl string `json:"helmRepoUrl,omitempty"`
HelmGlobalExtraYaml string `json:"HelmGlobalExtraYaml,omitempty"`
CNIApp string `json:"CNIApp,omitempty"`
CNINamespace string `json:"CNINamespace,omitempty"`
CNIConf CniConf `json:"CNIConf,omitempty"`
KumaGlobalZoneSyncServiceName string `json:"globalZoneSyncServiceName,omitempty"`
KumaUniversalEnvVars map[string]string `json:"universalEnvVars,omitempty"`
KumaZoneUniversalEnvVars map[string]string `json:"universalZoneEnvVars,omitempty"`
KumaK8sCtlFlags map[string]string `json:"k8sCtlFlags,omitempty"`
KumaZoneK8sCtlFlags map[string]string `json:"k8sZoneCtlFlags,omitempty"`
DefaultObservabilityNamespace string `json:"observabilityNamespace,omitempty"`
DefaultGatewayNamespace string `json:"gatewayNamespace,omitempty"`
KumactlImageRepo string `json:"ctlImageRepo,omitempty" envconfig:"KUMACTL_IMAGE_REPOSITORY"`
KumaCPImageRepo string `json:"cpImageRepo,omitempty" envconfig:"KUMA_CP_IMAGE_REPOSITORY"`
KumaDPImageRepo string `json:"dpImageRepo,omitempty" envconfig:"KUMA_DP_IMAGE_REPOSITORY"`
KumaInitImageRepo string `json:"initImageRepo,omitempty" envconfig:"KUMA_INIT_IMAGE_REPOSITORY"`
KumaCNIImageRepo string `json:"cniImageRepo,omitempty" envconfig:"KUMA_CNI_IMAGE_REPOSITORY"`
KumaUniversalImageRepo string `json:"universalImageRepo,omitempty"`
XDSApiVersion string `json:"xdsVersion,omitempty" envconfig:"API_VERSION"`
K8sType K8sType `json:"k8sType,omitempty" envconfig:"KUMA_K8S_TYPE"`
IPV6 bool `json:"ipv6,omitempty" envconfig:"IPV6"`
UseHostnameInsteadOfIP bool `json:"useHostnameInsteadOfIP,omitempty" envconfig:"KUMA_USE_HOSTNAME_INSTEAD_OF_ID"`
UseLoadBalancer bool `json:"useLoadBalancer,omitempty" envconfig:"KUMA_USE_LOAD_BALANCER"`
CIDR string `json:"kumaCidr,omitempty"`
DefaultClusterStartupRetries int `json:"defaultClusterStartupRetries,omitempty" envconfig:"KUMA_DEFAULT_RETRIES"`
DefaultClusterStartupTimeout time.Duration `json:"defaultClusterStartupTimeout,omitempty" envconfig:"KUMA_DEFAULT_TIMEOUT"`
KumactlBin string `json:"kumactlBin,omitempty" envconfig:"KUMACTLBIN"`
ZoneEgressApp string `json:"zoneEgressApp,omitempty" envconfig:"KUMA_ZONE_EGRESS_APP"`
ZoneIngressApp string `json:"zoneIngressApp,omitempty" envconfig:"KUMA_ZONE_INGRESS_APP"`
Arch string `json:"arch,omitempty" envconfig:"ARCH"`
OS string `json:"os,omitempty" envconfig:"OS"`
KumaCpConfig KumaCpConfig `json:"kumaCpConfig,omitempty" envconfig:"KUMA_CP_CONFIG"`
UniversalE2ELogsPath string `json:"universalE2ELogsPath,omitempty" envconfig:"UNIVERSAL_E2E_LOGS_PATH"`
CleanupLogsOnSuccess bool `json:"cleanupLogsOnSuccess,omitempty" envconfig:"CLEANUP_LOGS_ON_SUCCESS"`
KumaLegacyKDS bool `json:"kumaLegacyKDS,omitempty" envconfig:"KUMA_LEGACY_KDS"`
VersionsYamlPath string `json:"versionsYamlPath,omitempty" envconfig:"VERSIONS_YAML_PATH"`
KumaExperimentalSidecarContainers bool `json:"kumaSidecarContainers,omitempty" envconfig:"KUMA_EXPERIMENTAL_SIDECAR_CONTAINERS"`

SuiteConfig SuiteConfig `json:"suites,omitempty"`
}
Expand Down Expand Up @@ -262,6 +263,7 @@ var defaultConf = E2eConfig{
UniversalE2ELogsPath: path.Join(os.TempDir(), "e2e"),
CleanupLogsOnSuccess: false,
KumaLegacyKDS: false,
KumaExperimentalSidecarContainers: false,
}

func init() {
Expand Down
19 changes: 12 additions & 7 deletions test/framework/envs/kubernetes/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ func SetupAndGetState() []byte {
framework.GatewayAPICRDs,
)).To(Succeed())

kumaOptions := append([]framework.KumaDeploymentOption{
framework.WithCtlOpts(map[string]string{
"--experimental-gatewayapi": "true",
}),
framework.WithEgress(),
},
framework.KumaDeploymentOptionsFromConfig(framework.Config.KumaCpConfig.Standalone.Kubernetes)...)
kumaOptions := append(
[]framework.KumaDeploymentOption{
framework.WithCtlOpts(map[string]string{
"--experimental-gatewayapi": "true",
}),
framework.WithEgress(),
},
framework.KumaDeploymentOptionsFromConfig(framework.Config.KumaCpConfig.Standalone.Kubernetes)...,
)
if framework.Config.KumaExperimentalSidecarContainers {
kumaOptions = append(kumaOptions, framework.WithEnv("KUMA_EXPERIMENTAL_SIDECAR_CONTAINERS", "true"))
}

Eventually(func() error {
return Cluster.Install(framework.Kuma(core.Zone, kumaOptions...))
Expand Down

0 comments on commit e04a2b9

Please sign in to comment.