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

tanzu services class-claims get postgresql-1 reports: resource not ready and claims fails #34

Open
cmoulliard opened this issue Apr 20, 2023 · 0 comments

Comments

@cmoulliard
Copy link
Contributor

cmoulliard commented Apr 20, 2023

Issue

When we try to claim a service tanzu service class-claim create postgresql-1 --class postgresql-unmanaged -n demo3 as documented here: https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/services-toolkit-tutorials-working-with-bitnami-services.html then the message reported by tanzu services class-claims get postgresql-1 --namespace demo3 is always resource not ready and claims fails.

This problem is related to a RBAC issue for the user system:serviceaccount:crossplane-system:crossplane :

resource: objects.kubernetes.crossplane.io is forbidden: User "system:serviceaccount:crossplane-system:crossplane" cannot create resource "objects" in API group "kubernetes.crossplane.io" at the cluster scope
  Warning  ComposeResources         22m (x4 over 22m)    defined/compositeresourcedefinition.apiextensions.crossplane.io  composed resource "1": cannot use dry-run create to name composed resource: releases.helm.crossplane.io is forbidden: User "system:serviceaccount:crossplane-system:crossplane" cannot create resource "releases" in API group "helm.crossplane.io" at the cluster scope

This error is reported within the resource:

API Version:  bitnami.database.tanzu.vmware.com/v1alpha1
Kind:         XPostgreSQLInstance

The root cause is related to the fact that the providers are not installed properly as their RBAC are not listed here:

k get clusterrole -l rbac.crossplane.io/aggregate-to-crossplane="true"
NAME                                                                                                  CREATED AT
crossplane:composite:xmysqlinstances.bitnami.database.tanzu.vmware.com:aggregate-to-crossplane        2023-04-19T14:37:53Z
crossplane:composite:xpostgresqlinstances.bitnami.database.tanzu.vmware.com:aggregate-to-crossplane   2023-04-19T14:37:55Z
crossplane:composite:xrabbitmqclusters.bitnami.messaging.tanzu.vmware.com:aggregate-to-crossplane     2023-04-19T14:37:55Z
crossplane:composite:xredisclusters.bitnami.caching.tanzu.vmware.com:aggregate-to-crossplane          2023-04-19T14:37:53Z
crossplane:system:aggregate-to-crossplane                                                             2023-04-19T14:36:24Z

We should see:

k get clusterrole -l rbac.crossplane.io/aggregate-to-crossplane="true"
NAME                                                                                     CREATED AT
crossplane:composite:xmysqlinstances.database.example.org:aggregate-to-crossplane        2023-03-10T21:08:00Z
crossplane:composite:xpostgresqlinstances.database.example.org:aggregate-to-crossplane   2023-03-10T21:08:00Z
crossplane:composite:xrabbitmqclusters.messaging.example.org:aggregate-to-crossplane     2023-04-13T14:25:55Z
crossplane:composite:xredisclusters.caching.example.org:aggregate-to-crossplane          2023-03-10T21:08:00Z
crossplane:provider:provider-aws-2df294a101af:aggregate-to-edit                          2023-04-04T19:40:25Z
crossplane:provider:provider-helm-e19bbae44e06:aggregate-to-edit                         2023-03-10T21:04:00Z
crossplane:provider:provider-kubernetes-9a70983f5805:aggregate-to-edit                   2023-03-10T21:04:00Z
crossplane:system:aggregate-to-crossplane

When we check the status of one of the provider, we found the root cause

k describe provider/provider-helm
Name:         provider-helm
Namespace:
Labels:       kapp.k14s.io/app=1681914983065673828
              kapp.k14s.io/association=v1.86fd531cb819e568414d740a989a09c1
Annotations:  kapp.k14s.io/identity: v1;/pkg.crossplane.io/Provider/provider-helm;pkg.crossplane.io/v1
              kapp.k14s.io/original:
                {"apiVersion":"pkg.crossplane.io/v1","kind":"Provider","metadata":{"annotations":{"kbld.k14s.io/images":"- origins:\n  - preresolved:\n   ...
              kapp.k14s.io/original-diff-md5: 691da2670b73a94447a7f58f4e9e59d1
              kbld.k14s.io/images:
                - origins:
                  - preresolved:
                      url: kind-registry:5000/tap/tap-packages@sha256:a3a14b07b79a8983257d1a2cc0449a4806753868178055554cfa38de7b649467
                  url: kind-registry:5000/tap/tap-packages@sha256:a3a14b07b79a8983257d1a2cc0449a4806753868178055554cfa38de7b649467
API Version:  pkg.crossplane.io/v1
Kind:         Provider
Metadata:
  Creation Timestamp:  2023-04-19T14:36:26Z
  Generation:          1
  Resource Version:    3927
  UID:                 31307545-cb35-4fe5-8730-e329422d285b
Spec:
  Controller Config Ref:
    Name:                         provider-helm
  Ignore Crossplane Constraints:  false
  Package:                        kind-registry:5000/tap/tap-packages:provider-helm@sha256:a3a14b07b79a8983257d1a2cc0449a4806753868178055554cfa38de7b649467
  Package Pull Policy:            IfNotPresent
  Package Pull Secrets:
    Name:                      registry-creds
  Revision Activation Policy:  Automatic
  Revision History Limit:      1
  Skip Dependency Resolution:  false
Events:
  Type     Reason         Age                   From                                 Message
  ----     ------         ----                  ----                                 -------
  Warning  UnpackPackage  2m6s (x894 over 14h)  packages/provider.pkg.crossplane.io  cannot unpack package: failed to fetch package digest from remote: failed to fetch package descriptor with a GET request after a previous HEAD request failure: Get "https://kind-registry:5000/v2/": x509: certificate signed by unknown authority: Get "https://kind-registry:5000/v2/": x509: certificate signed by unknown authority

Question: Can the crossplane package use the shared -> ca_cert_data certificate : https://docs.vmware.com/en/VMware-Tanzu-Application-Platform/1.5/tap/install.html#full-profile-3?

How To reproduce

cmoulliard added a commit that referenced this issue Apr 20, 2023
…registry certificate file

Signed-off-by: Charles Moulliard <[email protected]>
cmoulliard added a commit that referenced this issue Apr 20, 2023
* Work in progress. Bumped the version of the client, cluster essentials

Signed-off-by: Charles Moulliard <[email protected]>

* Add missing version to the tanzu-application-platform tar file to be extracted

Signed-off-by: Charles Moulliard <[email protected]>

* Fixing the wrong version of the folder where the cli is stored within the extracted file

Signed-off-by: Charles Moulliard <[email protected]>

* Bump the version of the package links from 1.3 to 1.5

Signed-off-by: Charles Moulliard <[email protected]>

* Remove the hard coded container registry to use the parameters

Signed-off-by: Charles Moulliard <[email protected]>

* Updated the profile to full like the parameters

Signed-off-by: Charles Moulliard <[email protected]>

* Do not try to create the namespace if it already exists

Signed-off-by: Charles Moulliard <[email protected]>

* Use rollout status

Signed-off-by: Charles Moulliard <[email protected]>

* Fixing ytt One or more data values were invalid

Signed-off-by: Charles Moulliard <[email protected]>

* Add step to create the kapp controller ca secret for local registry. To be reviewed

Signed-off-by: Charles Moulliard <[email protected]>

* Don't stop if namespace already exists

Signed-off-by: Charles Moulliard <[email protected]>

* Add the 3 new components proposed: Crossplan, Spring Cloud Gateway and Bitnami service to the home page

Signed-off-by: Charles Moulliard <[email protected]>

* Changed the link to point to the list of the packages documentation page

Signed-off-by: Charles Moulliard <[email protected]>

* Define a new property to tell if we use a local container registry

Signed-off-by: Charles Moulliard <[email protected]>

* Aligned the config according to tap 1.5 documentation

Signed-off-by: Charles Moulliard <[email protected]>

* Use the variable instead of the hard coded registry name

Signed-off-by: Charles Moulliard <[email protected]>

* Add pause command after the repository has been added. Move the step to crate the registry credentials later. Add todo to see if we will support the option to install all the builder images

Signed-off-by: Charles Moulliard <[email protected]>

* Fixing wrong reg_server name to copy the images

Signed-off-by: Charles Moulliard <[email protected]>

* Use tanzu registry instead of local registry within echo message

Signed-off-by: Charles Moulliard <[email protected]>

* Remove kp_default_repository_secret to avoid to patch the secretExport previously created

Signed-off-by: Charles Moulliard <[email protected]>

* Creating a new secret to try to fix issue. #33

Signed-off-by: Charles Moulliard <[email protected]>

* Creating the missing demo namespace needed for grype

Signed-off-by: Charles Moulliard <[email protected]>

* Adding missing double quotes for gitops config

Signed-off-by: Charles Moulliard <[email protected]>

* Delete the secret kapp-controller-config if it has already been created

Signed-off-by: Charles Moulliard <[email protected]>

* Include a case section and moved the step to install the kube dashboard to a function

Signed-off-by: Charles Moulliard <[email protected]>

* Create a funciton to list the packages

Signed-off-by: Charles Moulliard <[email protected]>

* Refactor the project to use functions

Signed-off-by: Charles Moulliard <[email protected]>

* Adding the missing fmt function

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the option to pass to each function parameters

Signed-off-by: Charles Moulliard <[email protected]>

* Commented the lines to set the KUBECONFIG as they clonflicts with functions

Signed-off-by: Charles Moulliard <[email protected]>

* Add the name of the function

Signed-off-by: Charles Moulliard <[email protected]>

* Fix wrong dashboard version

Signed-off-by: Charles Moulliard <[email protected]>

* Creating first the k8s dashboard ns

Signed-off-by: Charles Moulliard <[email protected]>

* Deleting the ValidatingWebhookConfiguration ingress-nginx-admission to avoid the error: failed calling webhook "validate.nginx.ingress.kubernetes.io"

Signed-off-by: Charles Moulliard <[email protected]>

* Suppress error messag whn packages are installed

Signed-off-by: Charles Moulliard <[email protected]>

* Improved the usage help

Signed-off-by: Charles Moulliard <[email protected]>

* Add mising functions to check/detect os

Signed-off-by: Charles Moulliard <[email protected]>

* Use || true instead of >dev/nul

Signed-off-by: Charles Moulliard <[email protected]>

* Moving the code to install clustr essentials to a separate function

Signed-off-by: Charles Moulliard <[email protected]>

* Fix wrong value passed to --wait-check-interval. 10 -> 10s

Signed-off-by: Charles Moulliard <[email protected]>

* Add missing clusterEssentials to the case

Signed-off-by: Charles Moulliard <[email protected]>

* Saving the configfile within the tanzu temp dir

Signed-off-by: Charles Moulliard <[email protected]>

* Add missing function createConfigFile

Signed-off-by: Charles Moulliard <[email protected]>

* Fix error and add the lissing prefix to create the tap config file

Signed-off-by: Charles Moulliard <[email protected]>

* Add the missing function to the usage: deployKubernetesDashboard

Signed-off-by: Charles Moulliard <[email protected]>

* Align the help descriptions

Signed-off-by: Charles Moulliard <[email protected]>

* Continue if kubctl delete fail for ValidatingWebhookConfiguration ingress-nginx-admission

Signed-off-by: Charles Moulliard <[email protected]>

* Moving the code to populte a user namespace to install.sh

Signed-off-by: Charles Moulliard <[email protected]>

* Specify that we can pass a parameter

Signed-off-by: Charles Moulliard <[email protected]>

* Patchinbg the serviceacount

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the SA as it is by default created

Signed-off-by: Charles Moulliard <[email protected]>

* Created workload, catalog and tiltfil to play with Spring Petclinic demo

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the bash script as we do not need anymore as the command: tanzu package installed list -A proper shows th packages installed and their information

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the script to install the container registry as a pod as the kind script using secured registry is working fine

Signed-off-by: Charles Moulliard <[email protected]>

* Deleting some scripts that we don't use/need anymore

Signed-off-by: Charles Moulliard <[email protected]>

* Reviewed the list of the packages, addd the new as crossplane, bitnami, etc and updated the links

Signed-off-by: Charles Moulliard <[email protected]>

* Add a new parameter to install or not the Tanzu tools: CLI and pivnet

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the uninstall.sh script as we will recreate a kind cluster to do another test

Signed-off-by: Charles Moulliard <[email protected]>

* Reorg th different bash scripts

Signed-off-by: Charles Moulliard <[email protected]>

* Created an install option to execute the different functions

Signed-off-by: Charles Moulliard <[email protected]>

* Create an init function

Signed-off-by: Charles Moulliard <[email protected]>

* Add a description to introduce the script

Signed-off-by: Charles Moulliard <[email protected]>

* Reviewing instructions. Adding remove function. Use latest kind bash script

Signed-off-by: Charles Moulliard <[email protected]>

* Renaming tap.sh to install.sh

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the command deleteing the admission webhook as it is not needed anymore

Signed-off-by: Charles Moulliard <[email protected]>

* Renaming the namespace from demo- to demo. Started to replay the demo

Signed-off-by: Charles Moulliard <[email protected]>

* Review how to configure the kubectl krew aliases using .bashrc.d folder

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the non needed files

Signed-off-by: Charles Moulliard <[email protected]>

* Fixing wrong path to source /Users/cmoullia/.bashrc

Signed-off-by: Charles Moulliard <[email protected]>

* Add a log message to tell to the user that they must source the .bashrc file and log the aliases created

Signed-off-by: Charles Moulliard <[email protected]>

* Adding the missing double quotes

Signed-off-by: Charles Moulliard <[email protected]>

* Removing simple quote non needed

Signed-off-by: Charles Moulliard <[email protected]>

* Add a new alias krew = kubctl krew

Signed-off-by: Charles Moulliard <[email protected]>

* Adding new tools: kind and kubectl

Signed-off-by: Charles Moulliard <[email protected]>

* Fix wrong indentation

Signed-off-by: Charles Moulliard <[email protected]>

* Add missing quote

Signed-off-by: Charles Moulliard <[email protected]>

* curl in silence

Signed-off-by: Charles Moulliard <[email protected]>

* Be more verbose when kubectl and kind are installed

Signed-off-by: Charles Moulliard <[email protected]>

* Moving the code to the proper place

Signed-off-by: Charles Moulliard <[email protected]>

* Adding the registryCaBundleConfig's parameter to crossplane to import the registry private CA registry

Signed-off-by: Charles Moulliard <[email protected]>

* Removing non needed bash script

Signed-off-by: Charles Moulliard <[email protected]>

* Adding the hack to resolve the issue #34 and create a CM to load the registry certificate file

Signed-off-by: Charles Moulliard <[email protected]>

* Removing the non needed ./

Signed-off-by: Charles Moulliard <[email protected]>

* Reviewing the claiming demo3 scenario

Signed-off-by: Charles Moulliard <[email protected]>

---------

Signed-off-by: Charles Moulliard <[email protected]>
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

No branches or pull requests

1 participant