ContainerCraft / Kargo3

KubeVirt Hypervisor | Minimum viable self hosted GitOps PaaS
GNU General Public License v3.0
6 stars 1 forks source link

Error: rendered manifests contain a resource that already exists. #4

Closed jbpratt closed 3 years ago

jbpratt commented 3 years ago

Following the guide from https://github.com/ContainerCraft/100DaysOfHomelab/blob/046351075822905b0bf40ee02d9ca45f73822061/doc/KARGO.md , Kargo is failing to install for the reason below:

Error: rendered manifests contain a resource that already exists. Unable to
continue with install: ClusterRole "cdi-operator-cluster" in namespace ""
exists and cannot be imported into the current release: invalid ownership
metadata; label validation error: missing key "app.kubernetes.io/managed-by":
must be set to "Helm"; annotation validation error: missing key
"meta.helm.sh/release-name": must be set to "kargo"; annotation validation
error: missing key "meta.helm.sh/release-namespace": must be set to "kargo"
~ 602ms
❯ export KUBECONFIG=~/.kube/kubespray

~ 1s
❯ helm install hostpath-provisioner ccio/hostpath-provisioner --namespace hostpath-provisioner --create-namespace
NAME: hostpath-provisioner
LAST DEPLOYED: Sat Nov  6 09:51:26 2021
NAMESPACE: hostpath-provisioner
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Hostpath Provisioner uses node filesystem path /var/hpvolumes for pv storage

ABOUT:
  Github:
  - https://github.com/kubevirt/hostpath-provisioner
  - https://github.com/kubevirt/hostpath-provisioner-operator
  Examples:
  - https://github.com/kubevirt/hostpath-provisioner/tree/main/examples

Check status of deployment:
  ~$ kubectl get po -n hostpath-provisioner
  ~$ kubectl get sc

Optional - Set default Storage Class:
  ~$ kubectl patch storageclass hostpath-provisioner -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

❯ kubectl patch storageclass hostpath-provisioner -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'}'class hostpath-provisioner -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-def
storageclass.storage.k8s.io/hostpath-provisioner patched

~
❯
❯ helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true
NAME: cert-managert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true
LAST DEPLOYED: Sat Nov  6 09:52:16 2021rt-manager --namespace cert-manager --create-namespace --set installCRDs=true
NAMESPACE: cert-manager
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
cert-manager v1.6.1 has been deployed successfully!

In order to begin issuing certificates, you will need to set up a ClusterIssuer
or Issuer resource (for example, by creating a 'letsencrypt-staging' issuer).

More information on the different types of issuers and how to configure them
can be found in our documentation:

https://cert-manager.io/docs/configuration/

For information on how to configure cert-manager to automatically provision
Certificates for Ingress resources, take a look at the `ingress-shim`
documentation:

https://cert-manager.io/docs/usage/ingress/

~   helm install cluster-network-addons ccio/cluster-network-addons --namespace cluster-network-addons --create-namespaceelm install cluster-network-addons ccio/cluster-network-addons --namespace cluster-network-addons --create-namespa
NAME: cluster-network-addons
LAST DEPLOYED: Sat Nov  6 09:53:42 2021
NAMESPACE: cluster-network-addons
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Network: Cluster Network Addons github.com/kubevirt/cluster-network-addons-operator

~
❯ kubectl create ns kubevirt
namespace/kubevirt created

~
❯ helm install kargo ccio/kargo --namespace kargo --create-namespace
Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "cdi-operator-cluster" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "kargo"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "kargo"
jbpratt commented 3 years ago

I was able to successfully install things by going over the guide at https://github.com/ContainerCraft/Kargo/blob/master/docs/Fedora.md#instructions---deploy-kargo

usrbinkat commented 3 years ago

Thank you for reporting this issue. I will review and investigate.

usrbinkat commented 3 years ago

I was able to reproduce, will dig into it now.

└─(17:44:06)──> helm install kargo ccio/kargo --namespace kargo --create-namespace

Error: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "cdi-operator-cluster" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "kargo"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "kargo"
usrbinkat commented 3 years ago

Resolved with Kargo chart release kargo-0.0.12

Please run helm repo update to get the fix.