crossplane-contrib / provider-kafka

Crossplane provider for Kafka
Apache License 2.0
24 stars 28 forks source link

Provider unhealthy (UnhealthyPackageRevision) #43

Closed withoutnickname closed 1 year ago

withoutnickname commented 1 year ago

What happened?

crossplane-provider-kafka-controller gets Unhealthy status right after Helm install (clean install)

How can we reproduce it?

Install Helm Chart crossplane-stable/crossplane (1.9.1) with provider-kafka in values:

provider:
  packages:
    - crossplane/provider-kafka-controller:stable

Provider is assigned installed status, but unhealthy. No pods except crossplane and crossplane-rbac-manager are running.

From ProviderRevision:

status:
  conditions:
    - lastTransitionTime: '2022-09-26T13:42:33Z'
      reason: UnhealthyPackageRevision
      status: 'False'
      type: Healthy

k get Provider -o yaml:

apiVersion: v1
items:
- apiVersion: pkg.crossplane.io/v1
  kind: Provider
  metadata:
    creationTimestamp: "2022-09-26T13:42:09Z"
    generation: 1
    name: crossplane-provider-kafka-controller
    resourceVersion: "1099151477"
    uid: 1dcb7352-2ac7-453a-8dfa-83530b03650e
  spec:
    ignoreCrossplaneConstraints: false
    package: crossplane/provider-kafka-controller:stable
    packagePullPolicy: IfNotPresent
    revisionActivationPolicy: Automatic
    revisionHistoryLimit: 1
    skipDependencyResolution: false
  status:
    conditions:
    - lastTransitionTime: "2022-09-26T13:42:33Z"
      reason: UnhealthyPackageRevision
      status: "False"
      type: Healthy
    - lastTransitionTime: "2022-09-26T13:42:27Z"
      reason: ActivePackageRevision
      status: "True"
      type: Installed
    currentIdentifier: crossplane/provider-kafka-controller:stable
    currentRevision: crossplane-provider-kafka-controller-711b31489f8d
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

What environment did it happen in?

Crossplane version: 1.9.1 K8s version: 1.21.5 (on-premise)

chlunde commented 1 year ago
  1. Use kubectl describe to get related events
  2. Try removing -controller from the package name, something like this: crossplane/provider-kafka:v0.1.0
withoutnickname commented 1 year ago

Hi @chlunde! Thanks for your reply.

With crossplane/provider-kafka:v0.1.0 crossplane-provider-kafka pod is trying to startup but cannot download image crossplane/provider-kafka-controller:v0.1.0 (because internet is restricted in our cluster).

Maybe you know, is it possible to override provider's image/repository in Helm chart's values.yaml in order to download it via proxy? E.g. for crossplane image following change works:

image:
  repository: custom.artifactory.proxy.com/crossplane/crossplane
  tag: v1.9.1

But for provider there is no such option. I tried to add registry arg into crossplane:

args:
  arg: --registry
  registry: custom.artifactory.proxy.com/crossplane

and env var

extraEnvVarsCrossplane:
  DOCKER_REGISTRY: custom.artifactory.proxy.com/crossplane

Did not help unfortunately.. still provider container is trying to pull crossplane/provider-kafka-controller:v0.1.0 directly.

Looking forward to your reply. Thanks in advance!

chlunde commented 1 year ago

With controllerconfig you can override the location of the image, I've have not installed the provider via helm so I'm not sure if you can set that with helm:

https://doc.crds.dev/github.com/crossplane/crossplane/pkg.crossplane.io/ControllerConfig/v1alpha1

with the new bundled package format, it will be possible to mirror the image easily without overriding the image in a controllerconfig, it will require a change like this:

https://github.com/crossplane-contrib/provider-aws/pull/1460

withoutnickname commented 1 year ago

Thanks, @chlunde!

I was able to install provider-kafka via adding both Provider and ControllerConfig templates into the Helm Chart. Examples with strict-written vars:

apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-kafka
spec:
  package: custom.artifactory.proxy.com/crossplane/provider-kafka:v0.1.0
  controllerConfigRef:
    name: kafka-image-config
apiVersion: pkg.crossplane.io/v1alpha1
kind: ControllerConfig
metadata:
  name: kafka-image-config
spec:
  image: custom.artifactory.proxy.com/crossplane/provider-kafka-controller:v0.1.0

Plus logically provider.packages is left empty in values.yaml

As a result provider-kafka pod is running with proxied provider-kafka-controller image.

imho, this information worth being mentioned in repository "how-to" (provider installation itself, hint with ControllerConfig and Helm Chart compatibilities).

Regards.