Skip to content

Unable to get pod names in webhook notification. #423

@IvanDechovsky

Description

@IvanDechovsky

As per the PR #388, we should be able to get the Pod names by including the following in the webhook template: Pods: {{ .Pods }}. However, it returns an empty array Pods: [].
Slack notification:

EventID: spot-itn-xxxx
Kind: SPOT_ITN
Description: Spot ITN received. Instance will be interrupted at 2021-05-03T08:30:49Z
Start Time: 2021-05-03 08:30:49 +0000 UTC
Node: ip-10-xx-xx-xx.eu-west-1.compute.internal
Pods: []

This is tested on tag: v1.13.0
Helm values used:

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/os
          operator: In
          values:
          - linux
        - key: kubernetes.io/arch
          operator: In
          values:
          - amd64
        - key: eks.amazonaws.com/compute-type
          operator: NotIn
          values:
          - fargate
deleteLocalData: true
enablePrometheusServer: true
enableScheduledEventDraining: true
enableSpotInterruptionDraining: true
ignoreDaemonSets: true
jsonLogging: true
nodeTerminationGracePeriod: 120
podAnnotations:
  co.elastic.logs/enabled: "true"
podMonitor:
  create: true
podTerminationGracePeriod: 60
priorityClassName: system-node-critical
rbac:
  pspEnabled: true
updateStrategy:
  rollingUpdate:
    maxUnavailable: 100%
  type: RollingUpdate
webhookTemplate: |
  {
    "blocks": [
      {
        "type": "section",
        "text": {
          "type": "mrkdwn",
          "text": ":boom: Instance interruption on cluster :boom:"
        }
      },
      {
        "type": "divider"
      },
      {
        "type": "context",
        "elements": [
          {
            "type": "mrkdwn",
            "text": "*EventID:* {{ .EventID }}\n*Kind:* {{ .Kind }}\n*Description:* {{ .Description }}\n*Start Time:* {{ .StartTime }}\n*Node:* {{ .NodeName }}\n*Pods:* {{ .Pods }}"
          }
        ]
      }
    ]
  }
webhookURL: xxx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions