4FunAndProfit opened a new issue, #11506:
URL: https://github.com/apache/apisix/issues/11506

   ### Current Behavior
   
   When using the new functionality of ENV secret with SSL certs i got this 
error: 
   ```
   2024/08/18 09:42:38 [error] 63#63: *210 [lua] config_etcd.lua:671: 
sync_data(): failed to check item data of [/apisix/ssls] err:property "key" 
validation failed: value should match only one schema, but matches none ,val: 
{"id":"992b4bc6","key":"LkcQBHyyp7FwZX5ZIGRWQJPejeKnsqrMKVAm5S4Ya6U=","labels":{"managed-by":"apisix-ingress-controller","meta_secret_name":"apisix-tls","meta_secret_namespace":"apisix-bastion-dev"},"snis":["YOURHOST"],"cert":"$env://APISIX_CRT","status":1},
 context: ngx.timer
   ```
   
   My code is very simple: 
   1- Create K8S secret: 
   resource "kubernetes_secret" "apisix_tls" {
     metadata {
       name      = "apisix-tls"
       namespace = var.apisix_namespace
     }
     data = {
       cert = "$env://APISIX_CRT"
       key = "$env://APISIX_KEY"
     }
     type = "Opaque"
   }
   
   2- Reference it in apisixtls
   resource "kubernetes_manifest" "sample_tls" {
     depends_on = [kubernetes_secret.apisix_tls]
     manifest = {
       "apiVersion" = "apisix.apache.org/v2"
       "kind"       = "ApisixTls"
       "metadata" = {
         "name" = "sample-tls"
         namespace = var.apisix_namespace
       }
       "spec" = {
         "hosts" = ["YOURHOST"] 
         "secret" = {
           "name"      = kubernetes_secret.apisix_tls.metadata[0].name
           "namespace" = kubernetes_secret.apisix_tls.metadata[0].namespace
         }
       }
     }
   }
   
   
   I think it is related with the encrypted fields for key ssl cert value...
   
   ### Expected Behavior
   
   Should work with key value in cert (it is the goal of the secret env i think 
haha)
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   See behavior
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.10.0
   - Operating system (run `uname -a`):  x86_64 GNU/Linux
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.25.3.2
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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