spacewander commented on code in PR #8699:
URL: https://github.com/apache/apisix/pull/8699#discussion_r1089649133


##########
.github/workflows/kubernetes-ci.yml:
##########
@@ -68,6 +68,20 @@ jobs:
           echo 'KUBERNETES_CLIENT_TOKEN='"${KUBERNETES_CLIENT_TOKEN_CONTENT}"
           echo 'KUBERNETES_CLIENT_TOKEN_FILE='${KUBERNETES_CLIENT_TOKEN_FILE}
 
+          openssl genrsa -out ./t/certs/k8s_mtls.key 4096

Review Comment:
   Could we reuse the certs under t/certs?



##########
.github/workflows/kubernetes-ci.yml:
##########
@@ -68,6 +68,20 @@ jobs:
           echo 'KUBERNETES_CLIENT_TOKEN='"${KUBERNETES_CLIENT_TOKEN_CONTENT}"
           echo 'KUBERNETES_CLIENT_TOKEN_FILE='${KUBERNETES_CLIENT_TOKEN_FILE}
 
+          openssl genrsa -out ./t/certs/k8s_mtls.key 4096
+
+          openssl req -new -key ./t/certs/k8s_mtls.key -config 
./t/certs/k8s_mtls_csr.conf -out ./t/certs/k8s_mtls.csr -nodes
+
+          export BASE64_CSR=$(cat ./t/certs/k8s_mtls.csr | base64 | tr -d '\n')
+
+          envsubst < ./t/certs/k8s_mtls_csr.yaml | kubectl apply -f -

Review Comment:
   It would be better to set up a mtls proxy in the CI. Pros:
   1. don't need to touch current k8s config
   2. don't need to add cert config in non-mtls test
   3. we can cover non-mtls path in the test
   4. we can test different cert without duplicate k8s env



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to