Skip to content

Commit 6f1d0cc

Browse files
committed
docs(ingress): Update docs and sample
* Updated based on the new code updates
1 parent d29b901 commit 6f1d0cc

File tree

2 files changed

+48
-11
lines changed

2 files changed

+48
-11
lines changed

config/samples/network_v1_ingress.yaml

+28-4
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,41 @@ metadata:
55
name: ingress-sample
66
annotations:
77
k8s.checklyhq.com/enabled: "true"
8-
k8s.checklyhq.com/path: "/baz"
9-
# k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[0].host
10-
# k8s.checklyhq.com/success: "200" - Default "200"
8+
# k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[*].host
119
k8s.checklyhq.com/group: "group-sample"
1210
# k8s.checklyhq.com/muted: "false" # If not set, default "true"
11+
# k8s.checklyhq.com/path: "/baz" - Default read from spec.rules[*].http.paths[*].path
12+
# k8s.checklyhq.com/success: "200" - Default "200"
1313
spec:
1414
rules:
1515
- host: "foo.bar"
1616
http:
1717
paths:
18-
- path: /
18+
- path: /foo
19+
pathType: ImplementationSpecific
20+
backend:
21+
service:
22+
name: test-service
23+
port:
24+
number: 8080
25+
- path: /bar
26+
pathType: ImplementationSpecific
27+
backend:
28+
service:
29+
name: test-service
30+
port:
31+
number: 8080
32+
- host: "example.com"
33+
http:
34+
paths:
35+
- path: /tea
36+
pathType: ImplementationSpecific
37+
backend:
38+
service:
39+
name: test-service
40+
port:
41+
number: 8080
42+
- path: /coffee
1943
pathType: ImplementationSpecific
2044
backend:
2145
service:

docs/ingress.md

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# ingress
22

3-
We also support kubernetes native `ingress` resources. See [official docs](https://kubernetes.io/docs/concepts/services-networking/ingress/) for more details on what they are and what they do.
3+
Support for kubernetes native `ingress` resources. See [official docs](https://kubernetes.io/docs/concepts/services-networking/ingress/) for more details on what they are and what they do.
44

5-
We pull out information with the use of `annotations`. The information from the annotations is used to create `ApiCheck` resources, we make use of [ownerReferences](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/) to link ingress resources to ApiCheck resources.
5+
We pull out information with the use of `annotations` and use the built in spec. The information from the annotations is used to create `ApiCheck` resources, we make use of [ownerReferences](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/) to link ingress resources to ApiCheck resources.
66

77
> ***Warning***
8-
> We currently only support one API check / ingress resource.
8+
> We currently only support API checks for ingress resources.
9+
10+
## Logic of discovery
11+
12+
We iterate over the ingress resource's specifications to work out what needs to be created. The operator creates one ApiCheck resource for each `host` + `path`, if in your ingress resource you have 2 hosts with 3 paths each, you'll end up with 6 ApiChecks created.
13+
14+
Specific annotations are optional, as we can't automatically discover the group you want the Checkly APIChecks to be deployd in.
915

1016
## Configuration options
1117

@@ -14,10 +20,10 @@ The name of the API Check derives from the `metadata.name` of the `ingress` reso
1420
| Annotation | Details | Default |
1521
|--------------------|-------------|---------|
1622
| `k8s.checklyhq.com/enabled` | Bool; Should the operator read the annotations or not | `false` (*required) |
17-
| `k8s.checklyhq.com/path` | String; The URI to put after the `endpoint`, for example `/path` | "" (*required) |
18-
| `k8s.checklyhq.com/endpoint` | String; The host of the URL, for example `/` | Value of `spec.rules[0].Host`, defaults to `https://` (*required) |
23+
| `k8s.checklyhq.com/endpoint` | String; The host of the URL, for example `/` | Value of `spec.rules[0].Host`, defaults to `https://` |
1924
| `k8s.checklyhq.com/group` | String; Name of the group to which the check belongs; Kubernetes `Group` resource name` | none (*required)|
2025
| `k8s.checklyhq.com/muted` | String; Is the check muted or not | `true` |
26+
| `k8s.checklyhq.com/path` | String; The URI to put after the `endpoint`, for example `/path` | ""|
2127
| `k8s.checklyhq.com/success` | String; The expected success code | `200` |
2228

2329
### Example
@@ -29,7 +35,7 @@ metadata:
2935
name: checkly-operator-ingress
3036
annotations:
3137
k8s.checklyhq.com/enabled: "true"
32-
k8s.checklyhq.com/path: "/baz"
38+
# k8s.checklyhq.com/path: "/baz" - Default read from spec.rules[0].http.paths[*].path
3339
# k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[0].host
3440
# k8s.checklyhq.com/success: "200" - Default "200"
3541
k8s.checklyhq.com/group: "group-sample"
@@ -39,7 +45,14 @@ spec:
3945
- host: "foo.bar"
4046
http:
4147
paths:
42-
- path: /
48+
- path: /foo
49+
pathType: ImplementationSpecific
50+
backend:
51+
service:
52+
name: test-service
53+
port:
54+
number: 8080
55+
- path: /bar
4356
pathType: ImplementationSpecific
4457
backend:
4558
service:

0 commit comments

Comments
 (0)