You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/annotations-custom.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# User annotations
1
+
# Custom annotations
2
2
3
-
User annotations are custom annotations with full validation that user can create for frontend and backend side of HAProxy configuration. They can be limited for certain resources and they unlock all HAProxy options that might not be available with other options.
3
+
Custom annotations are annotations with full validation that user can create for frontend and backend side of HAProxy configuration. They can be limited for certain resources and they unlock all HAProxy options that might not be available with other options. In background they use CRD (Custom resources definition) to validate its content and access.
4
4
5
5
## Why ?
6
6
7
7
HAProxy has extensive number of powerful options to tweak load balancing: [docs.haproxy.org](https://docs.haproxy.org/). The best way to expose them in most reliable way is to provide a secure method to deploy them while still allowing full exposure of settings that HAProxy provides.
8
8
9
9
## What is the main difference if we compare them to CRDs ?
10
10
11
-
They are pretty similar, both have validation and can potentially add almost everything HAProxy can offer. Main difference with CRDs is, that CRDs do not have granularity like we can have with user defined annotations.
11
+
They are pretty similar, both have validation and can potentially add almost everything HAProxy can offer. Main difference with CRDs is, that CRDs do not have granularity like we can have with custom defined annotations.
12
12
13
13
## What is the main difference compared to config snippets
14
14
@@ -21,27 +21,27 @@ In short reliability, validation and security. While snippets allow really high
21
21
The most important difference is security part of it. With custom annotations there is clear separation of two groups of people who configure and consume them:
22
22
23
23
- Administrator
24
-
using pre defined CRD, administrator can define and limit usage of user annotations. This can be achieved with limiting annotation on certain HAProxy section, service, ingress or namespace if needed. Also, if a specific service or group needs a little more freedom in what to configure, administrator can create a user annotation that is specific to that team.
24
+
using pre defined CRD, administrator can define and limit usage of custom annotations. This can be achieved with limiting annotation on certain HAProxy section, service, ingress or namespace if needed. Also, if a specific service or group needs a little more freedom in what to configure, administrator can create a custom annotation that is specific to that team.
25
25
26
26
- Developers/Teams
27
27
Teams gets a list of all available annotations that admin created. If more is needed, request can be sent to admin to create additional annotation.
28
28
29
29
### Validation
30
30
31
-
User defined annotations have validation. [Common Expression language](https://github.com/google/cel-spec) is used to write rules. Rules can be simple or strict. The more strict rule is there is less chance of accidental mistake.
31
+
Custom annotations have validation. [Common Expression language](https://github.com/google/cel-spec) is used to write rules. Rules can be simple or strict. The more strict rule is there is less chance of accidental mistake.
32
32
33
33
### Speed of delivery
34
34
35
-
While number of annotations have grown over time in this project, no two deployments are the same. Company A needs different customization than Company B. While purpose of this project is to cover all possible ideas and setups our users might need, it is not possible to cover all use cases with (in the end) limited number of resources and time. With user annotation there is no need to wait until new annotation is accepted, developed and released, we can simply create a new one, deploy it and start using it immediately after we deploy it.
35
+
While number of annotations have grown over time in this project, no two deployments are the same. Company A needs different customization than Company B. While purpose of this project is to cover all possible ideas and setups our users might need, it is not possible to cover all use cases with (in the end) limited number of resources and time. With custom annotation there is no need to wait until new annotation is accepted, developed and released, we can simply create a new one, deploy it and start using it immediately after we deploy it.
36
36
37
37
### Monitoring
38
38
39
39
We all read logs, right, right ?
40
40
While we do have a log message with annotations where we can see if some annotations is not accepted due to xyz, user annotations have additional advantage. Even in case if validation was not successful it will still appear in configuration, but as comment on certain frontend or backend. Additionall, as a comment, error message will appear that will explain what went wrong.
41
41
42
-
## How can I distinguish user annotations from 'regular' ones ?
42
+
## How can I distinguish custom annotations from 'regular' ones ?
43
43
44
-
As seen in [annotations.md](https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/annotations.md), HAProxy annotations can have `ingress.kubernetes.io`, `haproxy.org` and `haproxy.com` prefixes. User annotations can have any prefix we define. For example a 'famous' example.com corporation can use `example.com` prefix. How exactly structure is defined we will see next.
44
+
As seen in [annotations.md](https://github.com/haproxytech/kubernetes-ingress/blob/master/documentation/annotations.md), HAProxy annotations can have `ingress.kubernetes.io`, `haproxy.org` and `haproxy.com` prefixes. Custom annotations can have any prefix we define. For example a 'famous' example.com corporation can use `example.com` prefix. How exactly structure is defined we will see next.
45
45
46
46
## Is there any downside ?
47
47
@@ -51,7 +51,7 @@ Not really, but we always need to keep in mind that adding/modifying annotation
51
51
52
52
### CRD
53
53
54
-
We need to write a CRD where we will define all user annotations.
54
+
We need to write a CRD where we will define all custom annotations.
55
55
56
56
```yaml
57
57
apiVersion: ingress.v3.haproxy.org/v3 # yes, you are right, CRD updates are lovely
@@ -60,7 +60,7 @@ metadata:
60
60
name: example-validationrules
61
61
namespace: haproxy-controller
62
62
spec:
63
-
prefix: "example.com"# company prefix for user defined annotations
63
+
prefix: "example.com"# company prefix for custom annotations
64
64
validation_rules: # list of user defined annotations
65
65
# Rule for 'timeout-server' accepting duration values
66
66
timeout-server:
@@ -252,7 +252,7 @@ there are several values we can use in template that are predefined
252
252
section: backend
253
253
template: |
254
254
# ==============================================
255
-
# user annotation, owner: {{.owner}} - Reason: {{.reason}} for {{.BACKEND}}
255
+
# custom annotation, owner: {{.owner}} - Reason: {{.reason}} for {{.BACKEND}}
256
256
# namespace {{.NAMESPACE}}, ingress {{.INGRESS}}, service {{.SERVICE}}
the only difference is extra information what frontend this settings belong to. With HAProxy Ingress controller, you have 3 different frontends: `http`, `https` and `stats`, each can be customized with user annotations.
344
+
the only difference is extra information what frontend this settings belong to. With HAProxy Ingress controller, you have 3 different frontends: `http`, `https` and `stats`, each can be customized with custom annotations.
- `configmap`- this will be applied for each backend
368
368
- ⚠ `ingress` - this will be applied on services used in ingress. **use with precaution.**
369
-
- setting user annotations on ingress level is disabled by default!
370
-
- use `--enable-user-annotations-on-ingress` to enable it. Setting different annotation values in different ingresses for same service will trigger **inconsistencies**, so this is not encouraged. use `service` annotations.
369
+
- setting custom annotations on ingress level is disabled by default!
370
+
- use `--enable-custom-annotations-on-ingress` to enable it. Setting different annotation values in different ingresses for same service will trigger **inconsistencies**, so this is not encouraged. use `service` annotations.
371
371
- `service`- this will be applied just on service
372
372
373
373
#### what happens if you try to use same annotation on multiple places
0 commit comments