Skip to content

Instantly share code, notes, and snippets.

@muonoum
Last active August 21, 2020 06:36
Show Gist options
  • Select an option

  • Save muonoum/3262ceeed2ce57c379496c57ff4a8b27 to your computer and use it in GitHub Desktop.

Select an option

Save muonoum/3262ceeed2ce57c379496c57ff4a8b27 to your computer and use it in GitHub Desktop.
istioctl operator init
---
apiVersion: v1
kind: Namespace
metadata:
name: istio-system
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-controlplane
spec:
profile: minimal
values:
global:
proxy:
autoInject: enabled
gateways:
istio-ingressgateway:
serviceAnnotations:
service.beta.kubernetes.io/aws-load-balancer-internal: "true"
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
addonComponents:
prometheus:
enabled: false
components:
ingressGateways:
- name: istio-ingressgateway
enabled: true
---
apiVersion: v1
kind: Namespace
metadata:
name: istio-system
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-controlplane
spec:
profile: minimal
values:
global:
proxy:
autoInject: enabled
addonComponents:
prometheus:
enabled: false
components:
ingressGateways:
- name: istio-ingressgateway
enabled: true
---
apiVersion: v1
kind: Namespace
metadata:
name: hello-world
labels:
istio-injection: enabled
---
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: hello-world
name: hello-world
---
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: hello-world
name: hello-world
spec:
replicas: 1
selector:
matchLabels:
app: hello-world
version: v1
template:
metadata:
labels:
app: hello-world
version: v1
spec:
serviceAccountName: hello-world
containers:
- name: hello-world
image: crccheck/hello-world
ports:
- containerPort: 8000
---
apiVersion: v1
kind: Service
metadata:
namespace: hello-world
name: hello-world
labels:
app: hello-world
spec:
ports:
- name: http
port: 8000
targetPort: 8000
selector:
app: hello-world
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
namespace: hello-world
name: hello-world-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
namespace: hello-world
name: hello-world
spec:
hosts:
- "*"
gateways:
- hello-world-gateway
http:
- match:
- uri:
prefix: /
route:
- destination:
port:
number: 8000
host: hello-world
#!/bin/bash
INGRESS_HOST=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kind-control-plane)
INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
echo $INGRESS_HOST:$INGRESS_PORT
#!/bin/bash
INGRESS_HOST=$(minikube ip)
INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
echo $INGRESS_HOST:$INGRESS_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment