Skip to content

Instantly share code, notes, and snippets.

View DavadDi's full-sized avatar

DavadDi DavadDi

View GitHub Profile
# cat /etc/istio/config/mesh
# Set the following variable to true to disable policy checks by the Mixer.
# Note that metrics will still be reported to the Mixer.
disablePolicyChecks: false
# Set enableTracing to false to disable request tracing.
enableTracing: true
# Set accessLogFile to empty string to disable access log.
accessLogFile: "/dev/stdout"
{
"node": {
"id": "sidecar~10.128.45.2~sleep-7dc47f96b6-lnf9c.default~default.svc.cluster.local",
"cluster": "sleep",
"metadata": {"INTERCEPTION_MODE":"REDIRECT","ISTIO_PROXY_SHA":"istio-proxy:930841ca88b15365737acb7eddeea6733d4f98b9","ISTIO_PROXY_VERSION":"1.0.2","ISTIO_VERSION":"1.0.5","POD_NAME":"sleep-7dc47f96b6-lnf9c","app":"sleep","istio":"sidecar"}
},
"stats_config": {
"use_all_default_tags": false,
"stats_tags": [{
{
"configs": {
"listeners": {
},
"clusters": {
"@type": "type.googleapis.com/envoy.admin.v2alpha.ClustersConfigDump",
"version_info": "2019-02-04T17:51:21Z/74",
"static_clusters": [
{
"cluster": {
{
"configs": {
"routes": {
"@type": "type.googleapis.com/envoy.admin.v2alpha.RoutesConfigDump",
"static_route_configs": [
{
"route_config": {
"name": "inbound|5000||helloworld.default.svc.cluster.local",
"virtual_hosts": [
{
"listeners": {
"@type": "type.googleapis.com/envoy.admin.v2alpha.ListenersConfigDump",
"version_info": "2019-02-13T12:52:07Z/11",
"static_listeners": [
{
"listener": {
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 15090
{
"configs": {
"listeners": {
"@type": "type.googleapis.com/envoy.admin.v2alpha.ListenersConfigDump",
"version_info": "2019-02-15T05:53:49Z/8",
"static_listeners": [
{
"listener": {
"address": {
"socket_address": {
@DavadDi
DavadDi / Count Code lines
Created August 17, 2019 02:08 — forked from amitchhajer/Count Code lines
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n
-- k8s.io/ingress-nginx/rootfs/etc/nginx/lua/
local ngx_balancer = require("ngx.balancer")
local cjson = require("cjson.safe")
local util = require("util")
local dns_util = require("util.dns")
local configuration = require("configuration")
local round_robin = require("balancer.round_robin")
local chash = require("balancer.chash")
local chashsubset = require("balancer.chashsubset")
local sticky = require("balancer.sticky")
@DavadDi
DavadDi / nginx.conf
Created September 13, 2019 14:02
ingress nginx example
# Configuration checksum: 15488413709381799850
# setup custom paths that do not require root access
pid /tmp/nginx.pid;
load_module /etc/nginx/modules/ngx_http_modsecurity_module.so;
daemon off;
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
field.cattle.io/publicEndpoints: '[{"addresses":["172.25.11.99"],"port":80,"protocol":"HTTP","serviceName":"qtt-infra-dev:adcoder","ingressName":"qtt-infra-dev:ingress-weight-test","hostname":"adcoder.cdad3fc3448684306b7f8003e6ceeb429.cn-zhangjiakou.alicontainer.com","path":"/version","allNodes":false},{"addresses":["172.25.11.99"],"port":80,"protocol":"HTTP","serviceName":"qtt-infra-dev:adcoder-test","ingressName":"qtt-infra-dev:ingress-weight-test","hostname":"adcoder.cdad3fc3448684306b7f8003e6ceeb429.cn-zhangjiakou.alicontainer.com","path":"/version","allNodes":false}]'
nginx.ingress.kubernetes.io/service-weight: 'adcoder: 200, adcoder-test: 200'
creationTimestamp: 2019-09-02T12:07:10Z
generation: 1
name: ingress-weight-test
namespace: qtt-infra-dev