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

feat: limit-count plugin with redis cluster support tls/ssl #8558

Merged
merged 15 commits into from
Jan 3, 2023

Conversation

ronething
Copy link
Contributor

Description

Fixes #8413

i deploy a new redis-cluster enable tls with docker-compose, and add connect_opts to redis-cluster config.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

}
--- error_code: 400
--- error_log
Expected comma or object end but found T_STRING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message seems from a JSON parsing error, is it expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i send a error type(string) cause check schema err.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check schema err isn't like this. Please check if the provided data is valid JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.




=== TEST 14: enable degradation switch for TEST 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect title

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.




=== TEST 17: up the limit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need TEST 16 as we have TEST 17?

Copy link
Contributor Author

@ronething ronething Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had changed it.

@@ -102,3 +102,103 @@ services:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
command: [ "vault", "server", "-dev" ]


## RedisCluster Enable TLS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move the redis cluster to https://github.com/apache/apisix/blob/master/ci/pod/docker-compose.plugin.yml, as this dependency is only used in the plugin test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

- ./t/certs:/certs
environment:
- 'ALLOW_EMPTY_PASSWORD=yes'
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we reduce the number of redis nodes used in the CI?

Copy link
Contributor Author

@ronething ronething Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. for a redis cluster, it may need at least 3 master nodes, so i reduce to 3 nodes.

- 'ALLOW_EMPTY_PASSWORD=yes'
- 'REDIS_NODES=redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5'
- 'REDIS_TLS_ENABLED=yes'
- 'REDIS_TLS_CERT_FILE=/certs/redis.crt'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use the existing certificate under ./t/certs so there is no need to manage new certs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. i use t/certs/mtls_ca.crt instead.

- '7000:6379'

## RedisCluster Enable TLS
redis-node-0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two redis-node-0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, i will remove it.

}
--- error_code: 400
--- error_log
Expected comma or object end but found T_STRING
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check schema err isn't like this. Please check if the provided data is valid JSON.

@tao12345666333
Copy link
Member

Will this be backported to 2.X?
cc @spacewander @ronething

@spacewander
Copy link
Member

@tao12345666333
Normally we don't backport features to LTS version. Has this been fully discussed in the mail list?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: As a user I want to use limit-count plugin with redis-cluster that support tls/ssl.
5 participants