Skip to content

Commit

Permalink
Updated helm collector to leverage helm client for go
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Tincelin committed Aug 4, 2021
1 parent 2ea86f0 commit 4090f71
Show file tree
Hide file tree
Showing 6 changed files with 1,228 additions and 21 deletions.
4 changes: 0 additions & 4 deletions builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ RUN apk --no-cache add ca-certificates curl openssl bash
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 \
&& chmod +x get_helm.sh \
&& ./get_helm.sh

COPY --from=builder /build/aks-periscope /

ENTRYPOINT ["/aks-periscope"]
10 changes: 8 additions & 2 deletions cmd/aks-periscope/aks-periscope.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/Azure/aks-periscope/pkg/exporter"
"github.com/Azure/aks-periscope/pkg/interfaces"
"github.com/Azure/aks-periscope/pkg/utils"
restclient "k8s.io/client-go/rest"
)

func main() {
Expand All @@ -36,10 +37,15 @@ func main() {
// We need the cert in order to communicate with the storage account.
if utils.IsAzureStackCloud() {
if err := utils.CopyFileFromHost("/etc/ssl/certs/azsCertificate.pem", "/etc/ssl/certs/azsCertificate.pem"); err != nil {
log.Fatalf("cannot copy cert for Azure Stack Cloud environment: %v", err)
log.Fatalf("Cannot copy cert for Azure Stack Cloud environment: %v", err)
}
}

config, err := restclient.InClusterConfig()
if err != nil {
log.Fatalf("Cannot load kubeconfig: %v", err)
}

dataProducers := []interfaces.DataProducer{}

containerLogsCollector := collector.NewContainerLogsCollector()
Expand All @@ -51,7 +57,7 @@ func main() {
nodeLogsCollector := collector.NewNodeLogsCollector()
kubeletCmdCollector := collector.NewKubeletCmdCollector()
systemPerfCollector := collector.NewSystemPerfCollector()
helmCollector := collector.NewHelmCollector()
helmCollector := collector.NewHelmCollector(config)
osmCollector := collector.NewOsmCollector()
smiCollector := collector.NewSmiCollector()

Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ require (
github.com/Azure/go-autorest/autorest/adal v0.9.14 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/onsi/gomega v1.13.0
github.com/pkg/errors v0.9.1 // indirect
helm.sh/helm/v3 v3.6.3
k8s.io/cli-runtime v0.21.3
k8s.io/client-go v0.21.3
rsc.io/letsencrypt v0.0.3 // indirect
)
Loading

0 comments on commit 4090f71

Please sign in to comment.