Skip to content

Support for additional standard resources? #38

@evandam

Description

@evandam

Detailed Description

Hi folks 👋 I know the k8sobject and k8sobjects resources work for just about everything, but I was curious if there were plans to support other standard resources.

For example some that I can think of that might be useful:

  • k8s_secret
  • k8s_statefulset
  • k8s_service
  • k8s_ingress
  • k8s_ingressclass
  • k8s_persistentvolumeclaim
  • k8s_storageclass
  • k8s_serviceaccount
  • k8s_rbac_role
  • k8s_rbac_rolebinding
  • k8s_rbac_cluster_rolebinding
  • ...

Context

It would make profiles cleaner and more readable with more straightforward resources.

For example:

describe k8sobject(api: 'networking.k8s.io/v1', type: 'ingresses', namespace: 'haproxy', name: 'haproxy') do
  it { should exist }
end

# Compared to

describe k8s_ingress(namespace: 'haproxy', name: 'haproxy') do
  it { should exist }
end

Possible Implementation

I'd imagine it's a matter of copy/paste from something like https://github.com/inspec/inspec-k8s/blob/main/libraries/k8s_deployment.rb / https://github.com/inspec/inspec-k8s/blob/main/libraries/k8s_deployments.rb - tedious for sure but maybe worth while?

Thanks in advance 🙌

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions