mirror of https://github.com/linkerd/linkerd2.git
This reverts commit edd3b1f6d4.
This is a temporary revert of #3461 while we sort out some details of how this should configured and how it should interact with configuring a trace collector on the Linkerd proxy. We will reintroduce this change once the config plan is straightened out.
Signed-off-by: Alex Leong <alex@buoyant.io>
This commit is contained in:
parent
5ad1233295
commit
4799baa8e2
|
|
@ -9,7 +9,7 @@ RUN (proxy=$(bin/fetch-proxy $(cat proxy-version)) && \
|
|||
mv "$proxy" linkerd2-proxy)
|
||||
|
||||
## compile proxy-identity agent
|
||||
FROM gcr.io/linkerd-io/go-deps:a3fe37ac as golang
|
||||
FROM gcr.io/linkerd-io/go-deps:1c1e51a3 as golang
|
||||
WORKDIR /linkerd-build
|
||||
COPY pkg/flags pkg/flags
|
||||
COPY pkg/tls pkg/tls
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ spec:
|
|||
- -destination-addr=linkerd-destination.{{.Namespace}}.svc.{{.ClusterDomain}}:8086
|
||||
- -controller-namespace={{.Namespace}}
|
||||
- -log-level={{.ControllerLogLevel}}
|
||||
{{- include "partials.linkerd.trace" .Trace | nindent 8 -}}
|
||||
image: {{.ControllerImage}}:{{default .LinkerdVersion .ControllerImageVersion}}
|
||||
imagePullPolicy: {{.ImagePullPolicy}}
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ spec:
|
|||
- -controller-namespace={{.Namespace}}
|
||||
- -enable-h2-upgrade={{.EnableH2Upgrade}}
|
||||
- -log-level={{.ControllerLogLevel}}
|
||||
{{- include "partials.linkerd.trace" .Trace | nindent 8 -}}
|
||||
image: {{.ControllerImage}}:{{default .LinkerdVersion .ControllerImageVersion}}
|
||||
imagePullPolicy: {{.ImagePullPolicy}}
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ spec:
|
|||
- args:
|
||||
- identity
|
||||
- -log-level={{.ControllerLogLevel}}
|
||||
{{- include "partials.linkerd.trace" .Trace | nindent 8 -}}
|
||||
image: {{.ControllerImage}}:{{default .LinkerdVersion .ControllerImageVersion}}
|
||||
imagePullPolicy: {{.ImagePullPolicy}}
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ spec:
|
|||
- tap
|
||||
- -controller-namespace={{.Namespace}}
|
||||
- -log-level={{.ControllerLogLevel}}
|
||||
{{- include "partials.linkerd.trace" .Trace | nindent 8 -}}
|
||||
image: {{.ControllerImage}}:{{default .LinkerdVersion .ControllerImageVersion}}
|
||||
imagePullPolicy: {{.ImagePullPolicy}}
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ spec:
|
|||
- -grafana-addr=linkerd-grafana.{{.Namespace}}.svc.{{.ClusterDomain}}:3000
|
||||
- -controller-namespace={{.Namespace}}
|
||||
- -log-level={{.ControllerLogLevel}}
|
||||
{{- include "partials.linkerd.trace" .Trace | nindent 8 -}}
|
||||
image: {{.WebImage}}:{{default .LinkerdVersion .ControllerImageVersion}}
|
||||
imagePullPolicy: {{.ImagePullPolicy}}
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -54,11 +54,6 @@ HeartbeatSchedule: "0 0 * * *"
|
|||
PrometheusImage: prom/prometheus:v2.11.1
|
||||
PrometheusLogLevel: *controller_log_level
|
||||
|
||||
# Trace configuration for the Control Plane components
|
||||
Trace:
|
||||
TraceCollector: ""
|
||||
ProbabilisticSamplingRate: 0
|
||||
|
||||
# proxy configuration
|
||||
Proxy:
|
||||
EnableExternalProfiles: false
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
{{ define "partials.linkerd.trace" -}}
|
||||
{{ if .TraceCollector -}}
|
||||
- -trace-collector={{.TraceCollector}}
|
||||
- -sampling-probability={{.ProbabilisticSamplingRate}}
|
||||
{{ end -}}
|
||||
{{- end }}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
## compile binaries
|
||||
FROM gcr.io/linkerd-io/go-deps:a3fe37ac as golang
|
||||
FROM gcr.io/linkerd-io/go-deps:1c1e51a3 as golang
|
||||
WORKDIR /linkerd-build
|
||||
COPY cli cli
|
||||
COPY charts charts
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ type (
|
|||
omitWebhookSideEffects bool
|
||||
restrictDashboardPrivileges bool
|
||||
identityOptions *installIdentityOptions
|
||||
traceOptions *installTraceOptions
|
||||
*proxyConfigOptions
|
||||
|
||||
recordedFlags []*pb.Install_Flag
|
||||
|
|
@ -59,11 +58,6 @@ type (
|
|||
heartbeatSchedule func() string
|
||||
}
|
||||
|
||||
installTraceOptions struct {
|
||||
traceCollector string
|
||||
probabilisticSamplingRate float64
|
||||
}
|
||||
|
||||
installIdentityOptions struct {
|
||||
replicas uint
|
||||
trustDomain string
|
||||
|
|
@ -178,10 +172,6 @@ func newInstallOptionsWithDefaults() (*installOptions, error) {
|
|||
noInitContainer: defaults.NoInitContainer,
|
||||
omitWebhookSideEffects: defaults.OmitWebhookSideEffects,
|
||||
restrictDashboardPrivileges: defaults.RestrictDashboardPrivileges,
|
||||
traceOptions: &installTraceOptions{
|
||||
traceCollector: defaults.Trace.TraceCollector,
|
||||
probabilisticSamplingRate: defaults.Trace.ProbabilisticSamplingRate,
|
||||
},
|
||||
proxyConfigOptions: &proxyConfigOptions{
|
||||
proxyVersion: version.Version,
|
||||
ignoreCluster: false,
|
||||
|
|
@ -464,17 +454,6 @@ func (options *installOptions) recordableFlagSet() *pflag.FlagSet {
|
|||
)
|
||||
|
||||
flags.StringVarP(&options.clusterDomain, "cluster-domain", "", options.clusterDomain, "Set custom cluster domain")
|
||||
|
||||
flags.StringVar(
|
||||
&options.traceOptions.traceCollector, "trace-collector", options.traceOptions.traceCollector,
|
||||
"The endpoint where to send the trace data",
|
||||
)
|
||||
|
||||
flags.Float64Var(
|
||||
&options.traceOptions.probabilisticSamplingRate, "trace-probability", options.traceOptions.probabilisticSamplingRate,
|
||||
"the sampling rate for the probabilistic trace sampler",
|
||||
)
|
||||
|
||||
flags.StringVarP(&options.controlPlaneVersion, "control-plane-version", "", options.controlPlaneVersion, "(Development) Tag to be used for the control plane component images")
|
||||
flags.MarkHidden("control-plane-version")
|
||||
|
||||
|
|
@ -689,11 +668,6 @@ func (options *installOptions) buildValuesWithoutIdentity(configs *pb.All) (*cha
|
|||
UID: options.proxyUID,
|
||||
}
|
||||
|
||||
installValues.Trace = &charts.Trace{
|
||||
TraceCollector: options.traceOptions.traceCollector,
|
||||
ProbabilisticSamplingRate: options.traceOptions.probabilisticSamplingRate,
|
||||
}
|
||||
|
||||
inboundPortStrs := []string{}
|
||||
for _, port := range options.ignoreInboundPorts {
|
||||
inboundPortStrs = append(inboundPortStrs, strconv.FormatUint(uint64(port), 10))
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ func chartPartials(t *testing.T) *pb.Chart {
|
|||
{Name: "templates/_helpers.tpl"},
|
||||
{Name: "templates/_debug.tpl"},
|
||||
{Name: "templates/_capabilities.tpl"},
|
||||
{Name: "templates/_trace.tpl"},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,10 +101,6 @@ func TestRender(t *testing.T) {
|
|||
},
|
||||
UID: 2102,
|
||||
},
|
||||
Trace: &charts.Trace{
|
||||
TraceCollector: "TraceCollector",
|
||||
ProbabilisticSamplingRate: 0,
|
||||
},
|
||||
ProxyInit: &charts.ProxyInit{
|
||||
Image: &charts.Image{
|
||||
Name: "ProxyInitImageName",
|
||||
|
|
|
|||
|
|
@ -836,8 +836,6 @@ spec:
|
|||
- args:
|
||||
- identity
|
||||
- -log-level=ControllerLogLevel
|
||||
- -trace-collector=TraceCollector
|
||||
- -sampling-probability=0
|
||||
image: ControllerImage:ControllerImageVersion
|
||||
imagePullPolicy: ImagePullPolicy
|
||||
livenessProbe:
|
||||
|
|
@ -1053,8 +1051,6 @@ spec:
|
|||
- -destination-addr=linkerd-destination.Namespace.svc.cluster.local:8086
|
||||
- -controller-namespace=Namespace
|
||||
- -log-level=ControllerLogLevel
|
||||
- -trace-collector=TraceCollector
|
||||
- -sampling-probability=0
|
||||
image: ControllerImage:ControllerImageVersion
|
||||
imagePullPolicy: ImagePullPolicy
|
||||
livenessProbe:
|
||||
|
|
@ -1265,8 +1261,6 @@ spec:
|
|||
- -controller-namespace=Namespace
|
||||
- -enable-h2-upgrade=true
|
||||
- -log-level=ControllerLogLevel
|
||||
- -trace-collector=TraceCollector
|
||||
- -sampling-probability=0
|
||||
image: ControllerImage:ControllerImageVersion
|
||||
imagePullPolicy: ImagePullPolicy
|
||||
livenessProbe:
|
||||
|
|
@ -1519,8 +1513,6 @@ spec:
|
|||
- -grafana-addr=linkerd-grafana.Namespace.svc.cluster.local:3000
|
||||
- -controller-namespace=Namespace
|
||||
- -log-level=ControllerLogLevel
|
||||
- -trace-collector=TraceCollector
|
||||
- -sampling-probability=0
|
||||
image: WebImage:ControllerImageVersion
|
||||
imagePullPolicy: ImagePullPolicy
|
||||
livenessProbe:
|
||||
|
|
@ -2757,8 +2749,6 @@ spec:
|
|||
- tap
|
||||
- -controller-namespace=Namespace
|
||||
- -log-level=ControllerLogLevel
|
||||
- -trace-collector=TraceCollector
|
||||
- -sampling-probability=0
|
||||
image: ControllerImage:ControllerImageVersion
|
||||
imagePullPolicy: ImagePullPolicy
|
||||
livenessProbe:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile cni-plugin utility
|
||||
FROM gcr.io/linkerd-io/go-deps:a3fe37ac as golang
|
||||
FROM gcr.io/linkerd-io/go-deps:1c1e51a3 as golang
|
||||
WORKDIR /linkerd-build
|
||||
COPY pkg pkg
|
||||
COPY controller controller
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## compile controller service
|
||||
FROM gcr.io/linkerd-io/go-deps:a3fe37ac as golang
|
||||
FROM gcr.io/linkerd-io/go-deps:1c1e51a3 as golang
|
||||
WORKDIR /linkerd-build
|
||||
COPY controller/gen controller/gen
|
||||
COPY pkg pkg
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@ package destination
|
|||
|
||||
import (
|
||||
pb "github.com/linkerd/linkerd2-proxy-api/go/destination"
|
||||
"go.opencensus.io/plugin/ocgrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// NewClient creates a client for the control plane Destination API that
|
||||
// implements the Destination service.
|
||||
func NewClient(addr string) (pb.DestinationClient, *grpc.ClientConn, error) {
|
||||
conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithStatsHandler(&ocgrpc.ClientHandler{}))
|
||||
conn, err := grpc.Dial(addr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,13 @@ package discovery
|
|||
|
||||
import (
|
||||
pb "github.com/linkerd/linkerd2/controller/gen/controller/discovery"
|
||||
"go.opencensus.io/plugin/ocgrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// NewClient creates a client for control plane APIs that implement the
|
||||
// Discovery service. This includes the public API and the destination API.
|
||||
func NewClient(addr string) (pb.DiscoveryClient, *grpc.ClientConn, error) {
|
||||
conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithStatsHandler(&ocgrpc.ClientHandler{}))
|
||||
conn, err := grpc.Dial(addr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/protohttp"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
|
@ -213,7 +212,7 @@ func NewInternalClient(controlPlaneNamespace string, kubeAPIHost string) (APICli
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return newClient(apiURL, &http.Client{Transport: &ochttp.Transport{}}, controlPlaneNamespace)
|
||||
return newClient(apiURL, http.DefaultClient, controlPlaneNamespace)
|
||||
}
|
||||
|
||||
// NewExternalClient creates a new Public API client intended to run from
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import (
|
|||
promApi "github.com/prometheus/client_golang/api"
|
||||
promv1 "github.com/prometheus/client_golang/api/prometheus/v1"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
"google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
|
|
@ -342,6 +341,6 @@ func NewServer(
|
|||
|
||||
return &http.Server{
|
||||
Addr: addr,
|
||||
Handler: &ochttp.Handler{Handler: instrumentedHandler},
|
||||
Handler: instrumentedHandler,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/prometheus/common/model"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
type promType string
|
||||
|
|
@ -47,9 +46,6 @@ func extractSampleValue(sample *model.Sample) uint64 {
|
|||
func (s *grpcServer) queryProm(ctx context.Context, query string) (model.Vector, error) {
|
||||
log.Debugf("Query request:\n\t%+v", query)
|
||||
|
||||
_, span := trace.StartSpan(ctx, "query.prometheus")
|
||||
defer span.End()
|
||||
span.AddAttributes(trace.StringAttribute("queryString", query))
|
||||
// single data point (aka summary) query
|
||||
res, err := s.prometheusAPI.Query(ctx, query, time.Time{})
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/config"
|
||||
"github.com/linkerd/linkerd2/pkg/flags"
|
||||
consts "github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
@ -28,8 +27,6 @@ func Main(args []string) {
|
|||
disableIdentity := cmd.Bool("disable-identity", false, "Disable identity configuration")
|
||||
controllerNamespace := cmd.String("controller-namespace", "linkerd", "namespace in which Linkerd is installed")
|
||||
|
||||
traceCollector, probabilisticSamplingRate := flags.AddTraceFlags(cmd)
|
||||
|
||||
flags.ConfigureAndParse(cmd, args)
|
||||
|
||||
stop := make(chan os.Signal, 1)
|
||||
|
|
@ -64,8 +61,6 @@ func Main(args []string) {
|
|||
|
||||
clusterDomain := global.GetClusterDomain()
|
||||
|
||||
util.InitializeTracing("linkerd-destination", *traceCollector, *probabilisticSamplingRate)
|
||||
|
||||
server := destination.NewServer(
|
||||
*addr,
|
||||
*controllerNamespace,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import (
|
|||
consts "github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/prometheus"
|
||||
"github.com/linkerd/linkerd2/pkg/tls"
|
||||
"github.com/linkerd/linkerd2/pkg/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
@ -38,8 +37,6 @@ func Main(args []string) {
|
|||
"/var/run/linkerd/identity/issuer",
|
||||
"path to directory containing issuer credentials")
|
||||
|
||||
traceCollector, probabilisticSamplingRate := flags.AddTraceFlags(cmd)
|
||||
|
||||
flags.ConfigureAndParse(cmd, args)
|
||||
|
||||
cfg, err := config.Global(consts.MountPathGlobalConfig)
|
||||
|
|
@ -121,7 +118,6 @@ func Main(args []string) {
|
|||
log.Fatalf("Failed to listen on %s: %s", *addr, err)
|
||||
}
|
||||
|
||||
util.InitializeTracing("linkerd-identity", *traceCollector, *probabilisticSamplingRate)
|
||||
srv := prometheus.NewGrpcServer()
|
||||
identity.Register(srv, svc)
|
||||
go func() {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/config"
|
||||
"github.com/linkerd/linkerd2/pkg/flags"
|
||||
pkgK8s "github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/util"
|
||||
promApi "github.com/prometheus/client_golang/api"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
|
@ -33,8 +32,6 @@ func Main(args []string) {
|
|||
controllerNamespace := cmd.String("controller-namespace", "linkerd", "namespace in which Linkerd is installed")
|
||||
ignoredNamespaces := cmd.String("ignore-namespaces", "kube-system", "comma separated list of namespaces to not list pods from")
|
||||
|
||||
traceCollector, probabilisticSamplingRate := flags.AddTraceFlags(cmd)
|
||||
|
||||
flags.ConfigureAndParse(cmd, args)
|
||||
|
||||
stop := make(chan os.Signal, 1)
|
||||
|
|
@ -75,7 +72,6 @@ func Main(args []string) {
|
|||
}
|
||||
log.Info("Using cluster domain: ", clusterDomain)
|
||||
|
||||
util.InitializeTracing("linkerd-public-api", *traceCollector, *probabilisticSamplingRate)
|
||||
server := public.NewServer(
|
||||
*addr,
|
||||
prometheusClient,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/config"
|
||||
"github.com/linkerd/linkerd2/pkg/flags"
|
||||
pkgK8s "github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/util"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
@ -31,8 +30,6 @@ func Main(args []string) {
|
|||
tlsKeyPath := cmd.String("tls-key", pkgK8s.MountPathTLSKeyPEM, "path to TLS Key PEM")
|
||||
disableCommonNames := cmd.Bool("disable-common-names", false, "disable checks for Common Names (for development)")
|
||||
|
||||
traceCollector, probabilisticSamplingRate := flags.AddTraceFlags(cmd)
|
||||
|
||||
flags.ConfigureAndParse(cmd, args)
|
||||
|
||||
stop := make(chan os.Signal, 1)
|
||||
|
|
@ -64,7 +61,6 @@ func Main(args []string) {
|
|||
}
|
||||
log.Info("Using cluster domain: ", clusterDomain)
|
||||
|
||||
util.InitializeTracing("linkerd-tap", *traceCollector, *probabilisticSamplingRate)
|
||||
grpcTapServer := tap.NewGrpcTapServer(*tapPort, *controllerNamespace, clusterDomain, k8sAPI)
|
||||
|
||||
// TODO: make this configurable for local development
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/controller/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/prometheus"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
|
|
@ -69,7 +68,7 @@ func NewAPIServer(
|
|||
|
||||
s := &http.Server{
|
||||
Addr: addr,
|
||||
Handler: &ochttp.Handler{Handler: wrappedServer},
|
||||
Handler: wrappedServer,
|
||||
TLSConfig: &tls.Config{
|
||||
Certificates: []tls.Certificate{cert},
|
||||
ClientAuth: tls.VerifyClientCertIfGiven,
|
||||
|
|
|
|||
3
go.mod
3
go.mod
|
|
@ -3,7 +3,7 @@ module github.com/linkerd/linkerd2
|
|||
go 1.12.9
|
||||
|
||||
require (
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.6.0
|
||||
contrib.go.opencensus.io/exporter/ocagent v0.6.0 // indirect
|
||||
github.com/Azure/go-autorest v11.3.2+incompatible // indirect
|
||||
github.com/Masterminds/semver v1.4.2 // indirect
|
||||
github.com/Masterminds/sprig v2.17.1+incompatible // indirect
|
||||
|
|
@ -65,7 +65,6 @@ require (
|
|||
github.com/wercker/stern v0.0.0-20190705090245-4fa46dd6987f
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
go.etcd.io/bbolt v1.3.3 // indirect
|
||||
go.opencensus.io v0.22.0
|
||||
go.uber.org/atomic v1.4.0 // indirect
|
||||
go.uber.org/multierr v1.1.0 // indirect
|
||||
go.uber.org/zap v1.10.0 // indirect
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ func (chart *Chart) Render() (bytes.Buffer, error) {
|
|||
{Name: "charts/partials/templates/_helpers.tpl"},
|
||||
{Name: "charts/partials/templates/_debug.tpl"},
|
||||
{Name: "charts/partials/templates/_capabilities.tpl"},
|
||||
{Name: "charts/partials/templates/_trace.tpl"},
|
||||
}
|
||||
if err := filesReader("", partialsFiles); err != nil {
|
||||
return bytes.Buffer{}, err
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ type (
|
|||
ProxyInjector *ProxyInjector
|
||||
ProfileValidator *ProfileValidator
|
||||
Tap *Tap
|
||||
Trace *Trace
|
||||
Proxy *Proxy
|
||||
ProxyInit *ProxyInit
|
||||
|
||||
|
|
@ -89,12 +88,6 @@ type (
|
|||
UID int64
|
||||
}
|
||||
|
||||
// Trace contains the fields to set the Tracing properties for all control-plane components
|
||||
Trace struct {
|
||||
TraceCollector string
|
||||
ProbabilisticSamplingRate float64
|
||||
}
|
||||
|
||||
// ProxyInit contains the fields to set the proxy-init container
|
||||
ProxyInit struct {
|
||||
Capabilities *Capabilities
|
||||
|
|
|
|||
|
|
@ -61,10 +61,6 @@ func TestNewValues(t *testing.T) {
|
|||
ProfileValidator: &ProfileValidator{TLS: &TLS{}},
|
||||
Tap: &Tap{TLS: &TLS{}},
|
||||
|
||||
Trace: &Trace{
|
||||
TraceCollector: "",
|
||||
ProbabilisticSamplingRate: 0,
|
||||
},
|
||||
Proxy: &Proxy{
|
||||
EnableExternalProfiles: false,
|
||||
Image: &Image{
|
||||
|
|
|
|||
|
|
@ -10,15 +10,6 @@ import (
|
|||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// AddTraceFlags adds the traceCollector and ProbabilisticSamplingRate flags
|
||||
// to the flagSet and returns their pointers for usage
|
||||
func AddTraceFlags(cmd *flag.FlagSet) (*string, *float64) {
|
||||
traceCollector := cmd.String("trace-collector", "", "Enables OC Tracing with the specified endpoint as collector")
|
||||
probabilitySampling := cmd.Float64("sampling-probability", 0, "The probabilistic sampling rate for the traces")
|
||||
|
||||
return traceCollector, probabilitySampling
|
||||
}
|
||||
|
||||
// ConfigureAndParse adds flags that are common to all go processes. This
|
||||
// func calls flag.Parse(), so it should be called after all other flags have
|
||||
// been configured.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import (
|
|||
grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"go.opencensus.io/plugin/ocgrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
|
|
@ -93,7 +92,6 @@ func NewGrpcServer() *grpc.Server {
|
|||
server := grpc.NewServer(
|
||||
grpc.UnaryInterceptor(grpc_prometheus.UnaryServerInterceptor),
|
||||
grpc.StreamInterceptor(grpc_prometheus.StreamServerInterceptor),
|
||||
grpc.StatsHandler(&ocgrpc.ServerHandler{}),
|
||||
)
|
||||
|
||||
grpc_prometheus.EnableHandlingTimeHistogram()
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
package util
|
||||
|
||||
import (
|
||||
"contrib.go.opencensus.io/exporter/ocagent"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/trace"
|
||||
)
|
||||
|
||||
// InitializeTracing initialises trace, exporter and the sampler
|
||||
func InitializeTracing(serviceName string, address string, probability float64) {
|
||||
if address != "" {
|
||||
oce, err := ocagent.NewExporter(
|
||||
ocagent.WithInsecure(),
|
||||
ocagent.WithAddress(address),
|
||||
ocagent.WithServiceName(serviceName))
|
||||
if err != nil {
|
||||
log.Errorf("Couldn't create a OC Agent exporter:%s", err)
|
||||
}
|
||||
trace.RegisterExporter(oce)
|
||||
trace.ApplyConfig(trace.Config{
|
||||
DefaultSampler: trace.ProbabilitySampler(probability),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ COPY web/app ./web/app
|
|||
RUN ./bin/web build
|
||||
|
||||
## compile go server
|
||||
FROM gcr.io/linkerd-io/go-deps:a3fe37ac as golang
|
||||
FROM gcr.io/linkerd-io/go-deps:1c1e51a3 as golang
|
||||
WORKDIR /linkerd-build
|
||||
RUN mkdir -p web
|
||||
COPY web/main.go web
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/flags"
|
||||
"github.com/linkerd/linkerd2/pkg/k8s"
|
||||
pkgK8s "github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/util"
|
||||
"github.com/linkerd/linkerd2/web/srv"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
|
@ -33,8 +32,6 @@ func main() {
|
|||
controllerNamespace := cmd.String("controller-namespace", "linkerd", "namespace in which Linkerd is installed")
|
||||
kubeConfigPath := cmd.String("kubeconfig", "", "path to kube config")
|
||||
|
||||
traceCollector, probabilisticSamplingRate := flags.AddTraceFlags(cmd)
|
||||
|
||||
flags.ConfigureAndParse(cmd, os.Args[1:])
|
||||
|
||||
_, _, err := net.SplitHostPort(*apiAddr) // Verify apiAddr is of the form host:port.
|
||||
|
|
@ -46,8 +43,6 @@ func main() {
|
|||
log.Fatalf("failed to construct client for API server URL %s", *apiAddr)
|
||||
}
|
||||
|
||||
util.InitializeTracing("linkerd-web", *traceCollector, *probabilisticSamplingRate)
|
||||
|
||||
globalConfig, err := config.Global(pkgK8s.MountPathGlobalConfig)
|
||||
clusterDomain := globalConfig.GetClusterDomain()
|
||||
if err != nil || clusterDomain == "" {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import (
|
|||
"github.com/linkerd/linkerd2/pkg/k8s"
|
||||
"github.com/linkerd/linkerd2/pkg/prometheus"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"go.opencensus.io/plugin/ochttp"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -92,7 +91,7 @@ func NewServer(
|
|||
Addr: addr,
|
||||
ReadTimeout: timeout,
|
||||
WriteTimeout: timeout,
|
||||
Handler: &ochttp.Handler{Handler: wrappedServer},
|
||||
Handler: wrappedServer,
|
||||
}
|
||||
|
||||
// webapp routes
|
||||
|
|
|
|||
Loading…
Reference in New Issue