-
Notifications
You must be signed in to change notification settings - Fork 263
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
Propose - migration Knative resources from one cluster to another by kn plugin #396
Comments
This is what we did for the proposal first:
We can migrate the knSerivce, route and configuration from one namespace of the source cluster to another cluster. But we cannot copy the |
Thanks for this @zhangtbj and @ZhuangYuZY. Please add an entry to the next Knative client working group meeting agenda to perhaps demonstrate this Kn plugin to the community. I created #397 that will raise the related issue of how to discover, install, and manage Kn plugins. So for now just keep your plugin in a public repository for people to try. |
@zhangtbj IIUC, you cannot create Revisions directly by coping existing Revisions from source cluster to target cluster because Revisions are immutable and must be created via a Configuration as described below. I think you can import by applying existing Revision spec to a Revision template in a Configuration each time.
|
Hi @toVersus , Thanks for the quick response. I also think I can link the revision with config, But I didn't find the link in somewhere. For example, I have an example
But I cannot see the revision list or history in the ksvc or configuration configurations. I can only see the
Do you have any idea how to get the revision list or history of one ksvc or config? Thanks a lot! :) |
I think you can get a list of revisions in a ksvc by calling ListRevisions with service name option like below. Did that answer your question? package main
import (
"github.com/knative/client/pkg/kn/commands"
"github.com/knative/client/pkg/serving/v1alpha1"
"log"
)
func main() {
knParams := &commands.KnParams{}
knParams.Initialize()
client, err := knParams.NewClient("default")
if err != nil {
log.Fatalf("Failed to create kn client: %s", err)
}
revisions, err := client.ListRevisions(v1alpha1.WithService("hello"))
if err != nil {
log.Fatalf("Failed to list revisions by service name ('hello'): %s", err)
}
log.Printf("%#v\n", revisions)
} |
Hi @toVersus Thanks for your help! Now I can get all revision list and migrate to the destination cluster. But now in the new cluster, the new knative service only uses the new generated revision. I have tried many methods, I found I don't have a way to ask the ksvc/route or configuration to change to use a special revision. Do you have any idea how to modify it?
For example the |
@zhangtbj and @ZhuangYuZY can we contribute the code to a @sixolet and @evankanderson please chime in if you intended a different location. Thx |
It can now be used to arbitraly tag any release. To publish a release to GitHub though, --version, --publish and --branch must specified (current behavior). Bonus: * rename the BRANCH_RELEASE variable for clarity. * clearly log if release is published to GitHub and if it's being built from a branch.
This issue is stale because it has been open for 90 days with no |
In what area(s)?
Describe the feature:
Describe the feature:
Today is multiple clouds world, customer may work on multiple k8s clusters from multiple cloud providers to run Knative applications, like IBM Cloud, AWS, GCP. Even in one cloud provider, client may also have multiple k8s clusters which running Knative applications. So there is a requirement that customer wants to clone and migrate Knative resources from one cluster and another cluster, instead of re-deploy Knative application multiple times. It will give benefit that keeping Knative configuration and revision consistent in multiple clusters, it will be very important because some traffic control rules depend on revisions. Beside clone and migration, backup and recovery are also the important requirement for Knative users to handle risk of cluster broken, as deploy Knative application again can not recover revision history.
Proposal to do:
Implement plugin "migration" for kn client with 3 sub-commands as below:
The text was updated successfully, but these errors were encountered: