Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 add k8s services to discovery #4211

Merged
merged 1 commit into from
Jun 14, 2024
Merged

🧹 add k8s services to discovery #4211

merged 1 commit into from
Jun 14, 2024

Conversation

vjeffrey
Copy link
Contributor

@vjeffrey vjeffrey commented Jun 10, 2024

Screenshot 2024-06-10 at 16 16 52

Copy link
Contributor

github-actions bot commented Jun 10, 2024

Test Results

3 071 tests  ±0   3 070 ✅ ±0   1m 39s ⏱️ +8s
  362 suites ±0       1 💤 ±0 
   27 files   ±0       0 ❌ ±0 

Results for commit cc2b26f. ± Comparison against base commit e331006.

♻️ This comment has been updated with latest results.

@vjeffrey vjeffrey marked this pull request as draft June 10, 2024 02:58
@vjeffrey vjeffrey force-pushed the vj/k8s-service-disc branch 3 times, most recently from a0756a1 to 9ba8213 Compare June 10, 2024 22:22
@vjeffrey vjeffrey marked this pull request as ready for review June 10, 2024 22:53
@@ -933,6 +996,10 @@ func createPlatformData(objectKind, runtime string) (*inventory.Platform, error)
platformData.Family = append(platformData.Family, "k8s-workload")
platformData.Name = "k8s-cronjob"
platformData.Title = "Kubernetes CronJob"
case "Service":
platformData.Family = append(platformData.Family, "k8s-workload")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A service is not really a workload. Perhaps we need a new family for this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imilchev Any ideas? Or should we go with k8s-service as its own family, like in k8s-ingress.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right, this should be k8s-service

@czunker
Copy link
Contributor

czunker commented Jun 11, 2024

Gave this a try. LGTM:

cnquery run k8s --namespaces "mondoo" -c "asset{ name platform }" 
→ loaded configuration from /etc/opt/mondoo/mondoo.yml using source default
...
asset: {
  platform: "k8s-service"
  name: "mondoo/service1"
}
asset: {
  platform: "k8s-service"
  name: "mondoo/service2"
}
...

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@imilchev imilchev force-pushed the vj/k8s-service-disc branch from 9ba8213 to cc2b26f Compare June 14, 2024 11:39
@imilchev imilchev merged commit fb8d771 into main Jun 14, 2024
15 checks passed
@imilchev imilchev deleted the vj/k8s-service-disc branch June 14, 2024 11:43
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants