Skip to content

Commit 5db1a8a

Browse files
authored
Merge pull request #103 from Kuadrant/cmd-line-flags
Configure Authorino using command-line flags
2 parents b08ed22 + 49210a1 commit 5db1a8a

11 files changed

+521
-248
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Each [`Authorino`](https://github.com/Kuadrant/authorino-operator/tree/main/conf
128128
| listener | [Listener](#listener) | Specification of the authorization service (gRPC interface). | Required |
129129
| oidcServer | [OIDCServer](#oidcserver) | Specification of the OIDC service. | Required |
130130
| metrics | [Metrics](#metrics) | Configuration of the metrics server (port, level). | Optional |
131+
| healthz | [Healthz](#healthz) | Configuration of the health/readiness probe (port). | Optional |
131132
| volumes | [VolumesSpec](#volumesspec) | Additional volumes to be mounted in the Authorino pods. | Optional |
132133

133134
#### Listener
@@ -177,6 +178,14 @@ Configuration of the metrics server.
177178
| port | Integer | Port number of the metrics server. | Default: `8080` |
178179
| deep | Boolean | Enable/disable metrics at the level of each evaluator config (if requested in the [`AuthConfig`](https://github.com/Kuadrant/authorino/blob/main/docs/user-guides/metrics.md)) exported by the metrics server. | Default: `false` |
179180

181+
#### Healthz
182+
183+
Configuration of the health/readiness probe (port).
184+
185+
| Field | Type | Description | Required/Default |
186+
|-------|:-------:|-------------|------------------|
187+
| port | Integer | Port number of the health/readiness probe. | Default: `8081` |
188+
180189

181190
#### VolumesSpec
182191

api/v1beta1/authorino_types.go

+7-61
Original file line numberDiff line numberDiff line change
@@ -28,67 +28,7 @@ type ConditionType string
2828

2929
const (
3030
// ConditionReady specifies that the resource is ready
31-
ConditionReady ConditionType = "Ready"
32-
AuthorinoContainerName string = "authorino"
33-
34-
// Authorino EnvVars
35-
EnvWatchNamespace string = "WATCH_NAMESPACE"
36-
EnvAuthConfigLabelSelector string = "AUTH_CONFIG_LABEL_SELECTOR"
37-
EnvSecretLabelSelector string = "SECRET_LABEL_SELECTOR"
38-
EnvEvaluatorCacheSize string = "EVALUATOR_CACHE_SIZE"
39-
EnvDeepMetricsEnabled string = "DEEP_METRICS_ENABLED"
40-
EnvLogLevel string = "LOG_LEVEL"
41-
EnvLogMode string = "LOG_MODE"
42-
EnvExtAuthGRPCPort string = "EXT_AUTH_GRPC_PORT"
43-
EnvExtAuthHTTPPort string = "EXT_AUTH_HTTP_PORT"
44-
EnvTlsCert string = "TLS_CERT"
45-
EnvTlsCertKey string = "TLS_CERT_KEY"
46-
EnvTimeout string = "TIMEOUT"
47-
EnvOIDCHTTPPort string = "OIDC_HTTP_PORT"
48-
EnvOidcTlsCertPath string = "OIDC_TLS_CERT"
49-
EnvOidcTlsCertKeyPath string = "OIDC_TLS_CERT_KEY"
50-
EnvMaxHttpRequestBodySize string = "MAX_HTTP_REQUEST_BODY_SIZE"
51-
FlagLeaderElectionEnabled string = "enable-leader-election"
52-
FlagMetricsAddr string = "metrics-addr"
53-
54-
// Authorino TLS file paths
55-
DefaultTlsCertPath string = "/etc/ssl/certs/tls.crt"
56-
DefaultTlsCertKeyPath string = "/etc/ssl/private/tls.key"
57-
DefaultOidcTlsCertPath string = "/etc/ssl/certs/oidc.crt"
58-
DefaultOidcTlsCertKeyPath string = "/etc/ssl/private/oidc.key"
59-
60-
// Authorino service ports
61-
DefaultAuthGRPCServicePort int32 = 50051
62-
DefaultAuthHTTPServicePort int32 = 5001
63-
DefaultOIDCServicePort int32 = 8083
64-
DefaultMetricsServicePort int32 = 8080
65-
66-
DefaultAuthorinoImage string = "quay.io/kuadrant/authorino:latest"
67-
68-
// Status reasons
69-
AuthorinoProvisioningReason = "Provisioning"
70-
AuthorinoProvisionedReason = "Provisioned"
71-
AuthorinoUpdatedReason = "Updated"
72-
AuthorinoUnableToCreateServices = "UnableToCreateServices"
73-
AuthorinoUnableToCreateDeployment = "UnableToCreateDeployment"
74-
AuthorinoUnableToCreateLeaderElectionRole = "UnableToCreateLeaderElectionRole"
75-
AuthorinoUnableToCreatePermission = "UnableToCreatePermission"
76-
AuthorinoUnableToCreateServiceAccount = "UnableToCreateServiceAccount"
77-
AuthorinoUnableToCreateBindingForClusterRole = "UnableToBindingForClusterRole"
78-
AuthorinoUnableToCreateLeaderElectionRoleBinding = "UnableToCreateLeaderElectionRoleBinding"
79-
AuthorinoClusterRoleNotFound = "ClusterRoleNotFound"
80-
AuthorinoUnableToGetClusterRole = "UnableToGetClusterRole"
81-
AuthorinoUnableToGetServices = "UnableToGetServices"
82-
AuthorinoUnableToGetBindingForClusterRole = "UnableToGetBindingForClusterRole"
83-
AuthorinoUnableToGetServiceAccount = "UnableToGetServiceAccount"
84-
AuthorinoUnableToGetLeaderElectionRole = "UnableToGetLeaderElectionRole"
85-
AuthorinoUnableToGetLeaderElectionRoleBinding = "UnableToGetLeaderElectionRoleBinding"
86-
AuthorinoUnableToGetDeployment = "UnableToGetDeployment"
87-
AuthorinoUnableToGetTlsSecret = "UnableToGetTlsSecret"
88-
AuthorinoTlsSecretNotFound = "TlsSecretNotFound"
89-
AuthorinoTlsSecretNotProvided = "TlsSecretNotProvided"
90-
AuthorinoUnableToUpdateDeployment = "UnableToUpdateDeployment"
91-
AuthorinoDeploymentNotReady = "DeploymentNotReady"
31+
ConditionReady ConditionType = "Ready"
9232
)
9333

9434
type Condition struct {
@@ -133,6 +73,7 @@ type AuthorinoSpec struct {
13373
SecretLabelSelectors string `json:"secretLabelSelectors,omitempty"`
13474
EvaluatorCacheSize *int `json:"evaluatorCacheSize,omitempty"`
13575
Metrics Metrics `json:"metrics,omitempty"`
76+
Healthz Healthz `json:"healthz,omitempty"`
13677
}
13778

13879
type Listener struct {
@@ -164,6 +105,11 @@ type Metrics struct {
164105
DeepMetricsEnabled *bool `json:"deep,omitempty"`
165106
}
166107

108+
type Healthz struct {
109+
// Port number of the health/readiness probe endpoints.
110+
Port *int32 `json:"port,omitempty"`
111+
}
112+
167113
type Tls struct {
168114
Enabled *bool `json:"enabled,omitempty"`
169115
CertSecret *k8score.LocalObjectReference `json:"certSecretRef,omitempty"`

api/v1beta1/zz_generated.deepcopy.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/manifests/operator.authorino.kuadrant.io_authorinos.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
type: boolean
4141
evaluatorCacheSize:
4242
type: integer
43+
healthz:
44+
properties:
45+
port:
46+
description: Port number of the health/readiness probe endpoints.
47+
format: int32
48+
type: integer
49+
type: object
4350
image:
4451
type: string
4552
imagePullPolicy:

config/crd/bases/operator.authorino.kuadrant.io_authorinos.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ spec:
4242
type: boolean
4343
evaluatorCacheSize:
4444
type: integer
45+
healthz:
46+
properties:
47+
port:
48+
description: Port number of the health/readiness probe endpoints.
49+
format: int32
50+
type: integer
51+
type: object
4552
image:
4653
type: string
4754
imagePullPolicy:

config/deploy/manifests.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,13 @@ spec:
19471947
type: boolean
19481948
evaluatorCacheSize:
19491949
type: integer
1950+
healthz:
1951+
properties:
1952+
port:
1953+
description: Port number of the health/readiness probe endpoints.
1954+
format: int32
1955+
type: integer
1956+
type: object
19501957
image:
19511958
type: string
19521959
imagePullPolicy:

config/install/manifests.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ spec:
4040
type: boolean
4141
evaluatorCacheSize:
4242
type: integer
43+
healthz:
44+
properties:
45+
port:
46+
description: Port number of the health/readiness probe endpoints.
47+
format: int32
48+
type: integer
49+
type: object
4350
image:
4451
type: string
4552
imagePullPolicy:

0 commit comments

Comments
 (0)