Skip to content

Commit

Permalink
Remove --ops-address flag (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Jun 24, 2018
1 parent f5dcec5 commit 2a80471
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 26 deletions.
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
}

0 comments on commit 2a80471

Please sign in to comment.