-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Summary
This release adds support for the modern Kubernetes IngressClass API and automatic ingress status updates, improving compliance with Kubernetes standards and user experience.
Features Implemented
1. IngressClass Resource Support
Added proper IngressClass resource definition and support for the modern spec.ingressClassName field.
What changed:
- Created IngressClass resource named
easyhaproxy(replaces verboseeasyhaproxy-ingress) - Supports modern
spec.ingressClassName: easyhaproxyfield (Kubernetes 1.18+) - Maintains backward compatibility with deprecated
kubernetes.io/ingress.class: easyhaproxy-ingressannotation - Updated RBAC permissions to include
ingressclassesresource
Benefits:
- ✅ Follows Kubernetes best practices and standards
- ✅ Matches naming conventions of nginx, traefik, and other ingress controllers
- ✅ Backward compatible - existing deployments continue to work
- ✅ Future-proof as the annotation is officially deprecated
Usage:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
spec:
ingressClassName: easyhaproxy # Modern approach (recommended)
rules:
- host: example.com
http:
paths:
- backend:
service:
name: example-service
port:
number: 8080
pathType: ImplementationSpecific2. Automatic Ingress Status Updates
EasyHAProxy now automatically updates ingress status with load balancer addresses, populating the ADDRESS column in kubectl get ingress output.
What changed:
- Auto-detects deployment mode (DaemonSet, NodePort, or ClusterIP)
- Reports appropriate IP addresses/hostnames based on deployment mode:
- DaemonSet: Node IPs where pods are scheduled
- NodePort: All node IPs (traffic can reach any node)
- ClusterIP: LoadBalancer IP, external hostname, or ClusterIP
- Caches deployment mode and addresses for performance
- Added RBAC permissions for
ingresses/statusupdates - Enabled by default (can be disabled via configuration)
Benefits:
- ✅ Better UX: Users immediately see where to access their ingresses
- ✅ Standard behavior: Matches nginx-ingress, traefik, etc.
- ✅ Easier debugging: Quick verification that ingress is configured
- ✅ Tool integration: Works with Kubernetes dashboards and monitoring tools
Example output:
# Before:
$ kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS
myapp easyhaproxy example.com 80
# After:
$ kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS
myapp easyhaproxy example.com 192.168.1.100 80Configuration
Disable Status Updates
# values.yaml
ingressStatus:
enabled: falseOverride Deployment Mode Detection
# values.yaml
ingressStatus:
deploymentMode: nodeport # auto, daemonset, nodeport, or clusteripSet External Hostname (ClusterIP mode)
# values.yaml
ingressStatus:
externalHostname: "haproxy.example.com"Adjust Cache TTL
# values.yaml
ingressStatus:
updateInterval: 60 # secondsBackward Compatibility
No breaking changes. All existing deployments continue to work:
- Old annotation
kubernetes.io/ingress.class: easyhaproxy-ingressstill supported - Ingress status updates are additive (don't affect existing functionality)
- Status updates can be disabled if needed
Technical Details
Files Modified
Helm templates:
helm/easyhaproxy/templates/ingressclass.yaml(new)helm/easyhaproxy/templates/clusterrole.yaml(updated RBAC)helm/easyhaproxy/templates/deployment.yaml(added env vars)helm/easyhaproxy/values.yaml(added configuration)
Python code:
src/processor/__init__.py(added detection and status update logic)src/functions/__init__.py(added configuration support)
Static manifests (regenerated):
deploy/kubernetes/easyhaproxy-daemonset.ymldeploy/kubernetes/easyhaproxy-nodeport.ymldeploy/kubernetes/easyhaproxy-clusterip.yml
Documentation:
docs/kubernetes.md(updated examples and explanations)deploy/kubernetes/README.md(enhanced with detailed instructions)
RBAC Permissions Added
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses/status", "ingressclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: ["networking.k8s.io"]
resources: ["ingresses/status"]
verbs: ["patch"]
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list"]Migration Guide
For New Deployments
Use the modern approach:
spec:
ingressClassName: easyhaproxyFor Existing Deployments
Option 1: Keep current annotation (still works)
metadata:
annotations:
kubernetes.io/ingress.class: easyhaproxy-ingressOption 2: Migrate to new field (recommended)
spec:
ingressClassName: easyhaproxyPerformance Impact
- Minimal: Deployment mode detected once and cached
- Node IPs cached with 30s TTL (configurable)
- Status updates: 1 API call per ingress per refresh cycle
- Graceful degradation: Errors are logged but don't affect HAProxy config
Future Enhancements
Potential improvements for consideration:
- Support for setting custom status messages
- Webhook for immediate status updates on deployment changes
- Metrics for status update success/failure rates
- Support for multiple external IPs/hostnames
Related Documentation
Metadata
Metadata
Assignees
Labels
Projects
Status