Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Kubernetes Enhancement 2.2.1 #72

Merged
merged 23 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- name: Check out code repository source code
uses: actions/checkout@v2
Expand All @@ -43,13 +43,13 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14]
node: [18]

steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- name: Check out repo
uses: actions/checkout@v2
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,24 @@ and this project adheres to

## [Unreleased]

## 2.1.0 - 2024-06-18

### Changed

- Updated kube_container_spec entity
- Updated JupiterOne SDk from v8.22.6 to v12.8.3

### Added

- Added new relationships.

| Source Entity `_type` | Relationship `_class` | Target Entity `_type` |
| --------------------- | --------------------- | --------------------- |
| `kube_container_spec` | **HAS** | `kube_cron_job` |
| `kube_container_spec` | **HAS** | `kube_daemon_set` |
| `kube_container_spec` | **HAS** | `kube_job` |
| `kube_container_spec` | **HAS** | `kube_replica_set` |

## 2.1.0 - 2024-03-22

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-bullseye-slim
FROM node:18-bullseye-slim

ARG j1_dev_enabled=false

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Learn about the data ingested, benefits of this integration, and how to use it
with JupiterOne in the [integration documentation](docs/jupiterone.md).

## Development
## Development

### Prerequisites

Expand Down
8 changes: 6 additions & 2 deletions docs/jupiterone.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,12 @@ The following relationships are created:
| `kube_cluster` | **CONTAINS** | `kube_cluster_role_binding` |
| `kube_cluster` | **CONTAINS** | `kube_namespace` |
| `kube_container_spec` | **USES** | `kube_volume` |
| `kube_cron_job` | **USES** | `kube_container_spec` |
| `kube_cron_job` | **MANAGES** | `kube_job` |
| `kube_deployment` | **MANAGES** | `kube_replica_set` |
| `kube_daemon_set` | **USES** | `kube_container_spec` |
| `kube_deployment` | **USES** | `kube_container_spec` |
| `kube_deployment` | **MANAGES** | `kube_replica_set` |
| `kube_job` | **USES** | `kube_container_spec` |
| `kube_job` | **MANAGES** | `kube_pod` |
| `kube_namespace` | **CONTAINS** | `kube_config_map` |
| `kube_namespace` | **CONTAINS** | `kube_cron_job` |
Expand All @@ -250,8 +253,9 @@ The following relationships are created:
| `kube_node` | **HAS** | `kube_image` |
| `kube_node` | **HAS** | `kube_pod` |
| `kube_pod` | **CONTAINS** | `kube_container` |
| `kube_replica_set` | **MANAGES** | `kube_pod` |
| `kube_replica_set` | **USES** | `kube_container_spec` |
| `kube_replica_set` | **USES** | `kube_image` |
| `kube_replica_set` | **MANAGES** | `kube_pod` |
| `kube_stateful_set` | **MANAGES** | `kube_pod` |

### Mapped Relationships
Expand Down
7 changes: 6 additions & 1 deletion husky.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
module.exports = require('@jupiterone/integration-sdk-dev-tools/config/husky');
module.exports = {
hooks: {
'pre-commit': `npx j1-integration document && git add docs/jupiterone.md && lint-staged && npx prettier --write docs/jupiterone.md && git add docs/jupiterone.md`,
'pre-push': 'npm run prepush',
},
};
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"publishConfig": {
"access": "public"
},
"engines": {
"node": ">=18.0.0 <19.x"
},
"scripts": {
"start": "LOAD_KUBERNETES_CONFIG_FROM_DEFAULT=true yarn execute",
"execute": "./scripts/run.sh",
Expand All @@ -32,15 +35,16 @@
"prepack": "yarn build"
},
"devDependencies": {
"@jupiterone/integration-sdk-testing": "^8.22.6",
"@jupiterone/integration-sdk-cli": "12.8.3",
"@jupiterone/integration-sdk-dev-tools": "12.8.3",
"@jupiterone/integration-sdk-testing": "12.8.3",
"@types/node": "^20.11.0"
},
"dependencies": {
"@jupiterone/integration-sdk-dev-tools": "^8.22.6",
"@kubernetes/client-node": "^0.20.0",
"node-fetch": "2.6.1"
},
"peerDependencies": {
"@jupiterone/integration-sdk-core": "^8.22.6"
"@jupiterone/integration-sdk-core": "^12.8.3"
}
}
12 changes: 12 additions & 0 deletions src/getStepStartStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ export default async function getStepStartStates(
[IntegrationSteps.NODES]: {
disabled: nodesDisabled,
},
[IntegrationSteps.CONTAINER_SPEC_HAS_JOB]: {
disabled: jobsDisabled,
},
[IntegrationSteps.CONTAINER_SPEC_HAS_DAEMONSET]: {
disabled: daemonsetsDisabled,
},
[IntegrationSteps.CONTAINER_SPEC_HAS_REPLICASET]: {
disabled: replicasetsDisabled,
},
[IntegrationSteps.CONTAINER_SPEC_HAS_CRON_JOB]: {
disabled: cronJobsDisabled,
},
[IntegrationSteps.PODS]: {
disabled: !(
instance.accountId == '0c51143d-9728-4f42-8442-4b52be5e8a74' ||
Expand Down
10 changes: 5 additions & 5 deletions src/steps/clusters/__snapshots__/converters.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`#createClusterEntity should convert data 1`] = `
Object {
"_class": Array [
{
"_class": [
"Cluster",
],
"_key": "kube_cluster:dummy-data",
"_rawData": Array [
Object {
"_rawData": [
{
"name": "default",
"rawData": Object {
"rawData": {
"name": "dummy-data",
"server": "dummy-data",
"skipTLSVerify": false,
Expand Down
Loading
Loading