Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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: 6 additions & 0 deletions deploy/charts/disco-agent/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,9 @@ data:
resource-type:
version: v1
resource: pods
- kind: k8s-dynamic
name: ark/configmaps
config:
resource-type:
version: v1
resource: configmaps
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ custom-cluster-description:
resource-type:
version: v1
resource: pods
- kind: k8s-dynamic
name: ark/configmaps
config:
resource-type:
version: v1
resource: configmaps
kind: ConfigMap
metadata:
labels:
Expand Down Expand Up @@ -202,6 +208,12 @@ custom-cluster-name:
resource-type:
version: v1
resource: pods
- kind: k8s-dynamic
name: ark/configmaps
config:
resource-type:
version: v1
resource: configmaps
kind: ConfigMap
metadata:
labels:
Expand Down Expand Up @@ -309,6 +321,12 @@ custom-period:
resource-type:
version: v1
resource: pods
- kind: k8s-dynamic
name: ark/configmaps
config:
resource-type:
version: v1
resource: configmaps
kind: ConfigMap
metadata:
labels:
Expand Down Expand Up @@ -416,6 +434,12 @@ defaults:
resource-type:
version: v1
resource: pods
- kind: k8s-dynamic
name: ark/configmaps
config:
resource-type:
version: v1
resource: configmaps
kind: ConfigMap
metadata:
labels:
Expand Down
8 changes: 8 additions & 0 deletions examples/machinehub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,11 @@ data-gatherers:
resource-type:
version: v1
resource: pods

# Gather Kubernetes configmaps
- name: ark/configmaps
kind: "k8s-dynamic"
config:
resource-type:
version: v1
resource: configmaps
6 changes: 6 additions & 0 deletions examples/machinehub/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
"items": []
}
},
{
"data-gatherer": "ark/configmaps",
"data": {
"items": []
}
},
{
"data-gatherer": "ark/serviceaccounts",
"data": {
Expand Down
2 changes: 2 additions & 0 deletions internal/cyberark/dataupload/dataupload.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ type Snapshot struct {
Daemonsets []runtime.Object `json:"daemonsets"`
// Pods is a list of Pod resources in the cluster.
Pods []runtime.Object `json:"pods"`
// ConfigMaps is a list of ConfigMap resources in the cluster.
ConfigMaps []runtime.Object `json:"configmaps"`
}

// PutSnapshot PUTs the supplied snapshot to an [AWS presigned URL] which it obtains via the CyberArk inventory API.
Expand Down
3 changes: 3 additions & 0 deletions pkg/client/client_cyberark.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ var defaultExtractorFunctions = map[string]func(*api.DataReading, *dataupload.Sn
"ark/pods": func(r *api.DataReading, s *dataupload.Snapshot) error {
return extractResourceListFromReading(r, &s.Pods)
},
"ark/configmaps": func(r *api.DataReading, s *dataupload.Snapshot) error {
return extractResourceListFromReading(r, &s.ConfigMaps)
},
}

// convertDataReadings processes a list of DataReadings using the provided
Expand Down
1 change: 1 addition & 0 deletions pkg/client/client_cyberark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ var defaultDynamicDatagathererNames = []string{
"ark/statefulsets",
"ark/daemonsets",
"ark/pods",
"ark/configmaps",
}

// fakeReadings returns a set of fake readings that includes a discovery reading
Expand Down
3 changes: 3 additions & 0 deletions pkg/datagatherer/k8s/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ var kubernetesNativeResources = map[schema.GroupVersionResource]sharedInformerFu
corev1.SchemeGroupVersion.WithResource("pods"): func(sharedFactory informers.SharedInformerFactory) k8scache.SharedIndexInformer {
return sharedFactory.Core().V1().Pods().Informer()
},
corev1.SchemeGroupVersion.WithResource("configmaps"): func(sharedFactory informers.SharedInformerFactory) k8scache.SharedIndexInformer {
return sharedFactory.Core().V1().ConfigMaps().Informer()
},
corev1.SchemeGroupVersion.WithResource("nodes"): func(sharedFactory informers.SharedInformerFactory) k8scache.SharedIndexInformer {
return sharedFactory.Core().V1().Nodes().Informer()
},
Expand Down
Loading