Configuration:
minikube version: v1.9.2
kubernetes version v1.15.11
Istio version: 1.6
Commands I used:
istioctl install --set profile=demo
kubectl create namespace wordpress
kubectl label namespace wordpress istio-injection=enabled
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install bitnami/wordpress --version 9.3.3 -n wordpress --namespace wordpress
i edit my etc/hosts and add:
10.109.182.64 wordpress.example.eu
10.109.182.64 is istio-ingressgateway external-ip
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: wordpress-gateway
namespace: wordpress
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "wordpress.example.eu"
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: wordpress
namespace: wordpress
spec:
hosts:
- "wordpress.example.eu"
gateways:
- wordpress-gateway
http:
- match:
- uri:
prefix: /wordpress
route:
- destination:
port:
number: 8000
host: wordpress
kubectl describe svc wordpress -n wordpress result:
Name: wordpress
Namespace: wordpress
Labels: app.kubernetes.io/instance=wordpress
app.kubernetes.io/managed-by=Tiller
app.kubernetes.io/name=wordpress
helm.sh/chart=wordpress-9.3.3
Annotations: <none>
Selector: app.kubernetes.io/instance=wordpress,app.kubernetes.io/name=wordpress
Type: LoadBalancer
IP: 10.99.39.188
Port: http 80/TCP
TargetPort: http/TCP
NodePort: http 30946/TCP
Endpoints: 172.17.0.14:8080
Port: https 443/TCP
TargetPort: https/TCP
NodePort: https 30124/TCP
Endpoints: 172.17.0.14:8443
Session Affinity: None
External Traffic Policy: Cluster
Events: <none>
Result for number 8000 and 8080:
http://wordpress.example.eu/wordpress
503 Service Unavailable
Headers:
date: Thu, 28 May 2020 13:52:25 GMT
server: istio-envoy
content-length: 0
If i change in VirtualService number to 80 i get html without css i js.
Result:
http://wordpress.example.eu/wordpress
404 Not Found
date: Thu, 28 May 2020 14:02:15 GMT
server: istio-envoy
x-powered-by: PHP/7.4.6
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-cache, must-revalidate, max-age=0
link: <http://wordpress.example.eu/wp-json/>; rel="https://api.w.org/"
content-type: text/html; charset=UTF-8
x-envoy-upstream-service-time: 22
transfer-encoding: chunked
Can anyone help me find that bug that stop me to get correct result from wordpress.example.eu/wordpress?