Skip to content

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

Merged
spacewander merged 15 commits into
apache:masterfrom
ronething:feat/redis_cluster_support_tls
Jan 3, 2023
Merged

feat: limit-count plugin with redis cluster support tls/ssl#8558
spacewander merged 15 commits into
apache:masterfrom
ronething:feat/redis_cluster_support_tls

Conversation

@ronething

Copy link
Copy Markdown
Member

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)

Comment thread t/plugin/limit-count-redis-cluster.t Outdated
}
--- error_code: 400
--- error_log
Expected comma or object end but found T_STRING

Copy link
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread t/plugin/limit-count-redis-cluster.t Outdated



=== TEST 14: enable degradation switch for TEST 5

Copy link
Copy Markdown
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
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread t/plugin/limit-count-redis-cluster.t Outdated



=== TEST 17: up the limit

Copy link
Copy Markdown
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?

@ronething ronething Dec 23, 2022

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

had changed it.

Comment thread ci/pod/docker-compose.common.yml Outdated
command: [ "vault", "server", "-dev" ]


## RedisCluster Enable TLS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done.

Comment thread ci/pod/docker-compose.common.yml Outdated
- ./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
Copy Markdown
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?

@ronething ronething Dec 23, 2022

Copy link
Copy Markdown
Member Author

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.

Comment thread ci/pod/docker-compose.common.yml Outdated
- '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
Copy Markdown
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
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
Member 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.

Comment thread t/plugin/limit-count-redis-cluster.t Outdated
}
--- error_code: 400
--- error_log
Expected comma or object end but found T_STRING

Copy link
Copy Markdown
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.

@spacewander
spacewander merged commit c0c906e into apache:master Jan 3, 2023
@ronething
ronething deleted the feat/redis_cluster_support_tls branch January 6, 2023 09:20
@tao12345666333

Copy link
Copy Markdown
Member

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

@spacewander

Copy link
Copy Markdown
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