terraform-google-kubernetes-engine
terraform-google-kubernetes-engine copied to clipboard
"controlplanerevisions.mesh.cloud.google.com" not found
TL;DR
When installing from scratch ASM version 21.2.0 I get the following
module.asm-primary.module.cpr.module.gcloud_kubectl.null_resource.run_command[0] (local-exec): Ensuring ControlPlaneRevision exists in cluster... attempt 1
module.asm-primary.module.cpr.module.gcloud_kubectl.null_resource.run_command[0] (local-exec): Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "controlplanerevisions.mesh.cloud.google.com" not found
Expected behavior
I would expect that customresourcedefinitions.apiextensions.k8s.io to be there.
Observed behavior
No response
Terraform Configuration
module "asm-primary" {
source = "terraform-google-modules/kubernetes-engine/google//modules/asm"
version = "21.2.0"
project_id = var.project_id
cluster_name = module.primary-cluster.name
cluster_location = module.primary-cluster.location
}
### Terraform Version
```sh
terraform version
Terraform v1.1.9
Additional information
No response
Also I do have all the prerequisites
Enable the mesh.googleapis.com service Enable the servicemesh feature on the cluster hub Register target cluster to the servicemesh-enabled hub
I guess my question is do I need to update my hub module to the hub-fleet module? As I am using version 20.0.0 and not the same version as ASM module
module "hub-primary" {
source = "terraform-google-modules/kubernetes-engine/google//modules/hub"
version = "20.0.0"
cluster_name = module.primary-cluster.name
cluster_endpoint = module.primary-cluster.endpoint
enable_gke_hub_registration = var.enable_gke_hub_registration
gke_hub_membership_name = "${module.primary-cluster.name}-membership"
hub_project_id = var.project_id
location = module.primary-cluster.location
project_id = var.project_id
labels = "name=value"
sa_private_key = google_service_account_key.hub-sa-key-01.private_key
use_existing_sa = true
}
I downgraded and got version 19.0.0 installed but now i upgrade and I get this error.
module.asm-primary.module.cpr.module.gcloud_kubectl.null_resource.run_command[0] (local-exec): error: resource mapping not found for name: "asm-managed-stable" namespace: "istio-system" from "STDIN": no matches for kind "ControlPlaneRevision" in version "mesh.cloud.google.com/v1beta1"
I am not sure howto upgrade this..
20.0.0 does not use the fleet_id even if configured. So that version is bugged. Getting joined to the fleet is what provided the ControlPlaneRevision resource. I'm getting stuck with it applying/updating the manifest but it never provisions so I'm trying to figure that out. It sounds like there are supposed to be mesh_id labels on the relevant clusters that the new ASM module approach isn't doing, but I'm not sure if that is actually needed or what else might be wrong.
Thanks for the report @richiefrich. What version of kubectl are you using? The module should poll a few times CPR to get created. /cc @Monkeyanator
@bharathkkb it does poll but it never finds it.. when I do attach it manually I get this new error.
module.asm-primary.module.cpr.module.gcloud_kubectl.null_resource.run_command[0] (local-exec): error: resource mapping not found for name: "asm-managed-stable" namespace: "istio-system" from "STDIN": no matches for kind "ControlPlaneRevision" in version "mesh.cloud.google.com/v1beta1"
I am not sure howto update this CRD because I have version controlplanerevisions mesh.cloud.google.com/v1alpha1 true ControlPlaneRevision
so how do I get the "mesh.cloud.google.com/v1beta1"
Thanks everyone!
@bharathkkb What version of kubectl are you using?
Client Version: version.Info{Major:"1", Minor:"21+", GitVersion:"v1.21.9-dispatcher", GitCommit:"2a8027f41d28b788b001389f3091c245cd0a9a60", GitTreeState:"clean", BuildDate:"2022-01-21T20:26:49Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
If the mesh feature is enabled and the cluster is registered to the enabled fleet it should be possible to use v1beta1 or v1alpha1 ControlPlaneRevision resource. Might help debug to post output of kubectl describe crd controlplanerevisions.mesh.cloud.google.com here. Could also dive deeper if you post the membership name and UUID.
@Monkeyanator
I believe this is what you are asking for. membership name: prd-01-membership mesh_id : proj-163808677114
kubectl describe crd controlplanerevisions.mesh.cloud.google.com
Name: controlplanerevisions.mesh.cloud.google.com
Namespace:
Labels: <none>
Annotations: controller-gen.kubebuilder.io/version: (unknown)
API Version: apiextensions.k8s.io/v1
Kind: CustomResourceDefinition
Metadata:
Creation Timestamp: 2022-06-22T17:36:40Z
Generation: 2
Managed Fields:
API Version: apiextensions.k8s.io/v1
Shows a lot of output if you wanted more of it?
Ok well I just tried again, and I was able to install it, so you can close this. Thanks for all the support, If this happens again I will open a new ticket
I just encountered this issue the same error
I have found out if you dont switch to hub to fleet it will not make the CRD
kubectl describe crd controlplanerevisions.mesh.cloud.google.com
Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "controlplanerevisions.mesh.cloud.google.com" not found
After I ran the fleet command the CRD was there.
gcloud container fleet memberships register --gke-cluster=us-central1-a/uat-01 --enable-workload-identity uat-01-membership
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days