Skip to content

Commit

Permalink
Merge pull request #2257 from CrowleyRajapakse/new-main6
Browse files Browse the repository at this point in the history
Fixing agent integration tests
  • Loading branch information
CrowleyRajapakse authored Apr 3, 2024
2 parents 61b48c1 + 53e85e6 commit 95e0e4b
Show file tree
Hide file tree
Showing 42 changed files with 41 additions and 3,635 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/agent-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,20 @@ jobs:
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
shell: sh
run: |
cd apk-repo/test/apim-apk-agent-test/apim-cp-helm-chart
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add jetstack https://charts.jetstack.io
helm dependency build
helm install apim -n apk . --debug --wait --timeout 5m0s \
--set wso2.deployment.image.registry=docker.io \
--set wso2.deployment.image.respository=rakhitharr/wso2am \
--set wso2.deployment.image.digest=sha256:56c6625d60a01cba73cd8836d25f1469f6fec1e933e530d954064eeab4ef70b3
helm repo add wso2apim https://github.com/wso2/helm-apim/releases/download/cp-4.3.0-beta
helm repo update
helm install apim wso2apim/wso2am-cp --version 4.3.0-beta -f https://raw.githubusercontent.com/wso2/apk/main/helm-charts/sample/apim/cp/amd-values.yaml -n apk --debug --wait --timeout 5m0s
kubectl get pods -n apk
kubectl get svc -n apk
- name: Helm release deploy APK DP
if: github.event_name == 'pull_request_target' && contains(github.event.label.name, 'trigger-action')
shell: sh
run: |
cd apk-repo/helm-charts
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add jetstack https://charts.jetstack.io
helm dependency build
helm install apk-test-setup -n apk . --debug --wait --timeout 15m0s \
helm install apk -n apk . --debug --wait --timeout 15m0s \
--set wso2.apk.dp.commonController.deployment.controlplane.enabled=true \
--set wso2.apk.dp.commonController.deployment.controlplane.host="apim-apk-agent-service.apk.svc.cluster.local" \
--set wso2.apk.dp.commonController.deployment.controlplane.skipSSLVerification=true \
Expand All @@ -91,7 +87,7 @@ jobs:
helm install apim-apk-agent -n apk . --debug --wait --timeout 2m0s \
--set controlPlane.serviceURL=https://apim-wso2am-cp-1-service.apk.svc.cluster.local:9443/ \
--set controlPlane.eventListeningEndpoints="amqp://admin:[email protected]:5672?retries='10'&connectdelay='30'" \
--set dataPlane.k8ResourceEndpoint=https://apk-test-setup-wso2-apk-config-ds-service.apk.svc.cluster.local:9443/api/configurator/apis/generate-k8s-resources
--set dataPlane.k8ResourceEndpoint=https://apk-wso2-apk-config-ds-service.apk.svc.cluster.local:9443/api/configurator/apis/generate-k8s-resources
kubectl get pods -n apk
kubectl get svc -n apk
- name: Run test cases
Expand All @@ -114,10 +110,8 @@ jobs:
kubectl get tokenissuers -n apk
kubectl get httproutes -n apk
kubectl get pods -l app.kubernetes.io/name=apim-apk-agent | awk '{print $1}' | xargs -I{} kubectl logs {} -n apk
helm uninstall apk-test-setup -n apk
cd ../test/apim-apk-agent-test/apim-cp-helm-chart
helm uninstall apk -n apk
helm uninstall apim -n apk
cd ../agent-helm-chart
helm uninstall apim-apk-agent -n apk
- name: Delete AKS cluster
if: always()
Expand Down
7 changes: 5 additions & 2 deletions test/apim-apk-agent-test/agent-helm-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
apiVersion: v2
name: apim-apk-agent
description: A Helm chart for deploying apim-apk-agent
version: 0.1.0
type: application
version: 1.1.0-beta
appVersion: "1.16.0"
dependencies:
- name: cert-manager
version: "v1.10.1"
repository: "https://charts.jetstack.io"
repository: "https://charts.jetstack.io"
condition: certmanager.enabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: apim-apk-issuer-cert
type: Opaque
data:
wso2.crt: |
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUR1VENDQXFHZ0F3SUJBZ0lVWXlTK2JjenM4R1N3Y3hoUUUyWUJqZEFFakw4d0RRWUpLb1pJaHZjTkFRRUwKQlFBd1pERUxNQWtHQ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UZqQVVCZ2dyQmdFRkJRY0RBUVlJS3dZQkJRVUhBd0l3Q3dZRApWUjBQQkFRREFnVHdNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUJBUURHTDlTU0FjOHplWnBVb2loU2ExVnowZGNXCm5FR1lkdDdkQnB4U3ppcVJWSDVPNjJxVU92ZDhtbGh5M0h4N3B2Wm0yK2pKYjVMeEdKM2MvVzhGM211dDFTdGoKQVNFRXVsOWF4dXhvNWZuelVXazZBV20ycGFobEttZTBiSk8vdUJyY010WlU2TXdCdkU3NkEzZmgra1p6VlREbApMbjJUVG9ySlhydC9JQm5KdVZHT2UzWGxGTlMyMEo3bEtFUmt3UHZEZlhkZ25aSWlUYkcwdzliQUxVSmpROFUyCkFBUDlha2d1N3BMV0w3RzU1c1NWb2JGckJMSkVMZ3FxU1VUVXhBOXVybzYwRjFRMFVhWHBOd2h0MUJ3QTFVUEIKcys1T3ZmVzhnMWhkVmdWdmNmZUZIQk9oSTJOa1RtemRGRldKZTBFeE9Db3liR1dJZkZkYlZtalVZL2JSCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ spec:
containerPort: 18000
- name: rest-port
containerPort: 18001
{{ if and .Values.metrics .Values.metrics.enabled}}
- containerPort: 18006
protocol: "TCP"
{{ end }}
env:
- name: APIM_APK_AGENT_PRIVATE_KEY_PATH
value: /home/wso2/security/keystore/apk-agent.key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ data:
provider = "{{ .Values.controlPlane.provider | default "admin" }}"
environmentLabels = ["{{ .Values.controlPlane.environmentLabels }}"]
skipSSLVerification = {{ .Values.controlPlane.skipSSLVerification }}
internalKeyIssuer = {{ .Values.controlPlane.internalKeyIssuer | default "http://am.wso2.com:443/token" }}
internalKeyIssuer = "{{ .Values.controlPlane.internalKeyIssuer | default "http://am.wso2.com:443/token" }}"
[controlPlane.brokerConnectionParameters]
eventListeningEndpoints = ["{{ .Values.controlPlane.eventListeningEndpoints }}"]
Expand All @@ -35,33 +35,33 @@ data:
# The logging configuration for Adapter
## Adapter root Level configurations
logLevel = "INFO" # LogLevels can be "DEBG", "FATL", "ERRO", "WARN", "INFO", "PANC"
LogFormat = "TEXT" # Values can be "JSON", "TEXT"
[rotation]
MaxSize = 10 # In MegaBytes (MB)
MaxBackups = 3
MaxAge = 2 # In days
Compress = true
## Adapter package Level configurations
[[pkg]]
name = "github.com/wso2/apk/adapter/internal/adapter"
logLevel = "INFO" # LogLevels can be "DEBG", "FATL", "ERRO", "WARN", "INFO", "PANC"
[[pkg]]
name = "github.com/wso2/apk/adapter/internal/oasparser"
logLevel = "INFO"
# The logging configuration for Router
[accessLogs]
enable = false
format = "[%START_TIME%] '%REQ(:METHOD)% %DYNAMIC_METADATA(envoy.filters.http.ext_authz:originalPath)% %REQ(:PATH)% %PROTOCOL%' %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% '%REQ(X-FORWARDED-FOR)%' '%REQ(USER-AGENT)%' '%REQ(X-REQUEST-ID)%' '%REQ(:AUTHORITY)%' '%UPSTREAM_HOST%'\n"
[wireLogs]
enable = false
include = ["Headers", "Body", "Trailers"]
Expand Down
2 changes: 2 additions & 0 deletions test/apim-apk-agent-test/agent-helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ metrics:
enabled: false
agent:
mode: CPtoDP
certmanager:
enabled: true
17 changes: 0 additions & 17 deletions test/apim-apk-agent-test/apim-cp-helm-chart/Chart.yaml

This file was deleted.

Loading

0 comments on commit 95e0e4b

Please sign in to comment.