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

Pull request to add arc customizations such as new Helm Collector #50

Closed
wants to merge 243 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
5f4fed4
introduce arcmode
Apr 19, 2021
d180a5d
remove secrets
Apr 19, 2021
eca2595
Merge branch 'arcmode' of https://github.com/sophsoph321/aks-periscop…
Apr 19, 2021
e2ee48e
Revert "Add v0.3 acr image for Private cluster fix. (#22)"
Apr 19, 2021
b1e0089
Revert "introduce arcmode"
Apr 19, 2021
95b3a1e
remove secrets
Apr 19, 2021
5bf63c6
add print statement
sophiezhaous Apr 21, 2021
cb92830
update print statement
Apr 21, 2021
2778362
committed
Apr 21, 2021
e7affaf
committed
Apr 21, 2021
1e80ec1
committed
Apr 21, 2021
b67a0fa
committed
Apr 21, 2021
7d81d43
remove print statements
Apr 22, 2021
ce24580
add helm collector
Apr 22, 2021
9b741a6
change helm command
Apr 23, 2021
1d9cff9
add helm 3 installation
Apr 25, 2021
268ba7f
add curl command installation
Apr 25, 2021
9e2a345
change helm command
Apr 25, 2021
fdc03e6
remove helm history
Apr 26, 2021
992e59a
debug helm history
Apr 26, 2021
2186027
add repo command
Apr 26, 2021
83d91bb
change stable repo name
Apr 26, 2021
cd92f6e
add write to file
Apr 26, 2021
a8eb77b
add kured
Apr 26, 2021
06176ca
change
Apr 26, 2021
61d471d
changes
Apr 26, 2021
0c6db9e
add default namespace
Apr 26, 2021
52dce6a
change
Apr 26, 2021
6f3596c
add integration test
Apr 27, 2021
0309fe5
changes
Apr 27, 2021
a99c118
add helm test
Apr 27, 2021
c9363b0
change print statement to error
Apr 27, 2021
a929c78
change
Apr 28, 2021
c214e98
more changes
Apr 28, 2021
a695c33
add go installation
Apr 28, 2021
bc0d9d6
fix unit test
Apr 28, 2021
67468ba
iptables to Helm
Apr 28, 2021
49097fb
add custom resource collector
Apr 28, 2021
3a294da
add new exporter, diagnoser, collector
Apr 30, 2021
f7cd853
comment unused variables
Apr 30, 2021
afd2cd4
debug exporter
Apr 30, 2021
78b8bcb
filenames
Apr 30, 2021
2171e29
test zip function
Apr 30, 2021
e3de431
list files
Apr 30, 2021
870954a
fmt to log
Apr 30, 2021
c558344
delete lines
Apr 30, 2021
f489938
changed
Apr 30, 2021
21d3464
get current directory
Apr 30, 2021
a272d4d
remove some print statements
Apr 30, 2021
1a62ca5
test zip
Apr 30, 2021
6b42980
changes
Apr 30, 2021
e9c6673
add windir check
Apr 30, 2021
7bb0e40
minor fix
Apr 30, 2021
bd0a19a
get hostname
Apr 30, 2021
2e216e4
add expose in dockerfile
Apr 30, 2021
28a0fb2
add exec collector
May 3, 2021
04eb41a
mitigate exit code 126
May 3, 2021
8321058
change curl url from example.com to dp endpoint
May 3, 2021
159389b
changes
May 3, 2021
c6cf4b3
uncomment exec
May 3, 2021
ec11a13
add new diagnoser
May 4, 2021
8854a1e
debugging
May 4, 2021
89a5670
debug
May 4, 2021
554bb00
debugging
May 4, 2021
b31ee18
remove print statements
May 4, 2021
8c99e0c
remove print
May 4, 2021
c11b92d
add back crd print statement
May 4, 2021
cebe225
change
May 4, 2021
74f4192
change
May 4, 2021
7756b03
update dataPoint name
May 4, 2021
dc1df7f
modify forloop
May 4, 2021
219a19c
add filename to datapoint
May 4, 2021
6bbd5bb
add back log prints
May 4, 2021
7d7f3d6
test
May 4, 2021
de696bb
add fields to diagnostic signal
May 4, 2021
7fc1c70
add config content to diagnoser
May 5, 2021
bdf9093
change format from yaml to json
May 5, 2021
5ca8823
add parameters for kubeobject config map
May 5, 2021
fe1a248
add helm customizations
May 5, 2021
5643b93
style changes
May 5, 2021
fa4aef5
remove secrets
Apr 19, 2021
a09a204
introduce arcmode
Apr 19, 2021
f78b90c
Revert "Add v0.3 acr image for Private cluster fix. (#22)"
Apr 19, 2021
56ec2c3
Revert "introduce arcmode"
Apr 19, 2021
a9f76f2
remove secrets
Apr 19, 2021
359b1e5
add print statement
sophiezhaous Apr 21, 2021
a8f09c0
update print statement
Apr 21, 2021
524a55a
committed
Apr 21, 2021
5a28f82
committed
Apr 21, 2021
7534023
committed
Apr 21, 2021
d1a8c31
committed
Apr 21, 2021
2891395
remove print statements
Apr 22, 2021
567c7de
add helm collector
Apr 22, 2021
e11df25
change helm command
Apr 23, 2021
b7989cc
add helm 3 installation
Apr 25, 2021
f007473
add curl command installation
Apr 25, 2021
7607863
change helm command
Apr 25, 2021
7ba08ee
remove helm history
Apr 26, 2021
03a7dcb
debug helm history
Apr 26, 2021
0c0605a
add repo command
Apr 26, 2021
b0f7100
change stable repo name
Apr 26, 2021
6b87886
add write to file
Apr 26, 2021
ef78301
add kured
Apr 26, 2021
bdac0d2
change
Apr 26, 2021
8348250
changes
Apr 26, 2021
12d70ef
add default namespace
Apr 26, 2021
0ef4f4b
change
Apr 26, 2021
4f54c9b
add integration test
Apr 27, 2021
bd2ffcd
changes
Apr 27, 2021
378f672
add helm test
Apr 27, 2021
81a3e9f
change print statement to error
Apr 27, 2021
b2c6842
change
Apr 28, 2021
457f9d6
more changes
Apr 28, 2021
6b448cf
add go installation
Apr 28, 2021
e652f57
fix unit test
Apr 28, 2021
fc88892
iptables to Helm
Apr 28, 2021
cbcb1a7
add custom resource collector
Apr 28, 2021
a9a19e1
add new exporter, diagnoser, collector
Apr 30, 2021
cbaa99f
comment unused variables
Apr 30, 2021
8ee28c3
debug exporter
Apr 30, 2021
6e20dc9
filenames
Apr 30, 2021
0f61f17
test zip function
Apr 30, 2021
eca251e
list files
Apr 30, 2021
d3d8ff7
fmt to log
Apr 30, 2021
2c93f32
delete lines
Apr 30, 2021
5d4dde8
changed
Apr 30, 2021
232ba3c
get current directory
Apr 30, 2021
a0fac57
remove some print statements
Apr 30, 2021
1f7c3b0
test zip
Apr 30, 2021
c6cc2e3
changes
Apr 30, 2021
f957def
add windir check
Apr 30, 2021
675c38d
minor fix
Apr 30, 2021
8ca4e4b
get hostname
Apr 30, 2021
bb5b805
add expose in dockerfile
Apr 30, 2021
2c73e84
add exec collector
May 3, 2021
e18577d
mitigate exit code 126
May 3, 2021
e898f97
change curl url from example.com to dp endpoint
May 3, 2021
b680847
changes
May 3, 2021
06707ee
uncomment exec
May 3, 2021
5677ec7
add new diagnoser
May 4, 2021
81193d5
debugging
May 4, 2021
3c5ba55
debug
May 4, 2021
2f8b9af
debugging
May 4, 2021
e9f71a4
remove print statements
May 4, 2021
427ad9e
remove print
May 4, 2021
6ce38ba
add back crd print statement
May 4, 2021
c31cebe
change
May 4, 2021
6f033cb
change
May 4, 2021
9d5ae81
update dataPoint name
May 4, 2021
be255dd
modify forloop
May 4, 2021
4c61dae
add filename to datapoint
May 4, 2021
f800fd1
add back log prints
May 4, 2021
5d4d340
test
May 4, 2021
ddae744
add fields to diagnostic signal
May 4, 2021
49a2c97
add config content to diagnoser
May 5, 2021
5d56b73
change format from yaml to json
May 5, 2021
70b94b8
add parameters for kubeobject config map
May 5, 2021
527f1d1
add helm customizations
May 5, 2021
944355e
style changes
May 5, 2021
f703262
changes after go mod vendor
May 5, 2021
fadad7a
Merge branch 'helm_collector' of https://github.com/sophsoph321/aks-p…
May 5, 2021
9c94df1
remove vendor directory
May 5, 2021
faa3f50
Merge branch 'helm_collector' of https://github.com/sophsoph321/aks-p…
May 5, 2021
dedd1dc
remove vendor directory
May 5, 2021
8b31a01
changes after go mod vendor
May 5, 2021
028eccd
resolve merge conflicts
May 5, 2021
4eb6a87
resolve merge conflicts
May 5, 2021
cf80b52
resolve merge conflicts
May 5, 2021
4814e92
resolve merge conflicts
May 5, 2021
451e7f9
resolve merge conflicts
May 5, 2021
f6f41d6
add print statement
sophiezhaous Apr 21, 2021
d8c6862
update print statement
Apr 21, 2021
c0e3547
committed
Apr 21, 2021
c7a448b
committed
Apr 21, 2021
ac3367b
committed
Apr 21, 2021
eb37e5a
committed
Apr 21, 2021
68df5fb
remove print statements
Apr 22, 2021
392ca8c
resolve merge conflicts
May 5, 2021
60f131f
change helm command
Apr 23, 2021
425c506
resolve merge conflicts
May 5, 2021
92d9472
change helm command
Apr 25, 2021
52e8bc7
remove helm history
Apr 26, 2021
43220e7
debug helm history
Apr 26, 2021
2bc8267
add repo command
Apr 26, 2021
2386cbb
change stable repo name
Apr 26, 2021
509c2ff
add write to file
Apr 26, 2021
74d7686
add kured
Apr 26, 2021
11f26a6
change
Apr 26, 2021
2e4c385
changes
Apr 26, 2021
d7ce070
add default namespace
Apr 26, 2021
cddc7e3
change
Apr 26, 2021
2ef9320
add integration test
Apr 27, 2021
6ba8466
changes
Apr 27, 2021
4eecce4
add helm test
Apr 27, 2021
b292d75
change print statement to error
Apr 27, 2021
9e361fd
change
Apr 28, 2021
9b305de
more changes
Apr 28, 2021
d60a879
add go installation
Apr 28, 2021
921dcf8
fix unit test
Apr 28, 2021
99fac51
iptables to Helm
Apr 28, 2021
0843f3d
resolve merge conflicts
May 5, 2021
948593b
resolve merge conflicts
May 5, 2021
f2df1ef
comment unused variables
Apr 30, 2021
ab45895
debug exporter
Apr 30, 2021
2d9aa19
filenames
Apr 30, 2021
557c2b8
test zip function
Apr 30, 2021
f84fd8f
list files
Apr 30, 2021
9adcfd3
fmt to log
Apr 30, 2021
77f39a7
delete lines
Apr 30, 2021
a4cf81d
changed
Apr 30, 2021
5d2b8d8
get current directory
Apr 30, 2021
94ba100
remove some print statements
Apr 30, 2021
9e05ac3
test zip
Apr 30, 2021
2a47911
changes
Apr 30, 2021
46d2fc9
add windir check
Apr 30, 2021
0cb55a7
minor fix
Apr 30, 2021
6235f83
get hostname
Apr 30, 2021
366496b
add expose in dockerfile
Apr 30, 2021
3ddc790
resolve merge conflicts
May 5, 2021
046fa73
resolve merge conflicts
May 5, 2021
71a8b24
resolve merge conflicts
May 5, 2021
b962875
add new diagnoser
May 4, 2021
b346089
debugging
May 4, 2021
4adcc41
debug
May 4, 2021
016590a
debugging
May 4, 2021
48be842
remove print statements
May 4, 2021
0993bff
remove print
May 4, 2021
2fce38a
add back crd print statement
May 4, 2021
4ffe653
change
May 4, 2021
171e0e4
change
May 4, 2021
4c33f10
update dataPoint name
May 4, 2021
0757757
modify forloop
May 4, 2021
dcbe9ee
add filename to datapoint
May 4, 2021
c77aa9f
add back log prints
May 4, 2021
4dbecf2
test
May 4, 2021
ef5c771
add fields to diagnostic signal
May 4, 2021
f800964
add config content to diagnoser
May 5, 2021
14aca7d
change format from yaml to json
May 5, 2021
94c63dc
add parameters for kubeobject config map
May 5, 2021
700154e
resolve merge conflicts
May 5, 2021
d734ffb
style changes
May 5, 2021
4b37b17
remove vendor directory
May 5, 2021
c8d39ec
Merge branch 'helm_collector' of https://github.com/sophsoph321/aks-p…
May 5, 2021
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
5 changes: 5 additions & 0 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor github.com/Azure/aks-periscope

FROM alpine
RUN apk --no-cache add ca-certificates
RUN apk add curl openssl bash --no-cache
ADD https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl /usr/local/bin/kubectl
RUN chmod +x /usr/local/bin/kubectl
RUN curl -fsSl -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
RUN chmod +x get_helm.sh
RUN ./get_helm.sh

RUN mkdir /app
WORKDIR /app
COPY --from=builder /app/aks-periscope .
Expand Down
35 changes: 26 additions & 9 deletions cmd/aks-periscope/aks-periscope.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"log"
"os"
"strings"
"sync"

Expand All @@ -22,25 +23,37 @@ func main() {
log.Printf("Failed to create CRD: %+v", err)
}

clusterType := os.Getenv("CLUSTER_TYPE")

storageAccount := os.Getenv("AZURE_BLOB_ACCOUNT_NAME")
log.Printf("Storage Account: %s", storageAccount)
collectors := []interfaces.Collector{}
containerLogsCollector := collector.NewContainerLogsCollector(exporter)
collectors = append(collectors, containerLogsCollector)
systemLogsCollector := collector.NewSystemLogsCollector(exporter)
collectors = append(collectors, systemLogsCollector)
networkOutboundCollector := collector.NewNetworkOutboundCollector(5, exporter)
collectors = append(collectors, networkOutboundCollector)
ipTablesCollector := collector.NewIPTablesCollector(exporter)
collectors = append(collectors, ipTablesCollector)
nodeLogsCollector := collector.NewNodeLogsCollector(exporter)
collectors = append(collectors, nodeLogsCollector)
dnsCollector := collector.NewDNSCollector(exporter)
collectors = append(collectors, dnsCollector)
kubeObjectsCollector := collector.NewKubeObjectsCollector(exporter)
collectors = append(collectors, kubeObjectsCollector)

systemLogsCollector := collector.NewSystemLogsCollector(exporter)
ipTablesCollector := collector.NewIPTablesCollector(exporter)
nodeLogsCollector := collector.NewNodeLogsCollector(exporter)
kubeletCmdCollector := collector.NewKubeletCmdCollector(exporter)
collectors = append(collectors, kubeletCmdCollector)
systemPerfCollector := collector.NewSystemPerfCollector(exporter)
collectors = append(collectors, systemPerfCollector)

helmCollector := collector.NewHelmCollector(exporter)

if clusterType == "connectedcluster" {
collectors = append(collectors, helmCollector)
} else {
collectors = append(collectors, systemLogsCollector)
collectors = append(collectors, ipTablesCollector)
collectors = append(collectors, nodeLogsCollector)
collectors = append(collectors, kubeletCmdCollector)
collectors = append(collectors, systemPerfCollector)
}

for _, c := range collectors {
waitgroup.Add(1)
Expand All @@ -63,9 +76,12 @@ func main() {
waitgroup.Wait()

diagnosers := []interfaces.Diagnoser{}
diagnosers = append(diagnosers, diagnoser.NewNetworkConfigDiagnoser(dnsCollector, kubeletCmdCollector, exporter))
diagnosers = append(diagnosers, diagnoser.NewNetworkOutboundDiagnoser(networkOutboundCollector, exporter))

if clusterType != "connectedcluster" {
diagnosers = append(diagnosers, diagnoser.NewNetworkConfigDiagnoser(dnsCollector, kubeletCmdCollector, exporter))
}

for _, d := range diagnosers {
waitgroup.Add(1)
go func(d interfaces.Diagnoser) {
Expand All @@ -80,6 +96,7 @@ func main() {
if err != nil {
log.Printf("Diagnoser: %s, export data failed: %+v\n", d.GetName(), err)
}

waitgroup.Done()
}(d)
}
Expand Down
35 changes: 28 additions & 7 deletions deployment/aks-periscope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ kind: ClusterRole
metadata:
name: aks-periscope-role
rules:
- apiGroups: ["","metrics.k8s.io"]
resources: ["pods", "nodes"]
- apiGroups: ["","metrics.k8s.io", "apiextensions.k8s.io"]
resources: ["pods", "nodes", "customresourcedefinitions", "secrets"]
verbs: ["get", "watch", "list"]
- apiGroups: ["aks-periscope.azure.github.com"]
- apiGroups: ["aks-periscope.azure.github.com", ]
resources: ["diagnostics"]
verbs: ["get", "watch", "list", "create", "patch"]
---
Expand Down Expand Up @@ -69,13 +69,17 @@ spec:
beta.kubernetes.io/os: linux
containers:
- name: aks-periscope
image: aksrepos.azurecr.io/staging/aks-periscope:v0.3
image: periscopedev.azurecr.io/sophiezhao:latest
securityContext:
privileged: true
imagePullPolicy: Always
envFrom:
- configMapRef:
name: clustertype-config
- configMapRef:
name: containerlogs-config
- configMapRef:
name: exec-config
- configMapRef:
name: kubeobjects-config
- configMapRef:
Expand Down Expand Up @@ -107,22 +111,39 @@ type: Opaque
data:
AZURE_BLOB_ACCOUNT_NAME: # <accountName, base64 encoded>
AZURE_BLOB_SAS_KEY: # <saskey, base64 encoded>

---
apiVersion: v1
kind: ConfigMap
metadata:
name: containerlogs-config
namespace: aks-periscope
data:
DIAGNOSTIC_CONTAINERLOGS_LIST: kube-system
DIAGNOSTIC_CONTAINERLOGS_LIST: azure-arc
---
apiVersion: v1
kind: ConfigMap
metadata:
name: clustertype-config
namespace: aks-periscope
data:
CLUSTER_TYPE: connectedcluster
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kubeobjects-config
namespace: aks-periscope
data:
DIAGNOSTIC_KUBEOBJECTS_LIST: azure-arc/pod azure-arc/service azure-arc/deployment azure-arc/crd azure-arc/configmap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kubeobjects-config
namespace: aks-periscope
data:
DIAGNOSTIC_KUBEOBJECTS_LIST: kube-system/pod kube-system/service kube-system/deployment
DIAGNOSTIC_KUBEOBJECTS_LIST: azure-arc/pod azure-arc/service azure-arc/deployment azure-arc/crd azure-arc/configmap
---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -159,4 +180,4 @@ spec:
singular: diagnostic
kind: Diagnostic
shortNames:
- apd
- apd
17 changes: 6 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
module github.com/Azure/aks-periscope

go 1.16

require (
github.com/Azure/azure-storage-blob-go v0.7.0
github.com/Microsoft/go-winio v0.4.13 // indirect
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/docker v1.13.1 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/onsi/gomega v1.11.0 // indirect
github.com/opencontainers/go-digest v1.0.0-rc1 // indirect
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 // indirect
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/onsi/gomega v1.11.0
github.com/pkg/errors v0.8.1 // indirect
)
59 changes: 26 additions & 33 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ github.com/Azure/azure-pipeline-go v0.2.1 h1:OLBdZJ3yvOn2MezlWvbrBMTEUQC72zAftRZ
github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4=
github.com/Azure/azure-storage-blob-go v0.7.0 h1:MuueVOYkufCxJw5YZzF842DY2MBsp+hLuh2apKY0mck=
github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4=
github.com/Microsoft/go-winio v0.4.13 h1:Hmi80lzZuI/CaYmlJp/b+FjZdRZhKu9c2mDVqKlLWVs=
github.com/Microsoft/go-winio v0.4.13/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug=
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v1.13.1 h1:IkZjBSIc8hBjLpqeAbeE5mca5mNgeatLHBy3GO78BWo=
github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q=
github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg=
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
Expand All @@ -29,47 +28,39 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149 h1:HfxbT6/JcvIljmERptWhwa8XzP7H3T+Z2N26gTsaDaA=
github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc=
github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.11.0 h1:+CqWgvj0OZycCaqclBD1pxKHAU+tOkHmQIWvDHq2aug=
github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg=
github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU=
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 h1:Ao/3l156eZf2AW5wK8a7/smtodRU+gha3+BeqJ69lRk=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI=
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand All @@ -82,8 +73,10 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
4 changes: 3 additions & 1 deletion pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const (
DNS Type = iota
// ContainerLogs defines ContainerLogs Collector Type
ContainerLogs
//Helm defines Helm Collector Type
Helm
// IPTables defines IPTables Collector Type
IPTables
// KubeletCmd defines KubeletCmd Collector Type
Expand All @@ -28,7 +30,7 @@ const (

// Name returns type name
func (t Type) name() string {
return [...]string{"dns", "containerlogs", "iptables", "kubeletcmd", "kubeobjects", "networkoutbound", "nodelogs", "systemlogs", "systemperf"}[t]
return [...]string{"dns", "containerlogs", "helm", "iptables", "kubeletcmd", "kubeobjects", "networkoutbound", "nodelogs", "systemlogs", "systemperf"}[t]
}

// BaseCollector defines Base Collector
Expand Down
60 changes: 60 additions & 0 deletions pkg/collector/helm_collector.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package collector

import (
"path/filepath"

"github.com/Azure/aks-periscope/pkg/interfaces"
"github.com/Azure/aks-periscope/pkg/utils"
)

// HelmCollector defines a Helm Collector struct
type HelmCollector struct {
BaseCollector
}

var _ interfaces.Collector = &HelmCollector{}

// NewHelmCollector is a constructor
func NewHelmCollector(exporter interfaces.Exporter) *HelmCollector {
return &HelmCollector{
BaseCollector: BaseCollector{
collectorType: Helm,
exporter: exporter,
},
}
}

// Collect implements the interface method
func (collector *HelmCollector) Collect() error {
rootPath, err := utils.CreateCollectorDir(collector.GetName())
if err != nil {
return err
}

helmListFile := filepath.Join(rootPath, "helm_list")
output, err := utils.RunCommandOnContainer("helm", "list", "--all-namespaces")
if err != nil {
return err
}

err = utils.WriteToFile(helmListFile, output)
if err != nil {
return err
}

collector.AddToCollectorFiles(helmListFile)

helmHistoryFile := filepath.Join(rootPath, collector.GetName())
output, err = utils.RunCommandOnContainer("helm", "history", "-n", "default", "azure-arc")
if err != nil {
return err
}

err = utils.WriteToFile(helmHistoryFile, output)
if err != nil {
return err
}

collector.AddToCollectorFiles(helmHistoryFile)
return nil
}
6 changes: 4 additions & 2 deletions pkg/diagnoser/diagnoser.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import "github.com/Azure/aks-periscope/pkg/interfaces"
type Type int

const (
//ConfigValidator defines ConfigValidator Diagnoser Type
ConfigValidator Type = iota
// NetworkConfig defines NetworkConfig Diagnoser Type
NetworkConfig Type = iota
NetworkConfig
// NetworkOutbound defines NetworkOutbound Diagnoser Type
NetworkOutbound
)

// Name returns type name
func (t Type) name() string {
return [...]string{"networkconfig", "networkoutbound"}[t]
return [...]string{"configvalidator", "networkconfig", "networkoutbound"}[t]
}

// BaseDiagnoser defines Base Diagnoser
Expand Down
Loading