Hi I have a fresh cluster via Digital Ocean.
I created the namespace routing, where I installed the Traefik helm chart v2.2
The dashboard works via localhost by binding the port so I can see that there is 4 services visible.
In the dashboard in the services area it says:
api@internal
dashbaord@internal
noop@internal
ping@internal
The status for all them is a green tick.
When I do the following after deploying the application I can do:
kubectl get svc -A
I can see:
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.245.0.1 <none> 443/TCP 9d
example example-app ClusterIP 10.245.179.188 <none> 80/TCP 2d1h
kube-system kube-dns ClusterIP 10.245.0.10 <none> 53/UDP,53/TCP,9153/TCP 9d
routing traefik LoadBalancer 10.245.80.28 external-ip 80:30140/TCP,443:31185/TCP 2d4h
When I do:
kubectl get pods -A
I get:
NAMESPACE NAME READY STATUS RESTARTS AGE
example example-app-2zlzd 1/1 Running 0 19m
kube-system cilium-bzpsx 1/1 Running 0 9d
kube-system cilium-operator-7c59b5d8d-p26n8 1/1 Running 1 9d
kube-system coredns-6b6854dcbf-trdsz 1/1 Running 0 9d
kube-system coredns-6b6854dcbf-vdng4 1/1 Running 0 9d
kube-system csi-do-node-mgqvv 2/2 Running 0 9d
kube-system do-node-agent-7nhx2 1/1 Running 0 9d
kube-system kube-proxy-t249t 1/1 Running 0 9d
routing traefik-86cb4f657c-wns84 1/1 Running 0 2d5h
on on domain name provider I set the @ and * field to the external IP. When I ping the domain it shows the external-ip. After deploying the application I get a 404 when visiting the webpage.
So now for my application:
example-app.yml
apiVersion: apps/v1
kind: ReplicaSet
metadata:
namespace: example
name: 'example-app'
labels:
app: 'example-app'
tier: 'frontend'
traefik.http.routers.example-app.rule: 'mydomain.com'
traefik.http.routers.example-app.entrypoints: 'web'
traefik.enable: 'true'
spec:
replicas: 1
selector:
matchLabels:
tier: 'frontend'
template:
metadata:
labels:
tier: 'frontend'
traefik.http.routers.example-app.rule: 'mydomain.com'
traefik.http.routers.example-app.entrypoints: 'web'
traefik.enable: 'true'
spec:
containers:
- name: example-app
image: richarvey/nginx-php-fpm:latest
imagePullPolicy: Always
env: passwords-for-repo
ports:
- containerPort: 80
example-namespace.yml
apiVersion: v1
kind: Namespace
metadata:
name: example
example-service.yml
apiVersion: v1
kind: Service
metadata:
namespace: example
name: 'example-app'
spec:
type: ClusterIP
ports:
- protocol: TCP
name: http
port: 80
targetPort: 80
selector:
app: 'example-app'
The image in the deployment is richarvey/nginx-php-fpm The page is here and all it does it deploy an nginx/php-fpm webserver that pulls in files from a git repo. In the git repo I just have an index.php that says hello.
The guide I used is here:
Any help from you would be amazing as I am finding it quite difficult to know where to look! Thanks