Skip to content

Instantly share code, notes, and snippets.

View fai555's full-sized avatar
πŸ‘¨β€πŸ’»

Imran fai555

πŸ‘¨β€πŸ’»
View GitHub Profile
export PROJECT_NAME=<PROJECT_NAME>
export CLUSTER_NAME=istio-ssl-demo
export COMPUTE_REGION=us-central1
export COMPUTE_ZONE=us-central1-c
export NUM_NODES=3
export MAX_NODES=6
export MIN_NODES=0
export MACHINE_TYPE=n1-standard-2
export KUBERNETES_VERSION=1.16.8-gke.15
export NETWORK=<NETWORK_NAME>
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: helloworld-gateway
namespace: istio-test
spec:
selector:
istio: ingressgateway # use istio default controller
kubectl apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
name: helloworld
namespace: istio-test
labels:
app: helloworld
spec:
kubectl apply -f - <<EOF
apiVersion: "security.istio.io/v1beta1"
kind: "AuthorizationPolicy"
metadata:
name: "frontend-ingress"
namespace: istio-system
spec:
selector:
matchLabels:
istio: ingressgateway
kubectl apply -f - <<EOF
apiVersion: "security.istio.io/v1beta1"
kind: "RequestAuthentication"
metadata:
name: "jwt-example"
namespace: istio-system
spec:
selector:
matchLabels:
istio: ingressgateway
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: httpbin
namespace: foo
spec:
hosts:
- "*"
gateways:
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
namespace: foo
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
kubectl create ns foo
kubectl apply -f <(istioctl kube-inject -f samples/httpbin/httpbin.yaml) -n foo
kubectl apply -f <(istioctl kube-inject -f samples/sleep/sleep.yaml) -n foo
kubectl create ns bar
kubectl apply -f <(istioctl kube-inject -f samples/httpbin/httpbin.yaml) -n bar
kubectl apply -f <(istioctl kube-inject -f samples/sleep/sleep.yaml) -n bar
kubectl create ns legacy
kubectl apply -f samples/httpbin/httpbin.yaml -n legacy
# Create a namespace with istio sidecar injection inabled
kubectl create -f namespace.yaml
# Install Elasticsearch, Kibana, ApmServer
kubectl create -f eck.yaml
# Install Fluent Bit Service Account
kubectl create -f fluent-bit-service-account.yaml
# Install Fluent Bit Cluster Role
kubectl create -f fluent-bit-role.yaml
kubectl apply -f - <<EOF
apiVersion: "security.istio.io/v1beta1"
kind: "RequestAuthentication"
metadata:
name: "jwt-example"
namespace: istio-system
spec:
selector:
matchLabels:
istio: ingressgateway