My deployment and other yaml files for a sample app in consul: link The routing is not happening.
Could anyone please check them and suggest what need to be fixed.
The traffic is not entering the app at all.
The steps I followed to install consul:
I have installed consul on kubernetes (docker desktop) using this link.
git clone https://github.com/hashicorp/learn-consul-kubernetes.git
cd learn-consul-kubernetes/service-mesh/deploy
helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo update
helm install -f config.yaml consul hashicorp/consul --version "0.31.1"
the config file is in the repo folder: learn-consul-kubernetes/service-mesh/deploy
config.yaml
global:
name: consul
datacenter: dc1
image: hashicorp/consul:1.9.7
imageEnvoy: envoyproxy/envoy:v1.16.4
metrics:
enabled: true
enableAgentMetrics: true
server:
replicas: 1
ui:
enabled: true
connectInject:
enabled: true
default: true
controller:
enabled: true
prometheus:
enabled: true
grafana:
enabled: true
And the pods created:
kubectl get pods --selector app=consul
PS D:\consul\learn-consul-kubernetes\service-mesh\deploy> kubectl get pods --selector app=consul
NAME READY STATUS RESTARTS AGE
consul-6lf6k 1/1 Running 0 4h44m
consul-connect-injector-webhook-deployment-86759499c6-st7jj 1/1 Running 0 4h44m
consul-controller-5788b8f6c7-z4vmt 1/1 Running 0 4h44m
consul-server-0 1/1 Running 0 4h44m
consul-webhook-cert-manager-5745cbb9d-7qft2 1/1 Running 0 4h44m
to access this consul-ui:
kubectl port-forward service/consul-ui 18500:80 --address 0.0.0.0
And able to access: http://localhost:18500/
consul server members:
PS D:\consul\learn-consul-kubernetes\service-mesh> kubectl exec -it consul-server-0 -- consul members
Node Address Status Type Build Protocol DC Segment
consul-server-0 10.1.0.13:8301 alive server 1.9.7 2 dc1 <all>
docker-desktop 10.1.0.10:8301 alive client 1.9.7 2 dc1 <default>
Applied zero trust in network:
kubectl apply -f "D:\consul\learn-consul-kubernetes\service-mesh\zero-trust-network\deny-all.yaml"
apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceIntentions
metadata:
name: deny-all
spec:
destination:
name: '*'
sources:
- name: '*'
action: deny
Accessing consul-ui using:
kubectl port-forward service/consul-ui 18500:80 --address 0.0.0.0
http://localhost:18500/ui/dc1/intentions The intentions so far:
Now, zero intentions are created, I will deploy a sample app.
PS D:\consul\learn-consul-kubernetes\service-mesh\onlytext\consul-testing\static-app2>
kubectl apply -f .
ingressgateway.consul.hashicorp.com/ingress-gateway created
servicedefaults.consul.hashicorp.com/static created
serviceintentions.consul.hashicorp.com/static created
service/static-server2 created
serviceaccount/static created
deployment.apps/static-deployment created
Now, the deployed app is not connecting with ingress. Can you please suggest how to fix this?