I did add 127.0.0.1 erp.cluster.local into /etc/hosts before
I follow https://kubernetes.github.io/ingress-nginx/troubleshooting/#using-gdb-with-nginx to debug the api request via Ingress. I can confirm that the request went to the desired service.
My other attemps:
exec in to the erpnext-python container to run bench new-site erp.cluster.local
Attempt 1 to connect to mariadb-erpnext.erpnext.svc.cluster.local:3306
Attempt 1 to connect to frappe-bench-1-erpnext-redis-queue:12000
Attempt 1 to connect to frappe-bench-1-erpnext-redis-cache:13000
Attempt 1 to connect to frappe-bench-1-erpnext-redis-socketio:11000
Connections OK
Created user _aac081bc588a7088
Created database _aac081bc588a7088
Granted privileges to user _aac081bc588a7088 and database _aac081bc588a7088
For key character_set_server. Expected value utf8mb4, found value utf8
For key collation_server. Expected value utf8mb4_unicode_ci, found value utf8_general_ci
================================================================================
Creation of your site - erp.cluster.local failed because MariaDB is not properly
configured. If using version 10.2.x or earlier, make sure you use the
the Barracuda storage engine.
Please verify the settings above in MariaDB's my.cnf. Restart MariaDB. And
then run `bench new-site erp.cluster.local` again.
================================================================================
Database settings do not match expected values; stopping database setup.