keel-hq / keel

Kubernetes Operator to automate Helm, DaemonSet, StatefulSet & Deployment updates
https://keel.sh
Mozilla Public License 2.0
2.43k stars 280 forks source link

Keel helm v3 config not properly picking up new deployments, no debug logs #543

Open cmoone opened 4 years ago

cmoone commented 4 years ago

I have Helm v3 and proceeded forward with the keel chart config using the v3 Helm setup.

I have configured a topic and subscription in Pub/Sub.

I have exported a JSON key for my service account with Pub/Sub Editor access.

I have configured the Kubernetes secret for Keel with my SLACK_TOKEN and google-application-credentials.json

I configured the deployment with

spec:
  containers:
  - command:
    - /bin/keel
    env:
    - name: NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    - name: GOOGLE_APPLICATION_CREDENTIALS
      value: /secret/google-application-credentials.json
    - name: PROJECT_ID
      value: <REDACTED>
    - name: DEBUG
      value: "1"
    - name: CLUSTER_NAME
      value: avl-preview
    - name: SLACK_CHANNELS
      value: preview-deployments
    - name: SLACK_BOT_NAME
      value: keel
    - name: HELM3_PROVIDER
      value: "true"
    - name: NOTIFICATION_LEVEL
      value: info
    envFrom:
    - secretRef:
        name: keel

I attempt to kill the existing keel pod, and let the deployment rebuild, and this is what I see in the logs:

Cortlands-MacBook-Pro:Downloads cmoone$ kubectl logs keel-564f8d5d96-9kgff -n keel time="2020-09-17T16:18:15Z" level=info msg="extension.credentialshelper: helper registered" name=aws time="2020-09-17T16:18:15Z" level=info msg="extension.credentialshelper: helper registered" name=gcr time="2020-09-17T16:18:15Z" level=info msg="bot: registered" name=slack time="2020-09-17T16:18:15Z" level=info msg="keel starting..." arch=amd64 build_date=2020-06-07T155004Z go_version=go1.14.2 os=linux revision=82ba1d50 version=0.16.1 time="2020-09-17T16:18:15Z" level=info msg="initializing database" database_path=/data/keel.db type=sqlite3 time="2020-09-17T16:18:15Z" level=info msg="extension.notification.slack: sender configured" channels="[preview-deployments]" name=slack time="2020-09-17T16:18:15Z" level=info msg="notificationSender: sender configured" sender name=slack time="2020-09-17T16:18:15Z" level=info msg="extension.notification.auditor: audit logger configured" name=auditor time="2020-09-17T16:18:15Z" level=info msg="notificationSender: sender configured" sender name=auditor time="2020-09-17T16:18:15Z" level=info msg="provider.kubernetes: using in-cluster configuration" time="2020-09-17T16:18:15Z" level=info msg="provider.defaultProviders: provider 'kubernetes' registered" time="2020-09-17T16:18:15Z" level=info msg="extension.credentialshelper: helper registered" name=secrets time="2020-09-17T16:18:15Z" level=info msg="trigger.poll.manager: polling trigger configured" time="2020-09-17T16:18:15Z" level=info msg="authentication is not enabled, admin HTTP handlers are not initialized" time="2020-09-17T16:18:15Z" level=info msg="webhook trigger server starting..." port=9300 time="2020-09-17T16:18:16Z" level=info msg=started context=watch resource=deployments time="2020-09-17T16:18:16Z" level=info msg=started context=watch resource=daemonsets time="2020-09-17T16:18:16Z" level=info msg=started context=watch resource=statefulsets time="2020-09-17T16:18:16Z" level=info msg=started context=buffer time="2020-09-17T16:18:16Z" level=info msg=started context=watch resource=cronjobs

It is not picking up any of my deployments or cronjobs that I have configured with annotations to pick up the Images I'm in interested in. Example of annotations in my deployments/cronjobs. metadata: annotations: keel.sh/notify: preview-deployments keel.sh/policy: glob:dev-*

Can you help me to understand why I am not seeing keel logs indicating scanning or picking up of images with DEBUG set to "1"?

rusenask commented 3 years ago

hi, sorry for the late reply :) so when you push images with tags like gcr.io/project/some-image-name:dev-10, nothing happens?

cmoone commented 3 years ago

Hi @rusenask, yep, it's not picking them up. Nothing happens. No indication it even sees them.

rusenask commented 3 years ago

I would expect to see this message in the logs:

trigger.pubsub: subscribing for events...

From:

// Subscribe - initiate PubsubSubscriber
func (s *PubsubSubscriber) Subscribe(ctx context.Context, topic, subscription string) error {
    // ensuring that topic exists
    err := s.ensureTopic(ctx, topic)
    if err != nil {
        return err
    }

    err = s.ensureSubscription(ctx, subscription, topic)
    if err != nil {
        return err
    }

    sub := s.client.Subscription(subscription)
    log.WithFields(log.Fields{
        "topic":        topic,
        "subscription": subscription,
    }).Info("trigger.pubsub: subscribing for events...")
    err = sub.Receive(ctx, s.callback)

So maybe pubsub is just not enabled. Could you check whether PUBSUB=true is set?