You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/05/06 04:12:24 UTC

[GitHub] [apisix-docker] imjoey commented on issue #167: How to migrate data?

imjoey commented on issue #167:
URL: https://github.com/apache/apisix-docker/issues/167#issuecomment-833210209


   > > > > > @izayoi-akira please add some details about your snapshot operations. Indeed this is a right way
   > > > > 
   > > > > 
   > > > > @tokers how about we introduce the `Terraform` which is for declarative configurations management. Thus we can export all the existing resources into several `.tf` files that represent the declarative resources. Also, we can import it via uploading files onto Dashboard or just run `terraform apply`. This will give us full-fledged functionality for user data import/export.
   > > > > Looking forward to your feedback.
   > > > 
   > > > 
   > > > Frankly, I'm not sure, as Terraform just likes a tool used on Cloud. Is it also can be used in bare-metal or containers deployed on-premise?
   > > 
   > > 
   > > @tokers
   > > yep, the most commonly used scenarios of Terraform are for cloud provisioning. While as a matter of fact, Terraform is a great tool that can handle all the cases as long as Declarative Configuration is needed. For example, we can also find the Github/Gitlab providers for the repository/branch/privilege/user management here [[1](https://registry.terraform.io/browse/providers)].
   > > With regards to APISIX, a minimum feasible Terraform `.tf` configurations may seems like this:
   > > ```terraform
   > > provider "apisix" {
   > >   # Assume we use Admin API here
   > >   url      = "https://your-apisix-server-addr:9080/"
   > >   access_user = "admin"
   > >   access_key = "the-access-key-for-admin-api"
   > > }
   > > 
   > > resource "apisix_route" "route_1" {
   > >   name = "r1"
   > >   desc = "for buzi1"
   > >   uri = "/foo/bar"
   > >   host = "foo.com"
   > >   methods = ["GET", "HOST"]
   > >   status = 1
   > >   labels = {
   > >     "k1": "v1",
   > >     "k2": "v2"
   > >   }
   > >   upstream_id = ${apisix_upstream.upstream_1.id}
   > > }
   > > 
   > > resource "apisix_upstream" "upstream_1" {
   > >   name = "u1"
   > >   type = "chash"
   > >   key = "remote_addr"
   > >   nodes = {
   > >         "127.0.0.1:80": 1,
   > >         "foo.com:80": 2
   > >     }
   > > }
   > > ```
   > > 
   > > 
   > > This would bring us the reproducible APISIX resource definitions. For backup/restore, we need to support export these definitions as the format of Terraform templates stored in `.tf` files.
   > > Please let me know what do you think. Maybe we all need much more discussion. Thanks.
   > 
   > Sounds cool, would you like to send a proposal to the mailing list, and let's talk with more and more friends in community.
   
   @tokers Really sorry for my late reply. I will send the proposal to mailing list for further disuccsions. Thanks for the guidance.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org