Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Kibana config field in stack config policy #7324

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
17d5ab3
restructing code
kvalliyurnatt Nov 6, 2023
45c7bf1
WIP kibana config edit
kvalliyurnatt Nov 3, 2023
f2c3b00
add kibana config reconciliation
kvalliyurnatt Nov 16, 2023
7411c49
add missing files
kvalliyurnatt Nov 16, 2023
b4413de
call reconciliation of kibana config
kvalliyurnatt Nov 17, 2023
47034a9
fix linting issues
kvalliyurnatt Nov 17, 2023
da82bd9
initial set of unit testsr
kvalliyurnatt Nov 20, 2023
37bddd9
adding some more unit tests
kvalliyurnatt Nov 21, 2023
89b4cc0
adding last set of unit tests
kvalliyurnatt Nov 21, 2023
f6464ef
adding a new unit test file
kvalliyurnatt Nov 21, 2023
bcb23ac
fixing status key
kvalliyurnatt Nov 22, 2023
6ef3b95
Apply suggestions from code review
kvalliyurnatt Nov 27, 2023
c410d6b
Update pkg/controller/stackconfigpolicy/controller.go
kvalliyurnatt Nov 27, 2023
8936915
Update pkg/controller/stackconfigpolicy/controller.go
kvalliyurnatt Nov 27, 2023
0e08d59
changing stackconfigpolicy status structure
kvalliyurnatt Nov 27, 2023
c4cf32f
add a default case for resource type
kvalliyurnatt Nov 27, 2023
1bee0b0
fixing linting issues
kvalliyurnatt Nov 27, 2023
fef39a3
fix some more linting issues
kvalliyurnatt Nov 27, 2023
9c7c203
Apply suggestions from code review
kvalliyurnatt Nov 28, 2023
3a00727
fix comments
kvalliyurnatt Nov 28, 2023
63f4473
Apply suggestions from code review
kvalliyurnatt Dec 1, 2023
56c2083
Apply suggestions from code review
kvalliyurnatt Dec 1, 2023
443f258
addressing review comments
kvalliyurnatt Dec 1, 2023
40a2d8f
add dynamic watches on secrets created by the user
kvalliyurnatt Dec 4, 2023
d2b90d5
fixing how dynamic watches are added
kvalliyurnatt Dec 4, 2023
a889d07
actually watch the dynamic watches
kvalliyurnatt Dec 4, 2023
defd7ca
add new secure settings fields for Elasticsearch and Kibana
kvalliyurnatt Dec 4, 2023
9c03470
add new secure settings file
kvalliyurnatt Dec 4, 2023
287366d
add unit tests for the secure settings
kvalliyurnatt Dec 4, 2023
dc67298
add new unit test file
kvalliyurnatt Dec 4, 2023
ba7efa1
re order imports
kvalliyurnatt Dec 4, 2023
47d74c0
fix how managed annotations are removed
kvalliyurnatt Dec 6, 2023
c57e2e4
add a warning webhook and also register webhooks for stackconfigpolicy
kvalliyurnatt Dec 7, 2023
77da3fb
fix linting issues
kvalliyurnatt Dec 7, 2023
649201f
fix typo in comment
kvalliyurnatt Dec 7, 2023
5d033bc
adjust deprecated statement
kvalliyurnatt Dec 9, 2023
d28d430
adjust deprecated statement further
kvalliyurnatt Dec 9, 2023
a7f5422
add a new map comparison function
kvalliyurnatt Dec 11, 2023
5a54010
fix linter issues
kvalliyurnatt Dec 11, 2023
72feca4
change variable names
kvalliyurnatt Dec 11, 2023
db7f481
rename map comparison function
kvalliyurnatt Dec 12, 2023
9b0143a
fixing map function and the logs
kvalliyurnatt Dec 13, 2023
9a86519
add new constants file for annotations
kvalliyurnatt Dec 13, 2023
1cfca02
create kibana config secret only when config is present
kvalliyurnatt Dec 13, 2023
6c8504a
Apply suggestions from code review
kvalliyurnatt Dec 14, 2023
32cd345
add secret keys only when data is present
kvalliyurnatt Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,7 @@ func setupWebhook(
&kbv1beta1.Kibana{},
&emsv1alpha1.ElasticMapsServer{},
&logstashv1alpha1.Logstash{},
&policyv1alpha1.StackConfigPolicy{},
}
for _, obj := range webhookObjects {
if err := commonwebhook.SetupValidatingWebhookWithConfig(&commonwebhook.Config{
Expand Down
126 changes: 96 additions & 30 deletions config/crds/v1/all-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10234,6 +10234,43 @@ spec:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
secureSettings:
description: SecureSettings are additional Secrets that contain
data to be configured to Elasticsearch's keystore.
items:
description: SecretSource defines a data source based on a Kubernetes
Secret.
properties:
entries:
description: Entries define how to project each key-value
pair in the secret to filesystem paths. If not defined,
all keys will be projected to similarly named paths in
the filesystem. If defined, only the specified keys will
be projected to the corresponding paths.
items:
description: KeyToPath defines how to map a key in a Secret
object to a filesystem path.
properties:
key:
description: Key is the key contained in the secret.
type: string
path:
description: Path is the relative file path to map
the key to. Path must not be an absolute file path
and must not contain any ".." components.
type: string
required:
- key
type: object
type: array
secretName:
description: SecretName is the name of the secret.
type: string
required:
- secretName
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
securityRoleMappings:
description: SecurityRoleMappings holds the Role Mappings settings
(/_security/role_mapping)
Expand All @@ -10256,21 +10293,40 @@ spec:
description: Config holds the settings that go into kibana.yml.
type: object
x-kubernetes-preserve-unknown-fields: true
secretMounts:
description: SecretMounts are additional secrets that need to
be mounted into the Kibana pods.
secureSettings:
description: SecureSettings are additional Secrets that contain
data to be configured to Kibana's keystore.
items:
description: SecretMount contains information about additional
secrets to be mounted to the elasticsearch pods
description: SecretSource defines a data source based on a Kubernetes
Secret.
properties:
mountPath:
description: MountPath denotes the path to which the secret
should be mounted to inside the elasticsearch pod
type: string
entries:
description: Entries define how to project each key-value
pair in the secret to filesystem paths. If not defined,
all keys will be projected to similarly named paths in
the filesystem. If defined, only the specified keys will
be projected to the corresponding paths.
items:
description: KeyToPath defines how to map a key in a Secret
object to a filesystem path.
properties:
key:
description: Key is the key contained in the secret.
type: string
path:
description: Path is the relative file path to map
the key to. Path must not be an absolute file path
and must not contain any ".." components.
type: string
required:
- key
type: object
type: array
secretName:
description: SecretName denotes the name of the secret that
needs to be mounted to the elasticsearch pod
description: SecretName is the name of the secret.
type: string
required:
- secretName
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
Expand Down Expand Up @@ -10324,6 +10380,8 @@ spec:
type: object
x-kubernetes-map-type: atomic
secureSettings:
description: 'Deprecated: SecureSettings only applies to Elasticsearch
and is deprecated. It must be set per application instead.'
items:
description: SecretSource defines a data source based on a Kubernetes
Secret.
Expand Down Expand Up @@ -10384,25 +10442,33 @@ spec:
type: integer
resourcesStatuses:
additionalProperties:
description: ResourcePolicyStatus models the status of the policy
for one resource to be configured.
properties:
currentVersion:
format: int64
type: integer
error:
properties:
message:
type: string
version:
format: int64
type: integer
type: object
expectedVersion:
format: int64
type: integer
phase:
type: string
additionalProperties:
description: ResourcePolicyStatus models the status of the policy
for one resource to be configured.
properties:
currentVersion:
description: CurrentVersion denotes the current version of
filesettings applied to the Elasticsearch cluster This field
does not apply to Kibana resources
format: int64
type: integer
error:
properties:
message:
type: string
version:
format: int64
type: integer
type: object
expectedVersion:
description: ExpectedVersion denotes the expected version
of filesettings that should be applied to the Elasticsearch
cluster This field does not apply to Kibana resources
format: int64
type: integer
phase:
type: string
type: object
type: object
description: ResourcesStatuses holds the status for each resource
to be configured.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,43 @@ spec:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
secureSettings:
description: SecureSettings are additional Secrets that contain
data to be configured to Elasticsearch's keystore.
items:
description: SecretSource defines a data source based on a Kubernetes
Secret.
properties:
entries:
description: Entries define how to project each key-value
pair in the secret to filesystem paths. If not defined,
all keys will be projected to similarly named paths in
the filesystem. If defined, only the specified keys will
be projected to the corresponding paths.
items:
description: KeyToPath defines how to map a key in a Secret
object to a filesystem path.
properties:
key:
description: Key is the key contained in the secret.
type: string
path:
description: Path is the relative file path to map
the key to. Path must not be an absolute file path
and must not contain any ".." components.
type: string
required:
- key
type: object
type: array
secretName:
description: SecretName is the name of the secret.
type: string
required:
- secretName
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
securityRoleMappings:
description: SecurityRoleMappings holds the Role Mappings settings
(/_security/role_mapping)
Expand All @@ -126,21 +163,40 @@ spec:
description: Config holds the settings that go into kibana.yml.
type: object
x-kubernetes-preserve-unknown-fields: true
secretMounts:
description: SecretMounts are additional secrets that need to
be mounted into the Kibana pods.
secureSettings:
description: SecureSettings are additional Secrets that contain
data to be configured to Kibana's keystore.
items:
description: SecretMount contains information about additional
secrets to be mounted to the elasticsearch pods
description: SecretSource defines a data source based on a Kubernetes
Secret.
properties:
mountPath:
description: MountPath denotes the path to which the secret
should be mounted to inside the elasticsearch pod
type: string
entries:
description: Entries define how to project each key-value
pair in the secret to filesystem paths. If not defined,
all keys will be projected to similarly named paths in
the filesystem. If defined, only the specified keys will
be projected to the corresponding paths.
items:
description: KeyToPath defines how to map a key in a Secret
object to a filesystem path.
properties:
key:
description: Key is the key contained in the secret.
type: string
path:
description: Path is the relative file path to map
the key to. Path must not be an absolute file path
and must not contain any ".." components.
type: string
required:
- key
type: object
type: array
secretName:
description: SecretName denotes the name of the secret that
needs to be mounted to the elasticsearch pod
description: SecretName is the name of the secret.
type: string
required:
- secretName
type: object
type: array
x-kubernetes-preserve-unknown-fields: true
Expand Down Expand Up @@ -194,6 +250,8 @@ spec:
type: object
x-kubernetes-map-type: atomic
secureSettings:
description: 'Deprecated: SecureSettings only applies to Elasticsearch
and is deprecated. It must be set per application instead.'
items:
description: SecretSource defines a data source based on a Kubernetes
Secret.
Expand Down Expand Up @@ -254,25 +312,33 @@ spec:
type: integer
resourcesStatuses:
additionalProperties:
description: ResourcePolicyStatus models the status of the policy
for one resource to be configured.
properties:
currentVersion:
format: int64
type: integer
error:
properties:
message:
type: string
version:
format: int64
type: integer
type: object
expectedVersion:
format: int64
type: integer
phase:
type: string
additionalProperties:
description: ResourcePolicyStatus models the status of the policy
for one resource to be configured.
properties:
currentVersion:
description: CurrentVersion denotes the current version of
filesettings applied to the Elasticsearch cluster This field
does not apply to Kibana resources
format: int64
type: integer
error:
properties:
message:
type: string
version:
format: int64
type: integer
type: object
expectedVersion:
description: ExpectedVersion denotes the expected version
of filesettings that should be applied to the Elasticsearch
cluster This field does not apply to Kibana resources
format: int64
type: integer
phase:
type: string
type: object
type: object
description: ResourcesStatuses holds the status for each resource
to be configured.
Expand Down
Loading