Skip to content

Instantly share code, notes, and snippets.

View mhiro2's full-sized avatar
😇

Masaaki Hirotsu mhiro2

😇
View GitHub Profile
from kedro.pipeline import Pipeline, node
def mean(xs, n):
return sum(xs) / n
def mean_sos(xs, n):
return sum(x*x for x in xs) / n
$ istioctl replace -f samples/bookinfo/routing/route-rule-ratings-test-abort.yaml
Updated config virtual-service/default/ratings to revision 45992
$ istioctl get virtualservice ratings -o yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
creationTimestamp: null
name: ratings
namespace: default
resourceVersion: "45992"
$ istioctl replace -f samples/bookinfo/routing/route-rule-ratings-test-delay.yaml
Updated config virtual-service/default/ratings to revision 44630
$ istioctl get virtualservice ratings -o yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
creationTimestamp: null
name: ratings
namespace: default
resourceVersion: "44630"
$ istioctl replace -f samples/bookinfo/routing/route-rule-reviews-v3.yaml
Updated config virtual-service/default/reviews to revision 43868
$ istioctl replace -f samples/bookinfo/routing/route-rule-reviews-50-v3.yaml
Updated config virtual-service/default/reviews to revision 43391
$ istioctl get virtualservice reviews -o yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
creationTimestamp: null
name: reviews
namespace: default
resourceVersion: "43391"
$ sed -i '/mesh/s/^/# /' samples/bookinfo/routing/route-rule-all-v1-mtls.yaml
$ istioctl create -f samples/bookinfo/routing/route-rule-all-v1-mtls.yaml
Created config virtual-service/default/productpage at revision 42291
Created config virtual-service/default/reviews at revision 42292
Created config virtual-service/default/ratings at revision 42293
Created config virtual-service/default/details at revision 42294
Created config destination-rule/default/productpage at revision 42295
Created config destination-rule/default/reviews at revision 42296
Created config destination-rule/default/ratings at revision 42297
Created config destination-rule/default/details at revision 42298
$ curl -o /dev/null -s -w "%{http_code}\n" http://${INGRESS_HOST}:${INGRESS_PORT}/productpage
200
$ export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http")].nodePort}')
$ export SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
$ export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}')
$ kubectl label namespace default istio-injection=enabled
namespace "default" labeled
$ kubectl describe namespace default
Name: default
Labels: istio-injection=enabled
Annotations: <none>
Status: Active
No resource quota.
$ istioctl get gateway -o yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
creationTimestamp: null
name: bookinfo-gateway
namespace: default
resourceVersion: "4308"
spec:
selector: