@backstage/plugin-kubernetes-common 0.7.3 → 0.7.4-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @backstage/plugin-kubernetes-common
|
|
2
2
|
|
|
3
|
+
## 0.7.4-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- daad576: Clusters configured with the `aws` authentication strategy can now customize the
|
|
8
|
+
`x-k8s-aws-id` header value used to generate tokens. This value can be specified
|
|
9
|
+
specified via the `kubernetes.io/x-k8s-aws-id` parameter (in
|
|
10
|
+
`metadata.annotations` for clusters in the catalog, or the `authMetadata` block
|
|
11
|
+
on clusters in the app-config). This is particularly helpful when a Backstage
|
|
12
|
+
instance contains multiple AWS clusters with the same name in different regions
|
|
13
|
+
-- using this new parameter, the clusters can be given different logical names
|
|
14
|
+
to distinguish them but still use the same ID for the purposes of generating
|
|
15
|
+
tokens.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/catalog-model@1.4.3
|
|
18
|
+
- @backstage/types@1.1.1
|
|
19
|
+
- @backstage/plugin-permission-common@0.7.12
|
|
20
|
+
|
|
3
21
|
## 0.7.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -20,6 +20,7 @@ const ANNOTATION_KUBERNETES_DASHBOARD_URL = "kubernetes.io/dashboard-url";
|
|
|
20
20
|
const ANNOTATION_KUBERNETES_DASHBOARD_APP = "kubernetes.io/dashboard-app";
|
|
21
21
|
const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS = "kubernetes.io/dashboard-parameters";
|
|
22
22
|
const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE = "kubernetes.io/aws-assume-role";
|
|
23
|
+
const ANNOTATION_KUBERNETES_AWS_CLUSTER_ID = "kubernetes.io/x-k8s-aws-id";
|
|
23
24
|
const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID = "kubernetes.io/aws-external-id";
|
|
24
25
|
|
|
25
26
|
const kubernetesProxyPermission = pluginPermissionCommon.createPermission({
|
|
@@ -384,6 +385,7 @@ exports.ANNOTATION_KUBERNETES_API_SERVER = ANNOTATION_KUBERNETES_API_SERVER;
|
|
|
384
385
|
exports.ANNOTATION_KUBERNETES_API_SERVER_CA = ANNOTATION_KUBERNETES_API_SERVER_CA;
|
|
385
386
|
exports.ANNOTATION_KUBERNETES_AUTH_PROVIDER = ANNOTATION_KUBERNETES_AUTH_PROVIDER;
|
|
386
387
|
exports.ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE = ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE;
|
|
388
|
+
exports.ANNOTATION_KUBERNETES_AWS_CLUSTER_ID = ANNOTATION_KUBERNETES_AWS_CLUSTER_ID;
|
|
387
389
|
exports.ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID = ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID;
|
|
388
390
|
exports.ANNOTATION_KUBERNETES_DASHBOARD_APP = ANNOTATION_KUBERNETES_DASHBOARD_APP;
|
|
389
391
|
exports.ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS = ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/catalog-entity-constants.ts","../src/permissions.ts","../src/util/response.ts","../src/error-detection/common.ts","../src/error-detection/pods.ts","../src/error-detection/deployments.ts","../src/error-detection/hpas.ts","../src/error-detection/error-detection.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying the API server of a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server';\n\n/**\n * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER_CA =\n 'kubernetes.io/api-server-certificate-authority';\n\n/**\n * Annotation for specifying the auth provider for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AUTH_PROVIDER =\n 'kubernetes.io/auth-provider';\n\n/**\n * Annotation for specifying the oidc provider used to get id tokens for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER =\n 'kubernetes.io/oidc-token-provider';\n\n/**\n * Annotation for specifying boolean value for skip metric lookup.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP =\n 'kubernetes.io/skip-metrics-lookup';\n\n/**\n * Annotation for specifying boolean value for skip tls verify.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY =\n 'kubernetes.io/skip-tls-verify';\n\n/**\n * Annotation for specifying the dashboard url for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_URL =\n 'kubernetes.io/dashboard-url';\n\n/**\n * Annotation for specifying the dashboard app for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_APP =\n 'kubernetes.io/dashboard-app';\n\n/**\n * Annotation for specifying the dashboard app parameters for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS =\n 'kubernetes.io/dashboard-parameters';\n/**\n * Annotation for specifying the assume role use to authenticate with AWS.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE =\n 'kubernetes.io/aws-assume-role';\n\n/**\n * Annotation for specifying an external id when communicating with AWS\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID =\n 'kubernetes.io/aws-external-id';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/** This permission is used to check access to the proxy endpoint\n * @public\n */\nexport const kubernetesProxyPermission = createPermission({\n name: 'kubernetes.proxy',\n attributes: {},\n});\n\n/**\n * List of all Kubernetes permissions.\n * @public\n */\nexport const kubernetesPermissions = [kubernetesProxyPermission];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FetchResponse } from '@backstage/plugin-kubernetes-common';\nimport { GroupedResponses } from '../types';\n\n/** @public */\nexport const groupResponses = (\n fetchResponse: FetchResponse[],\n): GroupedResponses => {\n // TODO this could probably be a lodash groupBy\n return fetchResponse.reduce(\n (prev, next) => {\n switch (next.type) {\n case 'deployments':\n prev.deployments.push(...next.resources);\n break;\n case 'pods':\n prev.pods.push(...next.resources);\n break;\n case 'replicasets':\n prev.replicaSets.push(...next.resources);\n break;\n case 'services':\n prev.services.push(...next.resources);\n break;\n case 'configmaps':\n prev.configMaps.push(...next.resources);\n break;\n case 'horizontalpodautoscalers':\n prev.horizontalPodAutoscalers.push(...next.resources);\n break;\n case 'ingresses':\n prev.ingresses.push(...next.resources);\n break;\n case 'jobs':\n prev.jobs.push(...next.resources);\n break;\n case 'cronjobs':\n prev.cronJobs.push(...next.resources);\n break;\n case 'customresources':\n prev.customResources.push(...next.resources);\n break;\n case 'statefulsets':\n prev.statefulsets.push(...next.resources);\n break;\n default:\n }\n return prev;\n },\n {\n pods: [],\n replicaSets: [],\n deployments: [],\n services: [],\n configMaps: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n } as GroupedResponses,\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\n\n// Run through the each error mapper for each object\n// returning a deduplicated (mostly) result\nexport const detectErrorsInObjects = <T>(\n objects: T[],\n errorMappers: ErrorMapper<T>[],\n): DetectedError[] => {\n return objects.flatMap(o => {\n return errorMappers.flatMap(em => em.detectErrors(o));\n });\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Pod, IContainerStatus, IContainer } from 'kubernetes-models/v1';\nimport { DetectedError, ErrorMapper, ProposedFix } from './types';\nimport { detectErrorsInObjects } from './common';\nimport lodash from 'lodash';\nimport { DateTime } from 'luxon';\n\nfunction isPodReadinessProbeUnready({\n container,\n containerStatus,\n}: ContainerSpecAndStatus): boolean {\n if (\n containerStatus.ready ||\n containerStatus.state?.running?.startedAt === undefined ||\n !container.readinessProbe\n ) {\n return false;\n }\n const startDateTime = DateTime.fromISO(\n containerStatus.state?.running?.startedAt,\n )\n // Add initial delay\n .plus({\n seconds: container.readinessProbe?.initialDelaySeconds ?? 0,\n })\n // Add failure threshold\n .plus({\n seconds:\n (container.readinessProbe?.periodSeconds ?? 0) *\n (container.readinessProbe?.failureThreshold ?? 0),\n });\n return startDateTime < DateTime.now();\n}\n\ninterface ContainerSpecAndStatus {\n container: IContainer;\n containerStatus: IContainerStatus;\n}\n\nconst podToContainerSpecsAndStatuses = (pod: Pod): ContainerSpecAndStatus[] => {\n const specs = lodash.groupBy(pod.spec?.containers ?? [], value => value.name);\n\n const result: ContainerSpecAndStatus[] = [];\n\n for (const cs of pod.status?.containerStatuses ?? []) {\n const spec = specs[cs.name];\n if (spec.length > 0) {\n result.push({\n container: spec[0],\n containerStatus: cs,\n });\n }\n }\n\n return result;\n};\n\nconst readinessProbeProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const firstUnreadyContainerStatus = pod.status?.containerStatuses?.find(\n cs => {\n return cs.ready === false;\n },\n );\n\n return {\n errorType: 'ReadinessProbeFailed',\n rootCauseExplanation: `The container ${firstUnreadyContainerStatus?.name} failed to start properly, but is not crashing`,\n actions: [\n 'Ensure that the container starts correctly locally',\n \"Check the container's logs looking for error during startup\",\n ],\n type: 'events',\n podName: pod.metadata?.name ?? '',\n };\n};\n\nconst restartingPodProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const lastTerminatedCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.lastState?.terminated !== undefined,\n );\n\n const lastTerminated = lastTerminatedCs?.lastState?.terminated;\n\n if (!lastTerminated) {\n return undefined;\n }\n\n switch (lastTerminated?.reason) {\n case 'Unknown':\n return {\n // TODO check this one, it's more likely a cluster issue\n errorType: 'Unknown',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'Error':\n return {\n errorType: 'Error',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'OOMKilled':\n return {\n errorType: 'OOMKilled',\n rootCauseExplanation: `The container \"${lastTerminatedCs.name}\" has crashed because it has tried to use more memory that it has been allocated`,\n actions: [\n `Increase the amount of memory assigned to the container`,\n 'Ensure the application is memory bounded and is not trying to consume too much memory',\n ],\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#exceed-a-container-s-memory-limit',\n type: 'docs',\n };\n default:\n return undefined;\n }\n};\n\nconst waitingProposedFix = (pod: Pod): ProposedFix | undefined => {\n const waitingCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.state?.waiting !== undefined,\n );\n\n const waiting = (pod.status?.containerStatuses ?? [])\n .map(cs => cs.state?.waiting)\n .find(w => w?.reason !== undefined);\n\n switch (waiting?.reason) {\n case 'InvalidImageName':\n return {\n errorType: 'InvalidImageName',\n rootCauseExplanation: 'The image in the pod is invalid',\n actions: ['Ensure the image name is correct and valid image name'],\n type: 'docs',\n docsLink:\n 'https://docs.docker.com/engine/reference/commandline/tag/#extended-description',\n };\n case 'ImagePullBackOff':\n return {\n errorType: 'ImagePullBackOff',\n rootCauseExplanation:\n 'The image either could not be found or Kubernetes does not have permission to pull it',\n actions: [\n 'Ensure the image name is correct',\n 'Ensure Kubernetes has permission to pull this image',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/concepts/containers/images/#imagepullbackoff',\n };\n case 'CrashLoopBackOff':\n return {\n errorType: 'CrashLoopBackOff',\n rootCauseExplanation: `The container ${waitingCs?.name} has crashed many times, it will be exponentially restarted until it stops crashing`,\n actions: ['Check the crash logs for stacktraces'],\n type: 'logs',\n container: waitingCs?.name ?? 'unknown',\n };\n case 'CreateContainerConfigError':\n return {\n errorType: 'CreateContainerConfigError',\n rootCauseExplanation:\n 'There is missing or mismatching configuration required to start the container',\n actions: [\n 'Ensure ConfigMaps references in the Deployment manifest are correct and the keys exist',\n 'Ensure Secrets references in the Deployment manifest are correct and the keys exist',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/',\n };\n default:\n return undefined;\n }\n};\n\nconst podErrorMappers: ErrorMapper<Pod>[] = [\n {\n detectErrors: pod => {\n return podToContainerSpecsAndStatuses(pod)\n .filter(isPodReadinessProbeUnready)\n .map(cs => ({\n type: 'readiness-probe-taking-too-long',\n message: `The container ${cs.container.name} failed to start properly, but is not crashing`,\n severity: 4,\n proposedFix: readinessProbeProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.state?.waiting?.message !== undefined)\n .map(cs => ({\n type: 'container-waiting',\n message: cs.state?.waiting?.message ?? 'container waiting',\n severity: 4,\n proposedFix: waitingProposedFix(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.restartCount > 0)\n .map(cs => ({\n type: 'containers-restarting',\n message: `container=${cs.name} restarted ${cs.restartCount} times`,\n severity: 4,\n proposedFix: restartingPodProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: cs.restartCount,\n }));\n },\n },\n];\n\nexport const detectErrorsInPods = (pods: Pod[]): DetectedError[] =>\n detectErrorsInObjects(pods, podErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { detectErrorsInObjects } from './common';\n\nconst deploymentErrorMappers: ErrorMapper<Deployment>[] = [\n {\n detectErrors: deployment => {\n return (deployment.status?.conditions ?? [])\n .filter(c => c.status === 'False')\n .filter(c => c.message !== undefined)\n .map(c => ({\n type: 'condition-message-present',\n message: c.message ?? '',\n severity: 6,\n sourceRef: {\n name: deployment.metadata?.name ?? 'unknown hpa',\n namespace: deployment.metadata?.namespace ?? 'unknown namespace',\n kind: 'Deployment',\n apiGroup: 'apps/v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n];\n\nexport const detectErrorsInDeployments = (\n deployments: Deployment[],\n): DetectedError[] =>\n detectErrorsInObjects(deployments, deploymentErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { DetectedError, ErrorMapper } from './types';\nimport { detectErrorsInObjects } from './common';\n\nconst hpaErrorMappers: ErrorMapper<HorizontalPodAutoscaler>[] = [\n {\n detectErrors: hpa => {\n if ((hpa.spec?.maxReplicas ?? -1) === hpa.status?.currentReplicas) {\n return [\n {\n type: 'hpa-max-current-replicas',\n message: `Current number of replicas (${\n hpa.status?.currentReplicas\n }) is equal to the configured max number of replicas (${\n hpa.spec?.maxReplicas ?? -1\n })`,\n severity: 8,\n sourceRef: {\n name: hpa.metadata?.name ?? 'unknown hpa',\n namespace: hpa.metadata?.namespace ?? 'unknown namespace',\n kind: 'HorizontalPodAutoscaler',\n apiGroup: 'autoscaling/v1',\n },\n occurrenceCount: 1,\n },\n ];\n }\n return [];\n },\n },\n];\n\nexport const detectErrorsInHpa = (\n hpas: HorizontalPodAutoscaler[],\n): DetectedError[] => detectErrorsInObjects(hpas, hpaErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, DetectedErrorsByCluster } from './types';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { groupResponses } from '../util';\nimport { detectErrorsInPods } from './pods';\nimport { detectErrorsInDeployments } from './deployments';\nimport { detectErrorsInHpa } from './hpas';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { Pod } from 'kubernetes-models/v1';\n\n/**\n * For each cluster try to find errors in each of the object types provided\n * returning a map of cluster names to errors in that cluster\n *\n * @public\n */\nexport const detectErrors = (\n objects: ObjectsByEntityResponse,\n): DetectedErrorsByCluster => {\n const errors: DetectedErrorsByCluster = new Map<string, DetectedError[]>();\n\n for (const clusterResponse of objects.items) {\n let clusterErrors: DetectedError[] = [];\n\n const groupedResponses = groupResponses(clusterResponse.resources);\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInPods(groupedResponses.pods as Pod[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInDeployments(groupedResponses.deployments as Deployment[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInHpa(\n groupedResponses.horizontalPodAutoscalers as HorizontalPodAutoscaler[],\n ),\n );\n\n errors.set(clusterResponse.cluster.name, clusterErrors);\n }\n\n return errors;\n};\n"],"names":["createPermission","DateTime","lodash","_a","_b"],"mappings":";;;;;;;;;;;;AAqBO,MAAM,gCAAmC,GAAA,2BAAA;AAOzC,MAAM,mCACX,GAAA,iDAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,qCACX,GAAA,gCAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,0CACX,GAAA,qCAAA;AAMK,MAAM,qCACX,GAAA,gCAAA;AAOK,MAAM,qCACX,GAAA;;AC/EK,MAAM,4BAA4BA,uCAAiB,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qBAAA,CAAsB,MAAM,eAAe,CAAA;;AClBpD,MAAA,YAAA,GAAe,CAC1B,OAC4B,KAAA;AAC5B,EAAM,MAAA,MAAA,uBAAsC,GAA6B,EAAA,CAAA;AAEzE,EAAW,KAAA,MAAA,eAAA,IAAmB,QAAQ,KAAO,EAAA;AAC3C,IAAA,IAAI,gBAAiC,EAAC,CAAA;AAEtC,IAAM,MAAA,gBAAA,GAAmB,cAAe,CAAA,eAAA,CAAgB,SAAS,CAAA,CAAA;AAEjE,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,kBAAA,CAAmB,iBAAiB,IAAa,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,yBAAA,CAA0B,iBAAiB,WAA2B,CAAA;AAAA,KACxE,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,iBAAA;AAAA,QACE,gBAAiB,CAAA,wBAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAEA,IAAA,MAAA,CAAO,GAAI,CAAA,eAAA,CAAgB,OAAQ,CAAA,IAAA,EAAM,aAAa,CAAA,CAAA;AAAA,GACxD;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/catalog-entity-constants.ts","../src/permissions.ts","../src/util/response.ts","../src/error-detection/common.ts","../src/error-detection/pods.ts","../src/error-detection/deployments.ts","../src/error-detection/hpas.ts","../src/error-detection/error-detection.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying the API server of a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server';\n\n/**\n * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER_CA =\n 'kubernetes.io/api-server-certificate-authority';\n\n/**\n * Annotation for specifying the auth provider for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AUTH_PROVIDER =\n 'kubernetes.io/auth-provider';\n\n/**\n * Annotation for specifying the oidc provider used to get id tokens for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER =\n 'kubernetes.io/oidc-token-provider';\n\n/**\n * Annotation for specifying boolean value for skip metric lookup.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP =\n 'kubernetes.io/skip-metrics-lookup';\n\n/**\n * Annotation for specifying boolean value for skip tls verify.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY =\n 'kubernetes.io/skip-tls-verify';\n\n/**\n * Annotation for specifying the dashboard url for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_URL =\n 'kubernetes.io/dashboard-url';\n\n/**\n * Annotation for specifying the dashboard app for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_APP =\n 'kubernetes.io/dashboard-app';\n\n/**\n * Annotation for specifying the dashboard app parameters for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS =\n 'kubernetes.io/dashboard-parameters';\n\n/**\n * Annotation for specifying the assume role use to authenticate with AWS.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE =\n 'kubernetes.io/aws-assume-role';\n\n/**\n * Annotation for specifying the AWS ID of a cluster when signing STS tokens\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_CLUSTER_ID =\n 'kubernetes.io/x-k8s-aws-id';\n\n/**\n * Annotation for specifying an external id when communicating with AWS\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID =\n 'kubernetes.io/aws-external-id';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/** This permission is used to check access to the proxy endpoint\n * @public\n */\nexport const kubernetesProxyPermission = createPermission({\n name: 'kubernetes.proxy',\n attributes: {},\n});\n\n/**\n * List of all Kubernetes permissions.\n * @public\n */\nexport const kubernetesPermissions = [kubernetesProxyPermission];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FetchResponse } from '@backstage/plugin-kubernetes-common';\nimport { GroupedResponses } from '../types';\n\n/** @public */\nexport const groupResponses = (\n fetchResponse: FetchResponse[],\n): GroupedResponses => {\n // TODO this could probably be a lodash groupBy\n return fetchResponse.reduce(\n (prev, next) => {\n switch (next.type) {\n case 'deployments':\n prev.deployments.push(...next.resources);\n break;\n case 'pods':\n prev.pods.push(...next.resources);\n break;\n case 'replicasets':\n prev.replicaSets.push(...next.resources);\n break;\n case 'services':\n prev.services.push(...next.resources);\n break;\n case 'configmaps':\n prev.configMaps.push(...next.resources);\n break;\n case 'horizontalpodautoscalers':\n prev.horizontalPodAutoscalers.push(...next.resources);\n break;\n case 'ingresses':\n prev.ingresses.push(...next.resources);\n break;\n case 'jobs':\n prev.jobs.push(...next.resources);\n break;\n case 'cronjobs':\n prev.cronJobs.push(...next.resources);\n break;\n case 'customresources':\n prev.customResources.push(...next.resources);\n break;\n case 'statefulsets':\n prev.statefulsets.push(...next.resources);\n break;\n default:\n }\n return prev;\n },\n {\n pods: [],\n replicaSets: [],\n deployments: [],\n services: [],\n configMaps: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n } as GroupedResponses,\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\n\n// Run through the each error mapper for each object\n// returning a deduplicated (mostly) result\nexport const detectErrorsInObjects = <T>(\n objects: T[],\n errorMappers: ErrorMapper<T>[],\n): DetectedError[] => {\n return objects.flatMap(o => {\n return errorMappers.flatMap(em => em.detectErrors(o));\n });\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Pod, IContainerStatus, IContainer } from 'kubernetes-models/v1';\nimport { DetectedError, ErrorMapper, ProposedFix } from './types';\nimport { detectErrorsInObjects } from './common';\nimport lodash from 'lodash';\nimport { DateTime } from 'luxon';\n\nfunction isPodReadinessProbeUnready({\n container,\n containerStatus,\n}: ContainerSpecAndStatus): boolean {\n if (\n containerStatus.ready ||\n containerStatus.state?.running?.startedAt === undefined ||\n !container.readinessProbe\n ) {\n return false;\n }\n const startDateTime = DateTime.fromISO(\n containerStatus.state?.running?.startedAt,\n )\n // Add initial delay\n .plus({\n seconds: container.readinessProbe?.initialDelaySeconds ?? 0,\n })\n // Add failure threshold\n .plus({\n seconds:\n (container.readinessProbe?.periodSeconds ?? 0) *\n (container.readinessProbe?.failureThreshold ?? 0),\n });\n return startDateTime < DateTime.now();\n}\n\ninterface ContainerSpecAndStatus {\n container: IContainer;\n containerStatus: IContainerStatus;\n}\n\nconst podToContainerSpecsAndStatuses = (pod: Pod): ContainerSpecAndStatus[] => {\n const specs = lodash.groupBy(pod.spec?.containers ?? [], value => value.name);\n\n const result: ContainerSpecAndStatus[] = [];\n\n for (const cs of pod.status?.containerStatuses ?? []) {\n const spec = specs[cs.name];\n if (spec.length > 0) {\n result.push({\n container: spec[0],\n containerStatus: cs,\n });\n }\n }\n\n return result;\n};\n\nconst readinessProbeProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const firstUnreadyContainerStatus = pod.status?.containerStatuses?.find(\n cs => {\n return cs.ready === false;\n },\n );\n\n return {\n errorType: 'ReadinessProbeFailed',\n rootCauseExplanation: `The container ${firstUnreadyContainerStatus?.name} failed to start properly, but is not crashing`,\n actions: [\n 'Ensure that the container starts correctly locally',\n \"Check the container's logs looking for error during startup\",\n ],\n type: 'events',\n podName: pod.metadata?.name ?? '',\n };\n};\n\nconst restartingPodProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const lastTerminatedCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.lastState?.terminated !== undefined,\n );\n\n const lastTerminated = lastTerminatedCs?.lastState?.terminated;\n\n if (!lastTerminated) {\n return undefined;\n }\n\n switch (lastTerminated?.reason) {\n case 'Unknown':\n return {\n // TODO check this one, it's more likely a cluster issue\n errorType: 'Unknown',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'Error':\n return {\n errorType: 'Error',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'OOMKilled':\n return {\n errorType: 'OOMKilled',\n rootCauseExplanation: `The container \"${lastTerminatedCs.name}\" has crashed because it has tried to use more memory that it has been allocated`,\n actions: [\n `Increase the amount of memory assigned to the container`,\n 'Ensure the application is memory bounded and is not trying to consume too much memory',\n ],\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#exceed-a-container-s-memory-limit',\n type: 'docs',\n };\n default:\n return undefined;\n }\n};\n\nconst waitingProposedFix = (pod: Pod): ProposedFix | undefined => {\n const waitingCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.state?.waiting !== undefined,\n );\n\n const waiting = (pod.status?.containerStatuses ?? [])\n .map(cs => cs.state?.waiting)\n .find(w => w?.reason !== undefined);\n\n switch (waiting?.reason) {\n case 'InvalidImageName':\n return {\n errorType: 'InvalidImageName',\n rootCauseExplanation: 'The image in the pod is invalid',\n actions: ['Ensure the image name is correct and valid image name'],\n type: 'docs',\n docsLink:\n 'https://docs.docker.com/engine/reference/commandline/tag/#extended-description',\n };\n case 'ImagePullBackOff':\n return {\n errorType: 'ImagePullBackOff',\n rootCauseExplanation:\n 'The image either could not be found or Kubernetes does not have permission to pull it',\n actions: [\n 'Ensure the image name is correct',\n 'Ensure Kubernetes has permission to pull this image',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/concepts/containers/images/#imagepullbackoff',\n };\n case 'CrashLoopBackOff':\n return {\n errorType: 'CrashLoopBackOff',\n rootCauseExplanation: `The container ${waitingCs?.name} has crashed many times, it will be exponentially restarted until it stops crashing`,\n actions: ['Check the crash logs for stacktraces'],\n type: 'logs',\n container: waitingCs?.name ?? 'unknown',\n };\n case 'CreateContainerConfigError':\n return {\n errorType: 'CreateContainerConfigError',\n rootCauseExplanation:\n 'There is missing or mismatching configuration required to start the container',\n actions: [\n 'Ensure ConfigMaps references in the Deployment manifest are correct and the keys exist',\n 'Ensure Secrets references in the Deployment manifest are correct and the keys exist',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/',\n };\n default:\n return undefined;\n }\n};\n\nconst podErrorMappers: ErrorMapper<Pod>[] = [\n {\n detectErrors: pod => {\n return podToContainerSpecsAndStatuses(pod)\n .filter(isPodReadinessProbeUnready)\n .map(cs => ({\n type: 'readiness-probe-taking-too-long',\n message: `The container ${cs.container.name} failed to start properly, but is not crashing`,\n severity: 4,\n proposedFix: readinessProbeProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.state?.waiting?.message !== undefined)\n .map(cs => ({\n type: 'container-waiting',\n message: cs.state?.waiting?.message ?? 'container waiting',\n severity: 4,\n proposedFix: waitingProposedFix(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.restartCount > 0)\n .map(cs => ({\n type: 'containers-restarting',\n message: `container=${cs.name} restarted ${cs.restartCount} times`,\n severity: 4,\n proposedFix: restartingPodProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: cs.restartCount,\n }));\n },\n },\n];\n\nexport const detectErrorsInPods = (pods: Pod[]): DetectedError[] =>\n detectErrorsInObjects(pods, podErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { detectErrorsInObjects } from './common';\n\nconst deploymentErrorMappers: ErrorMapper<Deployment>[] = [\n {\n detectErrors: deployment => {\n return (deployment.status?.conditions ?? [])\n .filter(c => c.status === 'False')\n .filter(c => c.message !== undefined)\n .map(c => ({\n type: 'condition-message-present',\n message: c.message ?? '',\n severity: 6,\n sourceRef: {\n name: deployment.metadata?.name ?? 'unknown hpa',\n namespace: deployment.metadata?.namespace ?? 'unknown namespace',\n kind: 'Deployment',\n apiGroup: 'apps/v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n];\n\nexport const detectErrorsInDeployments = (\n deployments: Deployment[],\n): DetectedError[] =>\n detectErrorsInObjects(deployments, deploymentErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { DetectedError, ErrorMapper } from './types';\nimport { detectErrorsInObjects } from './common';\n\nconst hpaErrorMappers: ErrorMapper<HorizontalPodAutoscaler>[] = [\n {\n detectErrors: hpa => {\n if ((hpa.spec?.maxReplicas ?? -1) === hpa.status?.currentReplicas) {\n return [\n {\n type: 'hpa-max-current-replicas',\n message: `Current number of replicas (${\n hpa.status?.currentReplicas\n }) is equal to the configured max number of replicas (${\n hpa.spec?.maxReplicas ?? -1\n })`,\n severity: 8,\n sourceRef: {\n name: hpa.metadata?.name ?? 'unknown hpa',\n namespace: hpa.metadata?.namespace ?? 'unknown namespace',\n kind: 'HorizontalPodAutoscaler',\n apiGroup: 'autoscaling/v1',\n },\n occurrenceCount: 1,\n },\n ];\n }\n return [];\n },\n },\n];\n\nexport const detectErrorsInHpa = (\n hpas: HorizontalPodAutoscaler[],\n): DetectedError[] => detectErrorsInObjects(hpas, hpaErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, DetectedErrorsByCluster } from './types';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { groupResponses } from '../util';\nimport { detectErrorsInPods } from './pods';\nimport { detectErrorsInDeployments } from './deployments';\nimport { detectErrorsInHpa } from './hpas';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { Pod } from 'kubernetes-models/v1';\n\n/**\n * For each cluster try to find errors in each of the object types provided\n * returning a map of cluster names to errors in that cluster\n *\n * @public\n */\nexport const detectErrors = (\n objects: ObjectsByEntityResponse,\n): DetectedErrorsByCluster => {\n const errors: DetectedErrorsByCluster = new Map<string, DetectedError[]>();\n\n for (const clusterResponse of objects.items) {\n let clusterErrors: DetectedError[] = [];\n\n const groupedResponses = groupResponses(clusterResponse.resources);\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInPods(groupedResponses.pods as Pod[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInDeployments(groupedResponses.deployments as Deployment[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInHpa(\n groupedResponses.horizontalPodAutoscalers as HorizontalPodAutoscaler[],\n ),\n );\n\n errors.set(clusterResponse.cluster.name, clusterErrors);\n }\n\n return errors;\n};\n"],"names":["createPermission","DateTime","lodash","_a","_b"],"mappings":";;;;;;;;;;;;AAqBO,MAAM,gCAAmC,GAAA,2BAAA;AAOzC,MAAM,mCACX,GAAA,iDAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,qCACX,GAAA,gCAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,0CACX,GAAA,qCAAA;AAOK,MAAM,qCACX,GAAA,gCAAA;AAOK,MAAM,oCACX,GAAA,6BAAA;AAOK,MAAM,qCACX,GAAA;;ACxFK,MAAM,4BAA4BA,uCAAiB,CAAA;AAAA,EACxD,IAAM,EAAA,kBAAA;AAAA,EACN,YAAY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GAAe,CAC1B,OAC4B,KAAA;AAC5B,EAAM,MAAA,MAAA,uBAAsC,GAA6B,EAAA,CAAA;AAEzE,EAAW,KAAA,MAAA,eAAA,IAAmB,QAAQ,KAAO,EAAA;AAC3C,IAAA,IAAI,gBAAiC,EAAC,CAAA;AAEtC,IAAM,MAAA,gBAAA,GAAmB,cAAe,CAAA,eAAA,CAAgB,SAAS,CAAA,CAAA;AAEjE,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,kBAAA,CAAmB,iBAAiB,IAAa,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,yBAAA,CAA0B,iBAAiB,WAA2B,CAAA;AAAA,KACxE,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,iBAAA;AAAA,QACE,gBAAiB,CAAA,wBAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAEA,IAAA,MAAA,CAAO,GAAI,CAAA,eAAA,CAAgB,OAAQ,CAAA,IAAA,EAAM,aAAa,CAAA,CAAA;AAAA,GACxD;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -270,6 +270,12 @@ declare const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS = "kubernetes.io/dashbo
|
|
|
270
270
|
* @public
|
|
271
271
|
*/
|
|
272
272
|
declare const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE = "kubernetes.io/aws-assume-role";
|
|
273
|
+
/**
|
|
274
|
+
* Annotation for specifying the AWS ID of a cluster when signing STS tokens
|
|
275
|
+
*
|
|
276
|
+
* @public
|
|
277
|
+
*/
|
|
278
|
+
declare const ANNOTATION_KUBERNETES_AWS_CLUSTER_ID = "kubernetes.io/x-k8s-aws-id";
|
|
273
279
|
/**
|
|
274
280
|
* Annotation for specifying an external id when communicating with AWS
|
|
275
281
|
*
|
|
@@ -362,4 +368,4 @@ declare const detectErrors: (objects: ObjectsByEntityResponse$1) => DetectedErro
|
|
|
362
368
|
/** @public */
|
|
363
369
|
declare const groupResponses: (fetchResponse: FetchResponse$1[]) => GroupedResponses;
|
|
364
370
|
|
|
365
|
-
export { ANNOTATION_KUBERNETES_API_SERVER, ANNOTATION_KUBERNETES_API_SERVER_CA, ANNOTATION_KUBERNETES_AUTH_PROVIDER, ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE, ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID, ANNOTATION_KUBERNETES_DASHBOARD_APP, ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS, ANNOTATION_KUBERNETES_DASHBOARD_URL, ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER, ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP, ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY, AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, DeploymentResources, DetectedError, DetectedErrorsByCluster, DocsSolution, ErrorMapper, ErrorSeverity, EventsSolution, FetchResponse, GroupedResponses, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, LimitRangeFetchResponse, LogSolution, ObjectsByEntityResponse, PodFetchResponse, PodStatusFetchResponse, ProposedFix, ProposedFixBase, RawFetchError, ReplicaSetsFetchResponse, ResourceQuotaFetchResponse, ResourceRef, ServiceFetchResponse, StatefulSetsFetchResponse, StatusError, WorkloadsByEntityRequest, detectErrors, groupResponses, kubernetesPermissions, kubernetesProxyPermission };
|
|
371
|
+
export { ANNOTATION_KUBERNETES_API_SERVER, ANNOTATION_KUBERNETES_API_SERVER_CA, ANNOTATION_KUBERNETES_AUTH_PROVIDER, ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE, ANNOTATION_KUBERNETES_AWS_CLUSTER_ID, ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID, ANNOTATION_KUBERNETES_DASHBOARD_APP, ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS, ANNOTATION_KUBERNETES_DASHBOARD_URL, ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER, ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP, ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY, AuthProviderType, ClientContainerStatus, ClientCurrentResourceUsage, ClientPodStatus, ClusterAttributes, ClusterObjects, ConfigMapFetchResponse, CronJobsFetchResponse, CustomObjectsByEntityRequest, CustomResourceFetchResponse, CustomResourceMatcher, DaemonSetsFetchResponse, DeploymentFetchResponse, DeploymentResources, DetectedError, DetectedErrorsByCluster, DocsSolution, ErrorMapper, ErrorSeverity, EventsSolution, FetchResponse, GroupedResponses, HorizontalPodAutoscalersFetchResponse, IngressesFetchResponse, JobsFetchResponse, KubernetesErrorTypes, KubernetesFetchError, KubernetesRequestAuth, KubernetesRequestBody, LimitRangeFetchResponse, LogSolution, ObjectsByEntityResponse, PodFetchResponse, PodStatusFetchResponse, ProposedFix, ProposedFixBase, RawFetchError, ReplicaSetsFetchResponse, ResourceQuotaFetchResponse, ResourceRef, ServiceFetchResponse, StatefulSetsFetchResponse, StatusError, WorkloadsByEntityRequest, detectErrors, groupResponses, kubernetesPermissions, kubernetesProxyPermission };
|
package/dist/index.esm.js
CHANGED
|
@@ -12,6 +12,7 @@ const ANNOTATION_KUBERNETES_DASHBOARD_URL = "kubernetes.io/dashboard-url";
|
|
|
12
12
|
const ANNOTATION_KUBERNETES_DASHBOARD_APP = "kubernetes.io/dashboard-app";
|
|
13
13
|
const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS = "kubernetes.io/dashboard-parameters";
|
|
14
14
|
const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE = "kubernetes.io/aws-assume-role";
|
|
15
|
+
const ANNOTATION_KUBERNETES_AWS_CLUSTER_ID = "kubernetes.io/x-k8s-aws-id";
|
|
15
16
|
const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID = "kubernetes.io/aws-external-id";
|
|
16
17
|
|
|
17
18
|
const kubernetesProxyPermission = createPermission({
|
|
@@ -372,5 +373,5 @@ const detectErrors = (objects) => {
|
|
|
372
373
|
return errors;
|
|
373
374
|
};
|
|
374
375
|
|
|
375
|
-
export { ANNOTATION_KUBERNETES_API_SERVER, ANNOTATION_KUBERNETES_API_SERVER_CA, ANNOTATION_KUBERNETES_AUTH_PROVIDER, ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE, ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID, ANNOTATION_KUBERNETES_DASHBOARD_APP, ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS, ANNOTATION_KUBERNETES_DASHBOARD_URL, ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER, ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP, ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY, detectErrors, groupResponses, kubernetesPermissions, kubernetesProxyPermission };
|
|
376
|
+
export { ANNOTATION_KUBERNETES_API_SERVER, ANNOTATION_KUBERNETES_API_SERVER_CA, ANNOTATION_KUBERNETES_AUTH_PROVIDER, ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE, ANNOTATION_KUBERNETES_AWS_CLUSTER_ID, ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID, ANNOTATION_KUBERNETES_DASHBOARD_APP, ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS, ANNOTATION_KUBERNETES_DASHBOARD_URL, ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER, ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP, ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY, detectErrors, groupResponses, kubernetesPermissions, kubernetesProxyPermission };
|
|
376
377
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../src/catalog-entity-constants.ts","../src/permissions.ts","../src/util/response.ts","../src/error-detection/common.ts","../src/error-detection/pods.ts","../src/error-detection/deployments.ts","../src/error-detection/hpas.ts","../src/error-detection/error-detection.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying the API server of a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server';\n\n/**\n * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER_CA =\n 'kubernetes.io/api-server-certificate-authority';\n\n/**\n * Annotation for specifying the auth provider for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AUTH_PROVIDER =\n 'kubernetes.io/auth-provider';\n\n/**\n * Annotation for specifying the oidc provider used to get id tokens for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER =\n 'kubernetes.io/oidc-token-provider';\n\n/**\n * Annotation for specifying boolean value for skip metric lookup.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP =\n 'kubernetes.io/skip-metrics-lookup';\n\n/**\n * Annotation for specifying boolean value for skip tls verify.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY =\n 'kubernetes.io/skip-tls-verify';\n\n/**\n * Annotation for specifying the dashboard url for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_URL =\n 'kubernetes.io/dashboard-url';\n\n/**\n * Annotation for specifying the dashboard app for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_APP =\n 'kubernetes.io/dashboard-app';\n\n/**\n * Annotation for specifying the dashboard app parameters for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS =\n 'kubernetes.io/dashboard-parameters';\n/**\n * Annotation for specifying the assume role use to authenticate with AWS.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE =\n 'kubernetes.io/aws-assume-role';\n\n/**\n * Annotation for specifying an external id when communicating with AWS\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID =\n 'kubernetes.io/aws-external-id';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/** This permission is used to check access to the proxy endpoint\n * @public\n */\nexport const kubernetesProxyPermission = createPermission({\n name: 'kubernetes.proxy',\n attributes: {},\n});\n\n/**\n * List of all Kubernetes permissions.\n * @public\n */\nexport const kubernetesPermissions = [kubernetesProxyPermission];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FetchResponse } from '@backstage/plugin-kubernetes-common';\nimport { GroupedResponses } from '../types';\n\n/** @public */\nexport const groupResponses = (\n fetchResponse: FetchResponse[],\n): GroupedResponses => {\n // TODO this could probably be a lodash groupBy\n return fetchResponse.reduce(\n (prev, next) => {\n switch (next.type) {\n case 'deployments':\n prev.deployments.push(...next.resources);\n break;\n case 'pods':\n prev.pods.push(...next.resources);\n break;\n case 'replicasets':\n prev.replicaSets.push(...next.resources);\n break;\n case 'services':\n prev.services.push(...next.resources);\n break;\n case 'configmaps':\n prev.configMaps.push(...next.resources);\n break;\n case 'horizontalpodautoscalers':\n prev.horizontalPodAutoscalers.push(...next.resources);\n break;\n case 'ingresses':\n prev.ingresses.push(...next.resources);\n break;\n case 'jobs':\n prev.jobs.push(...next.resources);\n break;\n case 'cronjobs':\n prev.cronJobs.push(...next.resources);\n break;\n case 'customresources':\n prev.customResources.push(...next.resources);\n break;\n case 'statefulsets':\n prev.statefulsets.push(...next.resources);\n break;\n default:\n }\n return prev;\n },\n {\n pods: [],\n replicaSets: [],\n deployments: [],\n services: [],\n configMaps: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n } as GroupedResponses,\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\n\n// Run through the each error mapper for each object\n// returning a deduplicated (mostly) result\nexport const detectErrorsInObjects = <T>(\n objects: T[],\n errorMappers: ErrorMapper<T>[],\n): DetectedError[] => {\n return objects.flatMap(o => {\n return errorMappers.flatMap(em => em.detectErrors(o));\n });\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Pod, IContainerStatus, IContainer } from 'kubernetes-models/v1';\nimport { DetectedError, ErrorMapper, ProposedFix } from './types';\nimport { detectErrorsInObjects } from './common';\nimport lodash from 'lodash';\nimport { DateTime } from 'luxon';\n\nfunction isPodReadinessProbeUnready({\n container,\n containerStatus,\n}: ContainerSpecAndStatus): boolean {\n if (\n containerStatus.ready ||\n containerStatus.state?.running?.startedAt === undefined ||\n !container.readinessProbe\n ) {\n return false;\n }\n const startDateTime = DateTime.fromISO(\n containerStatus.state?.running?.startedAt,\n )\n // Add initial delay\n .plus({\n seconds: container.readinessProbe?.initialDelaySeconds ?? 0,\n })\n // Add failure threshold\n .plus({\n seconds:\n (container.readinessProbe?.periodSeconds ?? 0) *\n (container.readinessProbe?.failureThreshold ?? 0),\n });\n return startDateTime < DateTime.now();\n}\n\ninterface ContainerSpecAndStatus {\n container: IContainer;\n containerStatus: IContainerStatus;\n}\n\nconst podToContainerSpecsAndStatuses = (pod: Pod): ContainerSpecAndStatus[] => {\n const specs = lodash.groupBy(pod.spec?.containers ?? [], value => value.name);\n\n const result: ContainerSpecAndStatus[] = [];\n\n for (const cs of pod.status?.containerStatuses ?? []) {\n const spec = specs[cs.name];\n if (spec.length > 0) {\n result.push({\n container: spec[0],\n containerStatus: cs,\n });\n }\n }\n\n return result;\n};\n\nconst readinessProbeProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const firstUnreadyContainerStatus = pod.status?.containerStatuses?.find(\n cs => {\n return cs.ready === false;\n },\n );\n\n return {\n errorType: 'ReadinessProbeFailed',\n rootCauseExplanation: `The container ${firstUnreadyContainerStatus?.name} failed to start properly, but is not crashing`,\n actions: [\n 'Ensure that the container starts correctly locally',\n \"Check the container's logs looking for error during startup\",\n ],\n type: 'events',\n podName: pod.metadata?.name ?? '',\n };\n};\n\nconst restartingPodProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const lastTerminatedCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.lastState?.terminated !== undefined,\n );\n\n const lastTerminated = lastTerminatedCs?.lastState?.terminated;\n\n if (!lastTerminated) {\n return undefined;\n }\n\n switch (lastTerminated?.reason) {\n case 'Unknown':\n return {\n // TODO check this one, it's more likely a cluster issue\n errorType: 'Unknown',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'Error':\n return {\n errorType: 'Error',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'OOMKilled':\n return {\n errorType: 'OOMKilled',\n rootCauseExplanation: `The container \"${lastTerminatedCs.name}\" has crashed because it has tried to use more memory that it has been allocated`,\n actions: [\n `Increase the amount of memory assigned to the container`,\n 'Ensure the application is memory bounded and is not trying to consume too much memory',\n ],\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#exceed-a-container-s-memory-limit',\n type: 'docs',\n };\n default:\n return undefined;\n }\n};\n\nconst waitingProposedFix = (pod: Pod): ProposedFix | undefined => {\n const waitingCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.state?.waiting !== undefined,\n );\n\n const waiting = (pod.status?.containerStatuses ?? [])\n .map(cs => cs.state?.waiting)\n .find(w => w?.reason !== undefined);\n\n switch (waiting?.reason) {\n case 'InvalidImageName':\n return {\n errorType: 'InvalidImageName',\n rootCauseExplanation: 'The image in the pod is invalid',\n actions: ['Ensure the image name is correct and valid image name'],\n type: 'docs',\n docsLink:\n 'https://docs.docker.com/engine/reference/commandline/tag/#extended-description',\n };\n case 'ImagePullBackOff':\n return {\n errorType: 'ImagePullBackOff',\n rootCauseExplanation:\n 'The image either could not be found or Kubernetes does not have permission to pull it',\n actions: [\n 'Ensure the image name is correct',\n 'Ensure Kubernetes has permission to pull this image',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/concepts/containers/images/#imagepullbackoff',\n };\n case 'CrashLoopBackOff':\n return {\n errorType: 'CrashLoopBackOff',\n rootCauseExplanation: `The container ${waitingCs?.name} has crashed many times, it will be exponentially restarted until it stops crashing`,\n actions: ['Check the crash logs for stacktraces'],\n type: 'logs',\n container: waitingCs?.name ?? 'unknown',\n };\n case 'CreateContainerConfigError':\n return {\n errorType: 'CreateContainerConfigError',\n rootCauseExplanation:\n 'There is missing or mismatching configuration required to start the container',\n actions: [\n 'Ensure ConfigMaps references in the Deployment manifest are correct and the keys exist',\n 'Ensure Secrets references in the Deployment manifest are correct and the keys exist',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/',\n };\n default:\n return undefined;\n }\n};\n\nconst podErrorMappers: ErrorMapper<Pod>[] = [\n {\n detectErrors: pod => {\n return podToContainerSpecsAndStatuses(pod)\n .filter(isPodReadinessProbeUnready)\n .map(cs => ({\n type: 'readiness-probe-taking-too-long',\n message: `The container ${cs.container.name} failed to start properly, but is not crashing`,\n severity: 4,\n proposedFix: readinessProbeProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.state?.waiting?.message !== undefined)\n .map(cs => ({\n type: 'container-waiting',\n message: cs.state?.waiting?.message ?? 'container waiting',\n severity: 4,\n proposedFix: waitingProposedFix(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.restartCount > 0)\n .map(cs => ({\n type: 'containers-restarting',\n message: `container=${cs.name} restarted ${cs.restartCount} times`,\n severity: 4,\n proposedFix: restartingPodProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: cs.restartCount,\n }));\n },\n },\n];\n\nexport const detectErrorsInPods = (pods: Pod[]): DetectedError[] =>\n detectErrorsInObjects(pods, podErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { detectErrorsInObjects } from './common';\n\nconst deploymentErrorMappers: ErrorMapper<Deployment>[] = [\n {\n detectErrors: deployment => {\n return (deployment.status?.conditions ?? [])\n .filter(c => c.status === 'False')\n .filter(c => c.message !== undefined)\n .map(c => ({\n type: 'condition-message-present',\n message: c.message ?? '',\n severity: 6,\n sourceRef: {\n name: deployment.metadata?.name ?? 'unknown hpa',\n namespace: deployment.metadata?.namespace ?? 'unknown namespace',\n kind: 'Deployment',\n apiGroup: 'apps/v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n];\n\nexport const detectErrorsInDeployments = (\n deployments: Deployment[],\n): DetectedError[] =>\n detectErrorsInObjects(deployments, deploymentErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { DetectedError, ErrorMapper } from './types';\nimport { detectErrorsInObjects } from './common';\n\nconst hpaErrorMappers: ErrorMapper<HorizontalPodAutoscaler>[] = [\n {\n detectErrors: hpa => {\n if ((hpa.spec?.maxReplicas ?? -1) === hpa.status?.currentReplicas) {\n return [\n {\n type: 'hpa-max-current-replicas',\n message: `Current number of replicas (${\n hpa.status?.currentReplicas\n }) is equal to the configured max number of replicas (${\n hpa.spec?.maxReplicas ?? -1\n })`,\n severity: 8,\n sourceRef: {\n name: hpa.metadata?.name ?? 'unknown hpa',\n namespace: hpa.metadata?.namespace ?? 'unknown namespace',\n kind: 'HorizontalPodAutoscaler',\n apiGroup: 'autoscaling/v1',\n },\n occurrenceCount: 1,\n },\n ];\n }\n return [];\n },\n },\n];\n\nexport const detectErrorsInHpa = (\n hpas: HorizontalPodAutoscaler[],\n): DetectedError[] => detectErrorsInObjects(hpas, hpaErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, DetectedErrorsByCluster } from './types';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { groupResponses } from '../util';\nimport { detectErrorsInPods } from './pods';\nimport { detectErrorsInDeployments } from './deployments';\nimport { detectErrorsInHpa } from './hpas';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { Pod } from 'kubernetes-models/v1';\n\n/**\n * For each cluster try to find errors in each of the object types provided\n * returning a map of cluster names to errors in that cluster\n *\n * @public\n */\nexport const detectErrors = (\n objects: ObjectsByEntityResponse,\n): DetectedErrorsByCluster => {\n const errors: DetectedErrorsByCluster = new Map<string, DetectedError[]>();\n\n for (const clusterResponse of objects.items) {\n let clusterErrors: DetectedError[] = [];\n\n const groupedResponses = groupResponses(clusterResponse.resources);\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInPods(groupedResponses.pods as Pod[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInDeployments(groupedResponses.deployments as Deployment[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInHpa(\n groupedResponses.horizontalPodAutoscalers as HorizontalPodAutoscaler[],\n ),\n );\n\n errors.set(clusterResponse.cluster.name, clusterErrors);\n }\n\n return errors;\n};\n"],"names":["_a","_b"],"mappings":";;;;AAqBO,MAAM,gCAAmC,GAAA,2BAAA;AAOzC,MAAM,mCACX,GAAA,iDAAA;AAOK,MAAM,mCACX,GAA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AA,EAAA,GAAA,mBAAA;AAAA,cACtC,IAAM,EAAA,yBAAA;AAAA,cACN,QAAU,EAAA,gBAAA;AAAA,aACZ;AAAA,YACA,eAAiB,EAAA,CAAA;AAAA,WACnB;AAAA,SACF,CAAA;AAAA,OACF;AACA,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,iBAAoB,GAAA,CAC/B,IACoB,KAAA,qBAAA,CAAsB,MAAM,eAAe,CAAA;;AClBpD,MAAA,YAAA,GAAe,CAC1B,OAC4B,KAAA;AAC5B,EAAM,MAAA,MAAA,uBAAsC,GAA6B,EAAA,CAAA;AAEzE,EAAW,KAAA,MAAA,eAAA,IAAmB,QAAQ,KAAO,EAAA;AAC3C,IAAA,IAAI,gBAAiC,EAAC,CAAA;AAEtC,IAAM,MAAA,gBAAA,GAAmB,cAAe,CAAA,eAAA,CAAgB,SAAS,CAAA,CAAA;AAEjE,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,kBAAA,CAAmB,iBAAiB,IAAa,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,yBAAA,CAA0B,iBAAiB,WAA2B,CAAA;AAAA,KACxE,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,iBAAA;AAAA,QACE,gBAAiB,CAAA,wBAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAEA,IAAA,MAAA,CAAO,GAAI,CAAA,eAAA,CAAgB,OAAQ,CAAA,IAAA,EAAM,aAAa,CAAA,CAAA;AAAA,GACxD;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/catalog-entity-constants.ts","../src/permissions.ts","../src/util/response.ts","../src/error-detection/common.ts","../src/error-detection/pods.ts","../src/error-detection/deployments.ts","../src/error-detection/hpas.ts","../src/error-detection/error-detection.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Annotation for specifying the API server of a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER = 'kubernetes.io/api-server';\n\n/**\n * Annotation for specifying the Certificate Authority of an API server for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_API_SERVER_CA =\n 'kubernetes.io/api-server-certificate-authority';\n\n/**\n * Annotation for specifying the auth provider for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AUTH_PROVIDER =\n 'kubernetes.io/auth-provider';\n\n/**\n * Annotation for specifying the oidc provider used to get id tokens for a Kubernetes cluster\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_OIDC_TOKEN_PROVIDER =\n 'kubernetes.io/oidc-token-provider';\n\n/**\n * Annotation for specifying boolean value for skip metric lookup.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_METRICS_LOOKUP =\n 'kubernetes.io/skip-metrics-lookup';\n\n/**\n * Annotation for specifying boolean value for skip tls verify.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_SKIP_TLS_VERIFY =\n 'kubernetes.io/skip-tls-verify';\n\n/**\n * Annotation for specifying the dashboard url for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_URL =\n 'kubernetes.io/dashboard-url';\n\n/**\n * Annotation for specifying the dashboard app for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_APP =\n 'kubernetes.io/dashboard-app';\n\n/**\n * Annotation for specifying the dashboard app parameters for a Kubernetes cluster.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_DASHBOARD_PARAMETERS =\n 'kubernetes.io/dashboard-parameters';\n\n/**\n * Annotation for specifying the assume role use to authenticate with AWS.\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_ASSUME_ROLE =\n 'kubernetes.io/aws-assume-role';\n\n/**\n * Annotation for specifying the AWS ID of a cluster when signing STS tokens\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_CLUSTER_ID =\n 'kubernetes.io/x-k8s-aws-id';\n\n/**\n * Annotation for specifying an external id when communicating with AWS\n *\n * @public\n */\nexport const ANNOTATION_KUBERNETES_AWS_EXTERNAL_ID =\n 'kubernetes.io/aws-external-id';\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/** This permission is used to check access to the proxy endpoint\n * @public\n */\nexport const kubernetesProxyPermission = createPermission({\n name: 'kubernetes.proxy',\n attributes: {},\n});\n\n/**\n * List of all Kubernetes permissions.\n * @public\n */\nexport const kubernetesPermissions = [kubernetesProxyPermission];\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FetchResponse } from '@backstage/plugin-kubernetes-common';\nimport { GroupedResponses } from '../types';\n\n/** @public */\nexport const groupResponses = (\n fetchResponse: FetchResponse[],\n): GroupedResponses => {\n // TODO this could probably be a lodash groupBy\n return fetchResponse.reduce(\n (prev, next) => {\n switch (next.type) {\n case 'deployments':\n prev.deployments.push(...next.resources);\n break;\n case 'pods':\n prev.pods.push(...next.resources);\n break;\n case 'replicasets':\n prev.replicaSets.push(...next.resources);\n break;\n case 'services':\n prev.services.push(...next.resources);\n break;\n case 'configmaps':\n prev.configMaps.push(...next.resources);\n break;\n case 'horizontalpodautoscalers':\n prev.horizontalPodAutoscalers.push(...next.resources);\n break;\n case 'ingresses':\n prev.ingresses.push(...next.resources);\n break;\n case 'jobs':\n prev.jobs.push(...next.resources);\n break;\n case 'cronjobs':\n prev.cronJobs.push(...next.resources);\n break;\n case 'customresources':\n prev.customResources.push(...next.resources);\n break;\n case 'statefulsets':\n prev.statefulsets.push(...next.resources);\n break;\n default:\n }\n return prev;\n },\n {\n pods: [],\n replicaSets: [],\n deployments: [],\n services: [],\n configMaps: [],\n horizontalPodAutoscalers: [],\n ingresses: [],\n jobs: [],\n cronJobs: [],\n customResources: [],\n statefulsets: [],\n } as GroupedResponses,\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\n\n// Run through the each error mapper for each object\n// returning a deduplicated (mostly) result\nexport const detectErrorsInObjects = <T>(\n objects: T[],\n errorMappers: ErrorMapper<T>[],\n): DetectedError[] => {\n return objects.flatMap(o => {\n return errorMappers.flatMap(em => em.detectErrors(o));\n });\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Pod, IContainerStatus, IContainer } from 'kubernetes-models/v1';\nimport { DetectedError, ErrorMapper, ProposedFix } from './types';\nimport { detectErrorsInObjects } from './common';\nimport lodash from 'lodash';\nimport { DateTime } from 'luxon';\n\nfunction isPodReadinessProbeUnready({\n container,\n containerStatus,\n}: ContainerSpecAndStatus): boolean {\n if (\n containerStatus.ready ||\n containerStatus.state?.running?.startedAt === undefined ||\n !container.readinessProbe\n ) {\n return false;\n }\n const startDateTime = DateTime.fromISO(\n containerStatus.state?.running?.startedAt,\n )\n // Add initial delay\n .plus({\n seconds: container.readinessProbe?.initialDelaySeconds ?? 0,\n })\n // Add failure threshold\n .plus({\n seconds:\n (container.readinessProbe?.periodSeconds ?? 0) *\n (container.readinessProbe?.failureThreshold ?? 0),\n });\n return startDateTime < DateTime.now();\n}\n\ninterface ContainerSpecAndStatus {\n container: IContainer;\n containerStatus: IContainerStatus;\n}\n\nconst podToContainerSpecsAndStatuses = (pod: Pod): ContainerSpecAndStatus[] => {\n const specs = lodash.groupBy(pod.spec?.containers ?? [], value => value.name);\n\n const result: ContainerSpecAndStatus[] = [];\n\n for (const cs of pod.status?.containerStatuses ?? []) {\n const spec = specs[cs.name];\n if (spec.length > 0) {\n result.push({\n container: spec[0],\n containerStatus: cs,\n });\n }\n }\n\n return result;\n};\n\nconst readinessProbeProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const firstUnreadyContainerStatus = pod.status?.containerStatuses?.find(\n cs => {\n return cs.ready === false;\n },\n );\n\n return {\n errorType: 'ReadinessProbeFailed',\n rootCauseExplanation: `The container ${firstUnreadyContainerStatus?.name} failed to start properly, but is not crashing`,\n actions: [\n 'Ensure that the container starts correctly locally',\n \"Check the container's logs looking for error during startup\",\n ],\n type: 'events',\n podName: pod.metadata?.name ?? '',\n };\n};\n\nconst restartingPodProposedFixes = (pod: Pod): ProposedFix | undefined => {\n const lastTerminatedCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.lastState?.terminated !== undefined,\n );\n\n const lastTerminated = lastTerminatedCs?.lastState?.terminated;\n\n if (!lastTerminated) {\n return undefined;\n }\n\n switch (lastTerminated?.reason) {\n case 'Unknown':\n return {\n // TODO check this one, it's more likely a cluster issue\n errorType: 'Unknown',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'Error':\n return {\n errorType: 'Error',\n rootCauseExplanation: `This container has exited with a non-zero exit code (${lastTerminated.exitCode})`,\n actions: ['Check the crash logs for stacktraces'],\n container: lastTerminatedCs.name,\n type: 'logs',\n };\n case 'OOMKilled':\n return {\n errorType: 'OOMKilled',\n rootCauseExplanation: `The container \"${lastTerminatedCs.name}\" has crashed because it has tried to use more memory that it has been allocated`,\n actions: [\n `Increase the amount of memory assigned to the container`,\n 'Ensure the application is memory bounded and is not trying to consume too much memory',\n ],\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#exceed-a-container-s-memory-limit',\n type: 'docs',\n };\n default:\n return undefined;\n }\n};\n\nconst waitingProposedFix = (pod: Pod): ProposedFix | undefined => {\n const waitingCs = (pod.status?.containerStatuses ?? []).find(\n cs => cs.state?.waiting !== undefined,\n );\n\n const waiting = (pod.status?.containerStatuses ?? [])\n .map(cs => cs.state?.waiting)\n .find(w => w?.reason !== undefined);\n\n switch (waiting?.reason) {\n case 'InvalidImageName':\n return {\n errorType: 'InvalidImageName',\n rootCauseExplanation: 'The image in the pod is invalid',\n actions: ['Ensure the image name is correct and valid image name'],\n type: 'docs',\n docsLink:\n 'https://docs.docker.com/engine/reference/commandline/tag/#extended-description',\n };\n case 'ImagePullBackOff':\n return {\n errorType: 'ImagePullBackOff',\n rootCauseExplanation:\n 'The image either could not be found or Kubernetes does not have permission to pull it',\n actions: [\n 'Ensure the image name is correct',\n 'Ensure Kubernetes has permission to pull this image',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/concepts/containers/images/#imagepullbackoff',\n };\n case 'CrashLoopBackOff':\n return {\n errorType: 'CrashLoopBackOff',\n rootCauseExplanation: `The container ${waitingCs?.name} has crashed many times, it will be exponentially restarted until it stops crashing`,\n actions: ['Check the crash logs for stacktraces'],\n type: 'logs',\n container: waitingCs?.name ?? 'unknown',\n };\n case 'CreateContainerConfigError':\n return {\n errorType: 'CreateContainerConfigError',\n rootCauseExplanation:\n 'There is missing or mismatching configuration required to start the container',\n actions: [\n 'Ensure ConfigMaps references in the Deployment manifest are correct and the keys exist',\n 'Ensure Secrets references in the Deployment manifest are correct and the keys exist',\n ],\n type: 'docs',\n docsLink:\n 'https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/',\n };\n default:\n return undefined;\n }\n};\n\nconst podErrorMappers: ErrorMapper<Pod>[] = [\n {\n detectErrors: pod => {\n return podToContainerSpecsAndStatuses(pod)\n .filter(isPodReadinessProbeUnready)\n .map(cs => ({\n type: 'readiness-probe-taking-too-long',\n message: `The container ${cs.container.name} failed to start properly, but is not crashing`,\n severity: 4,\n proposedFix: readinessProbeProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.state?.waiting?.message !== undefined)\n .map(cs => ({\n type: 'container-waiting',\n message: cs.state?.waiting?.message ?? 'container waiting',\n severity: 4,\n proposedFix: waitingProposedFix(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n {\n detectErrors: pod => {\n return (pod.status?.containerStatuses ?? [])\n .filter(cs => cs.restartCount > 0)\n .map(cs => ({\n type: 'containers-restarting',\n message: `container=${cs.name} restarted ${cs.restartCount} times`,\n severity: 4,\n proposedFix: restartingPodProposedFixes(pod),\n sourceRef: {\n name: pod.metadata?.name ?? 'unknown pod',\n namespace: pod.metadata?.namespace ?? 'unknown namespace',\n kind: 'Pod',\n apiGroup: 'v1',\n },\n occurrenceCount: cs.restartCount,\n }));\n },\n },\n];\n\nexport const detectErrorsInPods = (pods: Pod[]): DetectedError[] =>\n detectErrorsInObjects(pods, podErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, ErrorMapper } from './types';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { detectErrorsInObjects } from './common';\n\nconst deploymentErrorMappers: ErrorMapper<Deployment>[] = [\n {\n detectErrors: deployment => {\n return (deployment.status?.conditions ?? [])\n .filter(c => c.status === 'False')\n .filter(c => c.message !== undefined)\n .map(c => ({\n type: 'condition-message-present',\n message: c.message ?? '',\n severity: 6,\n sourceRef: {\n name: deployment.metadata?.name ?? 'unknown hpa',\n namespace: deployment.metadata?.namespace ?? 'unknown namespace',\n kind: 'Deployment',\n apiGroup: 'apps/v1',\n },\n occurrenceCount: 1,\n }));\n },\n },\n];\n\nexport const detectErrorsInDeployments = (\n deployments: Deployment[],\n): DetectedError[] =>\n detectErrorsInObjects(deployments, deploymentErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { DetectedError, ErrorMapper } from './types';\nimport { detectErrorsInObjects } from './common';\n\nconst hpaErrorMappers: ErrorMapper<HorizontalPodAutoscaler>[] = [\n {\n detectErrors: hpa => {\n if ((hpa.spec?.maxReplicas ?? -1) === hpa.status?.currentReplicas) {\n return [\n {\n type: 'hpa-max-current-replicas',\n message: `Current number of replicas (${\n hpa.status?.currentReplicas\n }) is equal to the configured max number of replicas (${\n hpa.spec?.maxReplicas ?? -1\n })`,\n severity: 8,\n sourceRef: {\n name: hpa.metadata?.name ?? 'unknown hpa',\n namespace: hpa.metadata?.namespace ?? 'unknown namespace',\n kind: 'HorizontalPodAutoscaler',\n apiGroup: 'autoscaling/v1',\n },\n occurrenceCount: 1,\n },\n ];\n }\n return [];\n },\n },\n];\n\nexport const detectErrorsInHpa = (\n hpas: HorizontalPodAutoscaler[],\n): DetectedError[] => detectErrorsInObjects(hpas, hpaErrorMappers);\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DetectedError, DetectedErrorsByCluster } from './types';\nimport { ObjectsByEntityResponse } from '@backstage/plugin-kubernetes-common';\nimport { groupResponses } from '../util';\nimport { detectErrorsInPods } from './pods';\nimport { detectErrorsInDeployments } from './deployments';\nimport { detectErrorsInHpa } from './hpas';\nimport { Deployment } from 'kubernetes-models/apps/v1';\nimport { HorizontalPodAutoscaler } from 'kubernetes-models/autoscaling/v1';\nimport { Pod } from 'kubernetes-models/v1';\n\n/**\n * For each cluster try to find errors in each of the object types provided\n * returning a map of cluster names to errors in that cluster\n *\n * @public\n */\nexport const detectErrors = (\n objects: ObjectsByEntityResponse,\n): DetectedErrorsByCluster => {\n const errors: DetectedErrorsByCluster = new Map<string, DetectedError[]>();\n\n for (const clusterResponse of objects.items) {\n let clusterErrors: DetectedError[] = [];\n\n const groupedResponses = groupResponses(clusterResponse.resources);\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInPods(groupedResponses.pods as Pod[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInDeployments(groupedResponses.deployments as Deployment[]),\n );\n\n clusterErrors = clusterErrors.concat(\n detectErrorsInHpa(\n groupedResponses.horizontalPodAutoscalers as HorizontalPodAutoscaler[],\n ),\n );\n\n errors.set(clusterResponse.cluster.name, clusterErrors);\n }\n\n return errors;\n};\n"],"names":["_a","_b"],"mappings":";;;;AAqBO,MAAM,gCAAmC,GAAA,2BAAA;AAOzC,MAAM,mCACX,GAAA,iDAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,yCACX,GAAA,oCAAA;AAOK,MAAM,qCACX,GAAA,gCAAA;AAOK,MAAM,mCACX,GAAA,8BAAA;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ACA,eAAiB,EAAA,CAAA;AAAA,WACnB;AAAA,SACF,CAAA;AAAA,OACF;AACA,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,iBAAoB,GAAA,CAC/B,IACoB,KAAA,qBAAA,CAAsB,MAAM,eAAe,CAAA;;AClBpD,MAAA,YAAA,GAAe,CAC1B,OAC4B,KAAA;AAC5B,EAAM,MAAA,MAAA,uBAAsC,GAA6B,EAAA,CAAA;AAEzE,EAAW,KAAA,MAAA,eAAA,IAAmB,QAAQ,KAAO,EAAA;AAC3C,IAAA,IAAI,gBAAiC,EAAC,CAAA;AAEtC,IAAM,MAAA,gBAAA,GAAmB,cAAe,CAAA,eAAA,CAAgB,SAAS,CAAA,CAAA;AAEjE,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,kBAAA,CAAmB,iBAAiB,IAAa,CAAA;AAAA,KACnD,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,yBAAA,CAA0B,iBAAiB,WAA2B,CAAA;AAAA,KACxE,CAAA;AAEA,IAAA,aAAA,GAAgB,aAAc,CAAA,MAAA;AAAA,MAC5B,iBAAA;AAAA,QACE,gBAAiB,CAAA,wBAAA;AAAA,OACnB;AAAA,KACF,CAAA;AAEA,IAAA,MAAA,CAAO,GAAI,CAAA,eAAA,CAAgB,OAAQ,CAAA,IAAA,EAAM,aAAa,CAAA,CAAA;AAAA,GACxD;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-kubernetes-common",
|
|
3
3
|
"description": "Common functionalities for kubernetes, to be shared between kubernetes and kubernetes-backend plugin",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.4-next.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"luxon": "^3.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@backstage/cli": "^0.25.
|
|
51
|
+
"@backstage/cli": "^0.25.2-next.0"
|
|
52
52
|
},
|
|
53
53
|
"jest": {
|
|
54
54
|
"roots": [
|