Skip to content
Merged
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
2 changes: 0 additions & 2 deletions chart/searchlight/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ spec:
- --v={{ .Values.logLevel }}
- --config-dir=/srv
- --config-secret-name={{ template "searchlight.fullname" . }}
- --ops-address=:56790
- --secure-port=8443
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
- --enable-analytics={{ .Values.enableAnalytics }}
ports:
- containerPort: 8443
- containerPort: 56790
volumeMounts:
- mountPath: /srv
name: data
Expand Down
3 changes: 0 additions & 3 deletions chart/searchlight/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ spec:
- name: api
port: 8080
targetPort: api
- name: web
port: 56790
targetPort: web
selector:
app: "{{ template "searchlight.name" . }}"
release: "{{ .Release.Name }}"
1 change: 0 additions & 1 deletion docs/reference/searchlight/searchlight_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ searchlight run [flags]
--http2-max-streams-per-connection int The limit that the server gives to clients for the maximum number of streams in an HTTP/2 connection. Zero means to use golang's default. (default 1000)
--incident-ttl duration Garbage collects incidents older than this duration. Set to 0 to disable garbage collection. (default 2160h0m0s)
--kubeconfig string kubeconfig file pointing at the 'core' kubernetes server.
--ops-address string Address to listen on for web interface and telemetry. (default ":56790")
--profiling Enable profiling via web interface host:port/debug/pprof/ (default true)
--requestheader-allowed-names strings List of client certificate common names to allow to provide usernames in headers specified by --requestheader-username-headers. If empty, any client certificate validated by the authorities in --requestheader-client-ca-file is allowed.
--requestheader-client-ca-file string Root certificate bundle to use to verify client certificates on incoming requests before trusting usernames in headers specified by --requestheader-username-headers
Expand Down
5 changes: 0 additions & 5 deletions hack/deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ spec:
- --v=3
- --config-dir=/srv
- --config-secret-name=searchlight-operator
- --ops-address=:56790
- --secure-port=8443
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
- --enable-analytics=${SEARCHLIGHT_ENABLE_ANALYTICS}
ports:
- containerPort: 8443
- containerPort: 56790
volumeMounts:
- mountPath: /srv
name: data
Expand Down Expand Up @@ -132,9 +130,6 @@ spec:
- name: icinga
port: 5665
targetPort: 5665
- name: ops
port: 56790
targetPort: 56790
selector:
app: searchlight
---
Expand Down
4 changes: 0 additions & 4 deletions pkg/cmds/server/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
type OperatorOptions struct {
ConfigRoot string
ConfigSecretName string
OpsAddress string
ResyncPeriod time.Duration
MaxNumRequeues int
NumThreads int
Expand All @@ -34,7 +33,6 @@ func NewOperatorOptions() *OperatorOptions {
return &OperatorOptions{
ConfigRoot: "/srv",
ConfigSecretName: "searchlight-operator",
OpsAddress: ":56790",
ResyncPeriod: 5 * time.Minute,
MaxNumRequeues: 5,
NumThreads: 1,
Expand All @@ -46,7 +44,6 @@ func NewOperatorOptions() *OperatorOptions {
func (s *OperatorOptions) AddGoFlags(fs *flag.FlagSet) {
fs.StringVar(&s.ConfigRoot, "config-dir", s.ConfigRoot, "Path to directory containing icinga2 config. This should be an emptyDir inside Kubernetes.")
fs.StringVar(&s.ConfigSecretName, "config-secret-name", s.ConfigSecretName, "Name of Kubernetes secret used to pass icinga credentials.")
fs.StringVar(&s.OpsAddress, "ops-address", s.OpsAddress, "Address to listen on for web interface and telemetry.")
fs.DurationVar(&s.ResyncPeriod, "resync-period", s.ResyncPeriod, "If non-zero, will re-list this often. Otherwise, re-list will be delayed aslong as possible (until the upstream source closes the watch or times out.")
fs.DurationVar(&s.IncidentTTL, "incident-ttl", s.IncidentTTL, "Garbage collects incidents older than this duration. Set to 0 to disable garbage collection.")
}
Expand All @@ -62,7 +59,6 @@ func (s *OperatorOptions) ApplyTo(cfg *operator.OperatorConfig) error {

cfg.ConfigRoot = s.ConfigRoot
cfg.ConfigSecretName = s.ConfigSecretName
cfg.OpsAddress = s.OpsAddress
cfg.ResyncPeriod = s.ResyncPeriod
cfg.MaxNumRequeues = s.MaxNumRequeues
cfg.NumThreads = s.NumThreads
Expand Down
1 change: 0 additions & 1 deletion pkg/operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
type Config struct {
ConfigRoot string
ConfigSecretName string
OpsAddress string
ResyncPeriod time.Duration
MaxNumRequeues int
NumThreads int
Expand Down
12 changes: 2 additions & 10 deletions pkg/operator/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ package operator

import (
"fmt"
"net/http"

"github.com/appscode/go/log"
apiext_util "github.com/appscode/kutil/apiextensions/v1beta1"
"github.com/appscode/kutil/tools/queue"
"github.com/appscode/pat"
api "github.com/appscode/searchlight/apis/monitoring/v1alpha1"
cs "github.com/appscode/searchlight/client/clientset/versioned"
mon_informers "github.com/appscode/searchlight/client/informers/externalversions"
mon_listers "github.com/appscode/searchlight/client/listers/monitoring/v1alpha1"
"github.com/appscode/searchlight/pkg/icinga"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus/promhttp"
crd_api "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
ecs "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1"
"k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -129,16 +125,12 @@ func (op *Operator) Run(stopCh <-chan struct{}) error {
}

op.gcIncidents()
go op.RunWatchers(stopCh)

// Create build-in SearchlighPlugin
if err := op.createBuiltinSearchlightPlugin(); err != nil {
return err
}

m := pat.New()
m.Get("/metrics", promhttp.Handler())
http.Handle("/", m)
log.Infoln("Listening on", op.OpsAddress)
return http.ListenAndServe(op.OpsAddress, nil)
op.RunWatchers(stopCh)
return nil
}