Skip to content

Instantly share code, notes, and snippets.

View zhaohuabing's full-sized avatar
💭
I may be slow to respond.

Huabing Zhao zhaohuabing

💭
I may be slow to respond.
View GitHub Profile
@zhaohuabing
zhaohuabing / ansible log
Created December 29, 2017 06:08
ansible log for kubespray issue
Using /home/ubuntu/kubespray/ansible.cfg as config file
PLAY [localhost] ************************************************************************************************************************************
skipping: no hosts matched
PLAY [k8s-cluster:etcd:calico-rr] *******************************************************************************************************************
TASK [download : Register docker images info] *******************************************************************************************************
Friday 29 December 2017 05:47:56 +0000 (0:00:00.095) 0:00:00.095 *******
PLAY [all] ******************************************************************************************************************************************
TASK [set_fact] *************************************************************************************************************************************
Friday 29 December 2017 06:14:29 +0000 (0:00:00.078) 0:00:00.078 *******
ok: [node3]
ok: [node2]
ok: [node1]
TASK [Storing commands output] **********************************************************************************************************************
Friday 29 December 2017 06:14:29 +0000 (0:00:00.103) 0:00:00.181 *******
{
"configs": {
"listeners": {
"@type": "type.googleapis.com/envoy.admin.v2alpha.ListenersConfigDump",
"version_info": "2018-09-27T07:17:49Z",
"dynamic_active_listeners": [
{
"version_info": "2018-09-06T09:34:19Z",
"listener": {
"name": "10.103.219.158_9102",
{
"node": {
"id": "sidecar~192.168.206.23~productpage-v1-54b8b9f55-bx2dq.default~default.svc.cluster.local",
"cluster": "productpage",
"metadata": {
"INTERCEPTION_MODE": "REDIRECT",
"ISTIO_PROXY_SHA": "istio-proxy:6166ae7ebac7f630206b2fe4e6767516bf198313",
"ISTIO_PROXY_VERSION": "1.0.0",
"ISTIO_VERSION": "1.0.0",
[
{
"clusterName": "outbound|15011||istio-pilot.istio-system.svc.cluster.local",
"endpoints": [
{
"locality": {
},
"lbEndpoints": [
{
@zhaohuabing
zhaohuabing / gist:7abaf8e00d2ab8978dc3e5d890fcc637
Created July 19, 2019 02:30
Split TCP from HTTP traffic by listener filters
{
"version_info": "0",
"listener": {
"name": "0.0.0.0_1030",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 1030
}
},
@zhaohuabing
zhaohuabing / eshop-checkout.java
Last active August 24, 2019 02:08
Enhance Istio Distributed Tracing with OpenTracing-eshop-checkout
@RequestMapping(value = "/checkout")
public String checkout(@RequestHeader HttpHeaders headers) {
  String result = "";
  // Use HTTP GET in this demo. In a real world use case,We should use HTTP POST
  // instead.
  // The three services are bundled in one jar for simplicity. To make it work,
  // define three services in Kubernets.
  result += restTemplate.exchange("http://inventory:8080/createOrder", HttpMethod.GET,
  new HttpEntity<>(passTracingHeader(headers)), String.class).getBody();
  result += "<BR>";
@Bean
public Tracer jaegerTracer() {
// The following environment variables need to set
// JAEGER_ENDPOINT="http://10.42.126.171:28019/api/traces"
// JAEGER_PROPAGATION="b3"
// JAEGER_TRACEID_128BIT="true" Use 128bit tracer id to be compatible with the
// trace id generated by istio/envoy
return Configuration.fromEnv("eshop-opentracing").getTracer();
}
apiVersion: v1
kind: Service
metadata:
name: jaeger-query
namespace: istio-system
annotations:
labels:
app: jaeger
jaeger-infra: jaeger-service
chart: tracing
@Aspect
@Component
public class TracingAspect {
@Autowired
Tracer tracer;
@Around("@annotation(com.zhaohuabing.demo.instrument.Traced)")
public Object aroundAdvice(ProceedingJoinPoint jp) throws Throwable {
String class_name = jp.getTarget().getClass().getName();
String method_name = jp.getSignature().getName();