Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help request: Apisix3 decoupled mode does not automatically refresh CP data without DP #9582

Closed
XW512 opened this issue May 31, 2023 · 14 comments · Fixed by #10012
Closed

help request: Apisix3 decoupled mode does not automatically refresh CP data without DP #9582

XW512 opened this issue May 31, 2023 · 14 comments · Fixed by #10012
Labels
bug Something isn't working

Comments

@XW512
Copy link

XW512 commented May 31, 2023

Description

I have set up the decoupled mode of Apisix3, but found that the DP node will not automatically refresh the modified data of the CP node. If I restart the DP node and the data can be synchronized to the DP node, is there a problem with my configuration

the DP config

apisix:
ssl:
ssl_trusted_certificate: /app/apisix-3.3.0/conf/cert/mtls_ca.crt
deployment:
role: data_plane
role_data_plane:
config_provider: control_plane
control_plane:
host:
- "https://gw-cp.intsit.local:9280"
timeout: 5
prefix: "/apisix"
admin:
admin_key:
- name: admin
key: 7b0d04aef23327824710da9ce10c55f0 # using fixed API token has security risk, please update it when you deploy to production environment
role: admin

this CP config

deployment:
role: control_plane
role_control_plane:
config_provider: etcd
conf_server:
listen: 0.0.0.0:9280
cert: /app/apisix-3.3.0/conf/cert/mtls_server.crt
cert_key: /app/apisix-3.3.0/conf/cert/mtls_server.key
admin:
admin_key:
- name: admin
key: 7b0d04aef23327824710da9ce10c55f0 # using fixed API token has security risk, please update it when you deploy to production environment
role: admin

Environment

  • APISIX version (run apisix version): 3.3.0
  • Operating system (run uname -a): centos8
  • OpenResty / Nginx version (run openresty -V or nginx -V): 1.19.9.1
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.5.9
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version): 3.8.0
@lingsamuel lingsamuel added the bug Something isn't working label Jun 20, 2023
@XW512
Copy link
Author

XW512 commented Jul 17, 2023

I want to ask, is this definitely a bug? If it's a bug, why hasn't anyone else encountered it,Or is there a problem with my configuration?

@shreemaan-abhishek
Copy link
Contributor

@XW512 please provide the whole config.yaml file with proper formatting thanks so that I can try to reproduce it, thanks.

@XW512
Copy link
Author

XW512 commented Jul 21, 2023

@XW512 please provide the whole config.yaml file with proper formatting thanks so that I can try to reproduce it, thanks.

OK,thank you

this is data_plane config:

apisix:
ssl:
ssl_trusted_certificate: /app/apisix-3.3.0/t/certs/mtls_ca.crt
deployment:
role: data_plane
role_data_plane:
config_provider: control_plane
control_plane:
host:
- "https://gw-cp.intsit.cloud.local:9280"
timeout: 30
prefix: "/apisix"
admin:
admin_key:
- name: admin
key: 6b0d04aef24327864740da9ce10c55f0
role: admin

this is control_plane config:

deployment:
role: control_plane
role_control_plane:
config_provider: etcd
conf_server:
listen: 0.0.0.0:9280
cert: /app/apisix-3.3.0/t/certs/mtls_server.crt
cert_key: /app/apisix-3.3.0/t/certs/mtls_server.key
admin:
admin_key:
- name: admin
key: 6b0d04aef24327864740da9ce10c55f0
role: admin

producer mtls from https://apisix.apache.org/zh/docs/apisix/tutorials/client-to-apisix-mtls/

@shreemaan-abhishek
Copy link
Contributor

shreemaan-abhishek commented Jul 24, 2023

@XW512, please paste your config.yaml file with proper formatting here. 🤦🏼‍♂️ 🤦🏼‍♂️

@XW512
Copy link
Author

XW512 commented Jul 24, 2023

@XW512, please paste your config.yaml file with proper formatting here. 🤦🏼‍♂️ 🤦🏼‍♂️

OK
this is data_plane config.yaml

apisix:
ssl:
ssl_trusted_certificate: /app/apisix-3.3.0/t/certs/mtls_ca.crt
deployment:
role: data_plane
role_data_plane:
config_provider: control_plane
control_plane:
host:
- "https://gw-cp.intsit.cloud.local:9280"
timeout: 30
prefix: "/apisix"
#certs:
#cert: /app/apisix-3.3.0/conf/cert/mtls_client.crt
#cert_key: /app/apisix-3.3.0/conf/cert/mtls_client.key
admin:
admin_key:
- name: admin
key: 6b0d04aef24327864740da9ce10c55f0
role: admin

this is control_plane config.yaml

deployment:
role: control_plane
role_control_plane:
config_provider: etcd
conf_server:
listen: 0.0.0.0:9280
cert: /app/apisix-3.3.0/t/certs/mtls_server.crt
cert_key: /app/apisix-3.3.0/t/certs/mtls_server.key
admin:
admin_key:
- name: admin
key: 6b0d04aef24327864740da9ce10c55f0
role: admin

producer mtls from https://apisix.apache.org/zh/docs/apisix/tutorials/client-to-apisix-mtls/

@kingluo kingluo mentioned this issue Aug 28, 2023
5 tasks
@kingluo
Copy link
Contributor

kingluo commented Sep 3, 2023

The conf server is removed, so the etcd communication rolls back to what 2.x versions behave like, i.e. no matter CP or DP, connects to etcd directly. Closed by #10012

@kingluo kingluo closed this as completed Sep 3, 2023
@XW512
Copy link
Author

XW512 commented Sep 3, 2023

The conf server is removed, so the etcd communication rolls back to what 2.x versions behave like, i.e. no matter CP or DP, connects to etcd directly. Closed by #10012

thank you,I would like to ask how to configure the Decoupled mode for DP and CP isolation in version 3.5.0. I see that the configuration method after conf server is removed is not described in the document 3.5.0

@kingluo
Copy link
Contributor

kingluo commented Sep 3, 2023

The conf server is removed, so the etcd communication rolls back to what 2.x versions behave like, i.e. no matter CP or DP, connects to etcd directly. Closed by #10012

thank you,I would like to ask how to configure the Decoupled mode for DP and CP isolation in version 3.5.0. I see that the configuration method after conf server is removed is not described in the document 3.5.0

No, we have changed the doc:

As well as the conf:

deployment: # Deployment configurations
role: traditional # Set deployment mode: traditional, control_plane, or data_plane.
role_traditional:
config_provider: etcd # Set the configuration center.
#role_data_plane: # Set data plane details if role is data_plane.
# config_provider: etcd # Set the configuration center: etcd, xds, or yaml.
#role_control_plane: # Set control plane details if role is control_plane.
# config_provider: etcd # Set the configuration center.

The configuration of etcd, no matter which deployment mode, is configured just like 2.x version, except the role field.

@XW512
Copy link
Author

XW512 commented Sep 8, 2023

The conf server is removed, so the etcd communication rolls back to what 2.x versions behave like, i.e. no matter CP or DP, connects to etcd directly. Closed by #10012

thank you,I would like to ask how to configure the Decoupled mode for DP and CP isolation in version 3.5.0. I see that the configuration method after conf server is removed is not described in the document 3.5.0

No, we have changed the doc:

As well as the conf:

deployment: # Deployment configurations
role: traditional # Set deployment mode: traditional, control_plane, or data_plane.
role_traditional:
config_provider: etcd # Set the configuration center.
#role_data_plane: # Set data plane details if role is data_plane.
# config_provider: etcd # Set the configuration center: etcd, xds, or yaml.
#role_control_plane: # Set control plane details if role is control_plane.
# config_provider: etcd # Set the configuration center.

The configuration of etcd, no matter which deployment mode, is configured just like 2.x version, except the role field.

thank you, I tried using the method you mentioned above and found that DP can get up, while CP cannot. The error is as follows:
invalid deployment control_plane configuration: property "role_control_plane" validation failed: property "conf_server" is required

The configuration information of my CP is as follows:

deployment:
role: control_plane
role_control_plane:
config_provider: etcd

I added information and found that it is necessary to configure the path related to the certificate, otherwise an error will be reported

deployment:
role: control_plane
role_control_plane:
config_provider: etcd
conf_server:
listen: 0.0.0.0:9280
cert: /path/to/server.crt
cert_key: /path/to/server.key
client_ca_cert: /path/to/ca.crt

@XW512
Copy link
Author

XW512 commented Sep 8, 2023

Is this modification not in version 3.5.0, but in the master branch?When is the next release expected to be released

@kingluo
Copy link
Contributor

kingluo commented Sep 8, 2023

Is this modification not in version 3.5.0, but in the master branch?When is the next release expected to be released

Yes, it's only on the master branch. It'll be available in 3.6 or backport to 3.5 if necessary.

@XW512
Copy link
Author

XW512 commented Sep 8, 2023

Is this modification not in version 3.5.0, but in the master branch?When is the next release expected to be released

Yes, it's only on the master branch. It'll be available in 3.6 or backport to 3.5 if necessary.

I would like to try this new mode now. Could you please create a release version first? Thank you very much

@kingluo
Copy link
Contributor

kingluo commented Sep 8, 2023

You could try it from source code, but yes, it's a bit tough job.
So maybe you could use the release or dev version of the docker image:
https://hub.docker.com/r/apache/apisix/tags
Here is an example:
https://gist.github.com/kingluo/addf27f7dce5f9133043e8f1e5ab3a6a

@XW512
Copy link
Author

XW512 commented Sep 8, 2023

You could try it from source code, but yes, it's a bit tough job. So maybe you could use the release or dev version of the docker image: https://hub.docker.com/r/apache/apisix/tags Here is an example: https://gist.github.com/kingluo/addf27f7dce5f9133043e8f1e5ab3a6a

Thank you very much. I will give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants