-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetfinder_k8s.yaml
141 lines (140 loc) · 3.45 KB
/
petfinder_k8s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apiVersion: v1
data:
example_sidecar_config.textproto: |-
# proto-file: api/proto/metricrule_metric_configuration.proto
# proto-message: AgentConfig
input_content_filter: ".instances[*]"
input_metrics {
name: "input_distribution_counts"
simple_counter {}
}
output_content_filter: ".predictions[*]"
output_metrics {
name: "output_prediction_value_logits"
value {
value {
parsed_value {
field_path: "[0]"
parsed_type: FLOAT
}
}
}
}
context_labels_from_input {
label_key { string_value: "PetType" }
label_value {
parsed_value {
field_path: ".Type[0]"
parsed_type: STRING
}
}
}
context_labels_from_input {
label_key { string_value: "Breed" }
label_value {
parsed_value {
field_path: ".Breed1[0]"
parsed_type: STRING
}
}
}
context_labels_from_input {
label_key { string_value: "Gender" }
label_value {
parsed_value {
field_path: ".Gender[0]"
parsed_type: STRING
}
}
}
context_labels_from_input {
label_key { string_value: "Color" }
label_value {
parsed_value {
field_path: ".Color1[0]"
parsed_type: STRING
}
}
}
context_labels_from_input {
label_key { string_value: "Maturity Size" }
label_value {
parsed_value {
field_path: ".MaturitySize[0]"
parsed_type: STRING
}
}
}
context_labels_from_input {
label_key { string_value: "Health" }
label_value {
parsed_value {
field_path: ".Health[0]"
parsed_type: STRING
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: "2021-04-26T17:27:31Z"
name: petfinder-config-map
namespace: default
resourceVersion: "2153613"
selfLink: /api/v1/namespaces/default/configmaps/petfinder-config-map
uid: 491de0bb-3ce2-4840-8731-f0a2774ecccd
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: petfinder-deployment
spec:
selector:
matchLabels:
app: petfinder-server
replicas: 2
template:
metadata:
labels:
app: petfinder-server
spec:
containers:
- name: petfinder-container
image: asia.gcr.io/metricrule-tfserving-demo/petfinder
ports:
- containerPort: 8501
- name: metricrule-sidecar-container
image: metricrule/metricrule-sidecar-tfserving
env:
- name: APPLICATION_PORT
value: "8501"
- name: REVERSE_PROXY_PORT
value: "8551"
- name: SIDECAR_CONFIG_PATH
value: "/config/sidecar.textproto"
ports:
- containerPort: 8551
volumeMounts:
- name: config
mountPath: "/config"
readOnly: true
volumes:
- name: config
configMap:
name: petfinder-config-map
items:
- key: example_sidecar_config.textproto
path: sidecar.textproto
---
apiVersion: v1
kind: Service
metadata:
labels:
run: petfinder-service
name: petfinder-service
spec:
ports:
- port: 8501
targetPort: 8551
selector:
app: petfinder-server
type: LoadBalancer