Skip to content

Instantly share code, notes, and snippets.

View Pothulapati's full-sized avatar
🎯
Focusing

Tarun Pothulapati Pothulapati

🎯
Focusing
View GitHub Profile
---
# Source: smi-metrics/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app.kubernetes.io/name: smi-metrics
helm.sh/chart: smi-metrics-0.1.0
app.kubernetes.io/instance: dev
app.kubernetes.io/managed-by: Tiller
{
"kind":"TrafficMetrics",
"apiVersion":"metrics.smi-spec.io/v1alpha1",
"metadata":{
"name":"linkerd-controller",
"namespace":"linkerd",
"selfLink":"/apis/metrics.smi-spec.io/v1alpha1/namespaces/linkerd/deployments/linkerd-controller",
"creationTimestamp":"2019-06-04T11:47:54Z"
},
"timestamp":"2019-06-04T11:47:54Z",
NAME SHORTNAMES APIGROUP NAMESPACED KIND
bindings true Binding
componentstatuses cs false ComponentStatus
configmaps cm true ConfigMap
endpoints ep true Endpoints
events ev true Event
limitranges limits true LimitRange
namespaces ns false Namespace
nodes no false Node
persistentvolumeclaims pvc true PersistentVolumeClaim
NAME SHORTNAMES APIGROUP NAMESPACED KIND
bindings true Binding
componentstatuses cs false ComponentStatus
configmaps cm true ConfigMap
endpoints ep true Endpoints
events ev true Event
limitranges limits true LimitRange
namespaces ns false Namespace
nodes no false Node
persistentvolumeclaims pvc true PersistentVolumeClaim
{{with .Values -}}
---
###
### Proxy Injector
###
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: linkerd-proxy-injector
type Mesh interface {
GetSupportedResources(ctx context.Context) (*metav1.APIResourceList, error)
GetResourceMetrics(ctx context.Context, name, namespace, kind string, interval *metrics.Interval) (*metrics.TrafficMetricsList, error)
GetEdgeMetrics(ctx context.Context, name, namespace, kind string, details ResourceDetails, interval *metrics.Interval) (*metrics.TrafficMetricsList, error)
}
----------
main.go
if viper.GetString("mesh") == "linkerd" {
mesh: Linkerd
config:
prometheus-url: http://linkerd-prometheus.linkerd.svc.cluster.local:9090
resourceQueries:
p99_response_latency : |-
histogram_quantile(
0.99,
sum(
irate(
response_latency_ms_bucket{
@Pothulapati
Pothulapati / services.yaml
Last active August 24, 2019 14:19
services.yaml
---
apiVersion: v1
kind: Service
metadata:
name: reviews-v2
spec:
selector:
app: reviews
version: v2
@Pothulapati
Pothulapati / services.yaml
Last active July 12, 2019 18:45
services.yaml
apiVersion: v1
kind: Service
metadata:
name: reviews-v2
spec:
selector:
app: reviews
version: v2
ports:
- protocol: TCP
@Pothulapati
Pothulapati / trafficsplit.yaml
Last active August 13, 2019 20:14
trafficsplit
apiVersion: split.smi-spec.io/v1alpha1
kind: TrafficSplit
metadata:
name: reviews-rollout
spec:
service: reviews
backends:
- service: reviews-v2
weight: 500m
- service: reviews-v3