Open juv opened 3 years ago
You can find the helm chart I'm trying to install with provider-helm
here:
crossplane-irsa-service-account.zip
Example command to test the chart locally (note: this is for Windows/Powershell)
> helm template helm-test2 . --set serviceAccount.name=test --set serviceAccount.annotations."eks\.amazonaws\.com\/role-arn"=whatever
---
# Source: crossplane-irsa-service-account/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: test
labels:
helm.sh/chart: crossplane-irsa-service-account-0.1.3
app.kubernetes.io/name: crossplane-irsa-service-account
app.kubernetes.io/instance: helm-test2
app.kubernetes.io/version: "1.0.0"
app.kubernetes.io/managed-by: Helm
annotations:
eks.amazonaws.com/role-arn: whatever
Example Release
resource (note: you will need to adjust repository
and pullSecretRef
)
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: helm-test
spec:
forProvider:
namespace: your-namespace
values:
serviceAccount:
name: my-sa
annotations:
eks.amazonaws.com/role-arn: test-annotation
chart:
name: crossplane-irsa-service-account
repository: https://your-helm-registry.com/...
version: 0.1.3
pullSecretRef:
name: artifactory-basic-auth
namespace: crossplane-system
skipCreateNamespace: true
wait: false
providerConfigRef:
name: helm-provider
@juv thanks for the ticket.
Just tried on my side and it seems it worked fine.
Used the following release manifest:
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: helm-test
spec:
forProvider:
namespace: your-namespace
values:
serviceAccount:
name: my-sa
annotations:
eks.amazonaws.com/role-arn: test-annotation
chart:
name: crossplane-irsa-service-account
url: https://storage.googleapis.com/helm-repo-dev/crossplane-irsa-service-account-0.1.3.tgz
skipCreateNamespace: true
wait: false
providerConfigRef:
name: helm-provider
and used this as provider config with admin privileges: https://github.com/crossplane-contrib/provider-helm/blob/master/examples/provider-config/provider-config-incluster.yaml
It appears that this error is related to RBAC and not directly related to the functionality.
The following configuration is not enough, note the resources for apiGroup helm.crossplane.io
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: crossplane-helm-provider
rules:
- apiGroups:
- ""
resources:
- serviceaccounts
- secrets
- events
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- helm.crossplane.io
resources:
- providerconfigs
- releases
- providerconfigusages
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
In here the subresource for the release status, i.e. releases/status
, is missing.
When adding that subresource, it works:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: crossplane-helm-provider
rules:
- apiGroups:
- ""
resources:
- serviceaccounts
- secrets
- events
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- helm.crossplane.io
resources:
- providerconfigs
- releases
- releases/status
- providerconfigusages
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
Maybe an useful enhancement would be to print out error messages to the provider-helm
logs, when updating the ReleaseStatus
fails?
What happened?
The
Release
resource never gets into any status. The.status
field is even present when I runkubectl get release my-release -o yaml
How can we reproduce it?
My Helm chart is only creating a single Kubernetes resource, a ServiceAccount. I can see that the service account resource is created as expected. The Helm release itself is in status
deployed
.kubectl get release helm-test -o yaml
:kubectl describe release helm-test
:What environment did it happen in?
Crossplane version:
crossplane/provider-helm:v0.7.2
andcrossplane/crossplane:v1.3.0