Add IngressClass resource and update references to spec.ingressClassName across templates, examples, and documentation for consistency and backward compatibility
- Introduced new IngressClass resource in Helm templates to define `easyhaproxy` as the default ingress class. - Updated Kubernetes examples to replace `easyhaproxy-ingress` with `easyhaproxy` as the ingress class name. - Enhanced processor logic to support both the new `spec.ingressClassName` field and the deprecated `kubernetes.io/ingress.class` annotation. - Revised documentation to reflect the changes and ensure alignment with Kubernetes recommendations.
This commit is contained in:
parent
e8aceda402
commit
c8f8320cfe
15 changed files with 205 additions and 72 deletions
91
deploy/kubernetes/README.md
Normal file
91
deploy/kubernetes/README.md
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# Kubernetes Static Manifests
|
||||
|
||||
⚠️ **IMPORTANT**: These files are **auto-generated** from Helm templates. Do not edit them directly!
|
||||
|
||||
## About These Files
|
||||
|
||||
This directory contains pre-rendered Kubernetes manifests for deploying EasyHAProxy without Helm. These are generated from the Helm chart at `../../helm/easyhaproxy/` and provide three deployment options:
|
||||
|
||||
| File | Type | Use Case |
|
||||
|-----------------------------|------------------------|--------------------------------------------------------------|
|
||||
| `easyhaproxy-daemonset.yml` | DaemonSet + hostPort | Direct host networking, best for bare-metal or simple setups |
|
||||
| `easyhaproxy-nodeport.yml` | Deployment + NodePort | Exposes via NodePort (31080/31443/31936) |
|
||||
| `easyhaproxy-clusterip.yml` | Deployment + ClusterIP | Internal cluster access only, use with external LoadBalancer |
|
||||
|
||||
## How to Use
|
||||
|
||||
Choose the manifest that fits your deployment scenario:
|
||||
|
||||
```bash
|
||||
# Option 1: DaemonSet mode (hostPort)
|
||||
kubectl apply -f easyhaproxy-daemonset.yml
|
||||
|
||||
# Option 2: NodePort mode
|
||||
kubectl apply -f easyhaproxy-nodeport.yml
|
||||
|
||||
# Option 3: ClusterIP mode
|
||||
kubectl apply -f easyhaproxy-clusterip.yml
|
||||
```
|
||||
|
||||
For more details, see the [Kubernetes documentation](../../docs/kubernetes.md).
|
||||
|
||||
## Regenerating These Files
|
||||
|
||||
**When to regenerate:**
|
||||
- After modifying Helm chart templates (`helm/easyhaproxy/templates/`)
|
||||
- After updating default values (`helm/easyhaproxy/values.yaml`)
|
||||
- After a new release to sync with latest Helm chart
|
||||
|
||||
**How to regenerate:**
|
||||
|
||||
```bash
|
||||
# Navigate to helm directory
|
||||
cd helm
|
||||
|
||||
# Generate DaemonSet manifest (hostPort mode)
|
||||
helm template ingress ./easyhaproxy --namespace easyhaproxy \
|
||||
--set service.create=false \
|
||||
> ../deploy/kubernetes/easyhaproxy-daemonset.yml
|
||||
|
||||
# Generate NodePort manifest
|
||||
helm template ingress ./easyhaproxy --namespace easyhaproxy \
|
||||
--set service.create=true \
|
||||
--set service.type=NodePort \
|
||||
> ../deploy/kubernetes/easyhaproxy-nodeport.yml
|
||||
|
||||
# Generate ClusterIP manifest
|
||||
helm template ingress ./easyhaproxy --namespace easyhaproxy \
|
||||
--set service.create=true \
|
||||
--set service.type=ClusterIP \
|
||||
> ../deploy/kubernetes/easyhaproxy-clusterip.yml
|
||||
```
|
||||
|
||||
**Verify regeneration:**
|
||||
|
||||
```bash
|
||||
# Check IngressClass is present
|
||||
grep "kind: IngressClass" ../deploy/kubernetes/easyhaproxy-*.yml
|
||||
|
||||
# Validate manifest syntax
|
||||
kubectl apply --dry-run=client -f ../deploy/kubernetes/easyhaproxy-daemonset.yml
|
||||
```
|
||||
|
||||
## What's Included
|
||||
|
||||
Each manifest contains:
|
||||
- **ServiceAccount**: RBAC identity for EasyHAProxy
|
||||
- **ClusterRole**: Permissions to read Ingress resources and Secrets
|
||||
- **ClusterRoleBinding**: Binds the role to the service account
|
||||
- **IngressClass**: Defines `easyhaproxy` as the ingress class
|
||||
- **DaemonSet/Deployment**: The EasyHAProxy workload
|
||||
- **Service** (NodePort/ClusterIP only): Network exposure
|
||||
|
||||
## Source of Truth
|
||||
|
||||
The Helm chart at `../../helm/easyhaproxy/` is the **source of truth**. All changes should be made there, then these static manifests regenerated.
|
||||
|
||||
**To modify these deployments:**
|
||||
1. Edit Helm templates in `helm/easyhaproxy/templates/`
|
||||
2. Update default values in `helm/easyhaproxy/values.yaml`
|
||||
3. Regenerate static manifests using commands above
|
||||
4. Commit both Helm changes and regenerated manifests
|
||||
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -19,7 +19,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -41,12 +41,11 @@ rules:
|
|||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "extensions"
|
||||
- "networking.k8s.io"
|
||||
resources:
|
||||
- ingresses
|
||||
# - ingresses/status
|
||||
# - ingressclasses
|
||||
- ingressclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
|
|
@ -85,7 +84,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -107,7 +106,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -139,12 +138,13 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
|
|
@ -155,15 +155,6 @@ spec:
|
|||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: easyhaproxy/node
|
||||
operator: In
|
||||
values:
|
||||
- master
|
||||
serviceAccountName: ingress-easyhaproxy
|
||||
securityContext:
|
||||
{}
|
||||
|
|
@ -184,9 +175,7 @@ spec:
|
|||
containerPort: 1936
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
{}
|
||||
env:
|
||||
- name: EASYHAPROXY_DISCOVER
|
||||
value: kubernetes
|
||||
|
|
@ -206,3 +195,17 @@ spec:
|
|||
value: DEBUG
|
||||
- name: CERTBOT_LOG_LEVEL
|
||||
value: DEBUG
|
||||
---
|
||||
# Source: easyhaproxy/templates/ingressclass.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
controller: byjg.com/easyhaproxy
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -19,7 +19,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -41,12 +41,11 @@ rules:
|
|||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "extensions"
|
||||
- "networking.k8s.io"
|
||||
resources:
|
||||
- ingresses
|
||||
# - ingresses/status
|
||||
# - ingressclasses
|
||||
- ingressclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
|
|
@ -85,7 +84,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -106,7 +105,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -151,9 +150,7 @@ spec:
|
|||
containerPort: 1936
|
||||
hostPort: 1936
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
{}
|
||||
env:
|
||||
- name: EASYHAPROXY_DISCOVER
|
||||
value: kubernetes
|
||||
|
|
@ -173,3 +170,17 @@ spec:
|
|||
value: DEBUG
|
||||
- name: CERTBOT_LOG_LEVEL
|
||||
value: DEBUG
|
||||
---
|
||||
# Source: easyhaproxy/templates/ingressclass.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
controller: byjg.com/easyhaproxy
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -19,7 +19,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -41,12 +41,11 @@ rules:
|
|||
- list
|
||||
- watch
|
||||
- apiGroups:
|
||||
- "extensions"
|
||||
- "networking.k8s.io"
|
||||
resources:
|
||||
- ingresses
|
||||
# - ingresses/status
|
||||
# - ingressclasses
|
||||
- ingressclasses
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
|
|
@ -85,7 +84,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -107,7 +106,7 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
|
|
@ -119,13 +118,13 @@ spec:
|
|||
ports:
|
||||
- name: http
|
||||
port: 80
|
||||
nodePort: 31080
|
||||
nodePort: 80
|
||||
- name: https
|
||||
port: 443
|
||||
nodePort: 31443
|
||||
nodePort: 443
|
||||
- name: stats
|
||||
port: 1936
|
||||
nodePort: 31936
|
||||
nodePort: 1936
|
||||
|
||||
|
||||
selector:
|
||||
|
|
@ -139,12 +138,13 @@ metadata:
|
|||
name: ingress-easyhaproxy
|
||||
namespace: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.1
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
|
|
@ -155,15 +155,6 @@ spec:
|
|||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
spec:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: easyhaproxy/node
|
||||
operator: In
|
||||
values:
|
||||
- master
|
||||
serviceAccountName: ingress-easyhaproxy
|
||||
securityContext:
|
||||
{}
|
||||
|
|
@ -184,9 +175,7 @@ spec:
|
|||
containerPort: 1936
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
{}
|
||||
env:
|
||||
- name: EASYHAPROXY_DISCOVER
|
||||
value: kubernetes
|
||||
|
|
@ -206,3 +195,17 @@ spec:
|
|||
value: DEBUG
|
||||
- name: CERTBOT_LOG_LEVEL
|
||||
value: DEBUG
|
||||
---
|
||||
# Source: easyhaproxy/templates/ingressclass.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: easyhaproxy
|
||||
labels:
|
||||
helm.sh/chart: easyhaproxy-1.0.0
|
||||
app.kubernetes.io/name: easyhaproxy
|
||||
app.kubernetes.io/instance: ingress
|
||||
app.kubernetes.io/version: "5.0.0"
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
spec:
|
||||
controller: byjg.com/easyhaproxy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue