environment setup:
macOS
Docker For Desktop
/etc/hosts
127.0.0.1 api.local
helm install stable/kong --set ingressController.enabled=true
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api
labels:
app.kubernetes.io/name: api
helm.sh/chart: api-0.1.0
app.kubernetes.io/instance: api-local
app.kubernetes.io/managed-by: Tiller
annotations:
kubernetes.io/ingress.class: kong
spec:
rules:
- host: "api.local"
http:
paths:
- path: /
backend:
serviceName: api-svc
servicePort: 80
####
apiVersion: v1
kind: Service
metadata:
name: api-svc
labels:
app.kubernetes.io/name: api-svc
helm.sh/chart: api-0.1.0
app.kubernetes.io/instance: api-local
app.kubernetes.io/managed-by: Tiller
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 3000
protocol: TCP
name: http
selector:
app.kubernetes.io/name: api
app.kubernetes.io/instance: api-local
#####
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
app.kubernetes.io/name: api
helm.sh/chart: api-0.1.0
app.kubernetes.io/instance: api-local
app.kubernetes.io/managed-by: Tiller
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: api
app.kubernetes.io/instance: api-local
template:
metadata:
labels:
app.kubernetes.io/name: api
app.kubernetes.io/instance: api-local
spec:
containers:
- name: api
image: "my-image:latest"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
timeoutSeconds: 1
ingress description
Name: api-local-api
Namespace: api-local
Address: 192.168.65.3
Default backend: default-http-backend:80 (<none>)
Rules:
Host Path Backends
---- ---- --------
api.local
/ api-local-api-svc:80 (<none>)
Annotations:
kubernetes.io/ingress.class: kong
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal CREATE 11m kong-ingress-controller Ingress api-local/api-local-api
Normal UPDATE 10m kong-ingress-controller Ingress api-local/api-local-api
trying to curl the health endpoint
curl http://api.local/health
curl: (7) Failed to connect to api.local port 80: Connection refused
when i use nginx for ingress this setup works. am i required to bring in a KongIngress resource?