diff --git a/config/samples/network_v1_ingress.yaml b/config/samples/network_v1_ingress.yaml index 7446ca5..040755a 100644 --- a/config/samples/network_v1_ingress.yaml +++ b/config/samples/network_v1_ingress.yaml @@ -5,17 +5,41 @@ metadata: name: ingress-sample annotations: k8s.checklyhq.com/enabled: "true" - k8s.checklyhq.com/path: "/baz" - # k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[0].host - # k8s.checklyhq.com/success: "200" - Default "200" + # k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[*].host k8s.checklyhq.com/group: "group-sample" # k8s.checklyhq.com/muted: "false" # If not set, default "true" + # k8s.checklyhq.com/path: "/baz" - Default read from spec.rules[*].http.paths[*].path + # k8s.checklyhq.com/success: "200" - Default "200" spec: rules: - host: "foo.bar" http: paths: - - path: / + - path: /foo + pathType: ImplementationSpecific + backend: + service: + name: test-service + port: + number: 8080 + - path: /bar + pathType: ImplementationSpecific + backend: + service: + name: test-service + port: + number: 8080 + - host: "example.com" + http: + paths: + - path: /tea + pathType: ImplementationSpecific + backend: + service: + name: test-service + port: + number: 8080 + - path: /coffee pathType: ImplementationSpecific backend: service: diff --git a/docs/ingress.md b/docs/ingress.md index 8d91fd2..1485857 100644 --- a/docs/ingress.md +++ b/docs/ingress.md @@ -1,11 +1,17 @@ # ingress -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. +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. -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. +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. > ***Warning*** -> We currently only support one API check / ingress resource. +> We currently only support API checks for ingress resources. + +## Logic of discovery + +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. + +Specific annotations are optional, as we can't automatically discover the group you want the Checkly APIChecks to be deployd in. ## Configuration options @@ -14,10 +20,10 @@ The name of the API Check derives from the `metadata.name` of the `ingress` reso | Annotation | Details | Default | |--------------------|-------------|---------| | `k8s.checklyhq.com/enabled` | Bool; Should the operator read the annotations or not | `false` (*required) | -| `k8s.checklyhq.com/path` | String; The URI to put after the `endpoint`, for example `/path` | "" (*required) | -| `k8s.checklyhq.com/endpoint` | String; The host of the URL, for example `/` | Value of `spec.rules[0].Host`, defaults to `https://` (*required) | +| `k8s.checklyhq.com/endpoint` | String; The host of the URL, for example `/` | Value of `spec.rules[0].Host`, defaults to `https://` | | `k8s.checklyhq.com/group` | String; Name of the group to which the check belongs; Kubernetes `Group` resource name` | none (*required)| | `k8s.checklyhq.com/muted` | String; Is the check muted or not | `true` | +| `k8s.checklyhq.com/path` | String; The URI to put after the `endpoint`, for example `/path` | ""| | `k8s.checklyhq.com/success` | String; The expected success code | `200` | ### Example @@ -29,7 +35,7 @@ metadata: name: checkly-operator-ingress annotations: k8s.checklyhq.com/enabled: "true" - k8s.checklyhq.com/path: "/baz" + # k8s.checklyhq.com/path: "/baz" - Default read from spec.rules[0].http.paths[*].path # k8s.checklyhq.com/endpoint: "foo.baaz" - Default read from spec.rules[0].host # k8s.checklyhq.com/success: "200" - Default "200" k8s.checklyhq.com/group: "group-sample" @@ -39,7 +45,14 @@ spec: - host: "foo.bar" http: paths: - - path: / + - path: /foo + pathType: ImplementationSpecific + backend: + service: + name: test-service + port: + number: 8080 + - path: /bar pathType: ImplementationSpecific backend: service: