Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Rebase with updated structure
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelKatsoulis committed Mar 8, 2023
1 parent 173686a commit fb98440
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 52 deletions.
10 changes: 5 additions & 5 deletions deploy/inputrunner-kubernetes-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: inputrunner
image: inputrunner:latest
imagePullPolicy: Never
image: michaelkatsoulis/inputrunner:latest
# imagePullPolicy: Never
# command: ['sleep 3600']
env:
# The basic authentication username used to connect to Elasticsearch
Expand All @@ -57,13 +57,13 @@ spec:
value: "elastic"
# The basic authentication password used to connect to Elasticsearch
- name: ELASTICSEARCH_PASSWORD
value: "changeme"
value: "OzZGqri8fWfSwZrV5Ht5VtYn"
# The Elasticsearch host to communicate with
- name: ELASTICSEARCH_HOST
value: "https://elasticsearch"
value: "https://snapshot-fd497c.es.us-west2.gcp.elastic-cloud.com"
# The Elasticsearch port to communicate with
- name: ELASTICSEARCH_PORT
value: "9200"
value: "443"
volumeMounts:
- name: config
mountPath: /usr/share/inputrunner/inputrunner.yml
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
// specific language governing permissions and limitations
// under the License.

package assets_k8s
package k8s

import (
"context"
"fmt"
"time"

"github.com/elastic/inputrunner/input/assets"
input "github.com/elastic/inputrunner/input/v2"
stateless "github.com/elastic/inputrunner/input/v2/input-stateless"

Expand Down Expand Up @@ -62,14 +63,14 @@ func newAssetsK8s(cfg config) (*assetsK8s, error) {
}

type config struct {
BaseConfig `config:",inline"`
KubeConfig string `config:"kube_config"`
Period time.Duration `config:"period"`
assets.BaseConfig `config:",inline"`
KubeConfig string `config:"kube_config"`
Period time.Duration `config:"period"`
}

func defaultConfig() config {
return config{
BaseConfig: BaseConfig{
BaseConfig: assets.BaseConfig{
Period: time.Second * 600,
AssetTypes: nil,
},
Expand Down Expand Up @@ -140,11 +141,11 @@ func collectK8sAssets(ctx context.Context, kubeconfigPath string, log *logp.Logg
log.Errorf("unable to build kubernetes clientset: %w", err)
}
log.Infof("Enabled asset types are %+v", cfg.AssetTypes)
if IsTypeEnabled(cfg.AssetTypes, "node") {
if assets.IsTypeEnabled(cfg.AssetTypes, "node") {
log.Info("Node type enabled. Starting collecting")
go collectK8sNodes(ctx, log, client, publisher)
}
if IsTypeEnabled(cfg.AssetTypes, "pod") {
if assets.IsTypeEnabled(cfg.AssetTypes, "pod") {
log.Info("Pod type enabled. Starting collecting")
go collectK8sPods(ctx, log, client, publisher)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

package assets_k8s
package k8s

import (
"testing"
Expand Down
39 changes: 0 additions & 39 deletions input/assets_k8s/config.go

This file was deleted.

0 comments on commit fb98440

Please sign in to comment.