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

Add ability to configure opensearch snapshot repositories #1653

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 1 deletion apis/ai/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 62 additions & 0 deletions apis/logging/v1beta1/opensearchrepository_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package v1beta1

import (
opnimeta "github.com/rancher/opni/pkg/util/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

type OpensearchRepositoryState string

const (
OpensearchRepositoryError OpensearchRepositoryState = "Error"
OpensearchRepositoryCreated OpensearchRepositoryState = "Created"
)

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
// +kubebuilder:printcolumn:name="State",type=boolean,JSONPath=`.status.state`

type OpensearchRepository struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec OpensearchRepositorySpec `json:"spec,omitempty"`
Status OpensearchRepositoryStatus `json:"status,omitempty"`
}

type OpensearchRepositorySpec struct {
Settings RepositorySettings `json:"settings"`
OpensearchClusterRef *opnimeta.OpensearchClusterRef `json:"opensearchClusterRef"`
}

type RepositorySettings struct {
S3 *S3PathSettings `json:"s3,omitempty"`
FileSystem *FileSystemSettings `json:"filesystem,omitempty"`
}

type S3PathSettings struct {
Bucket string `json:"bucket"`
Folder string `json:"folder"`
}

type FileSystemSettings struct {
Location string `json:"location"`
}

type OpensearchRepositoryStatus struct {
State OpensearchRepositoryState `json:"state,omitempty"`
FailureMessage string `json:"failureMessage,omitempty"`
}

// +kubebuilder:object:root=true

// OpensearchRepositoryList contains a list of OpensearchRepository
type OpensearchRepositoryList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []OpensearchRepository `json:"items"`
}

func init() {
SchemeBuilder.Register(&OpensearchRepository{}, &OpensearchRepositoryList{})
}
18 changes: 18 additions & 0 deletions apis/logging/v1beta1/opniopensearch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ const (
OpniOpensearchStateReady OpniOpensearchState = "Ready"
)

type OpensearchS3Protocol string

const (
OpensearchS3ProtocolHTTPS OpensearchS3Protocol = "https"
OpensearchS3ProtocolHTTP OpensearchS3Protocol = "http"
)

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
Expand Down Expand Up @@ -50,6 +57,17 @@ type OpensearchSettings struct {
NodePools []opsterv1.NodePool `json:"nodePools,omitempty"`
Dashboards opsterv1.DashboardsConfig `json:"dashboards,omitempty"`
Security *opsterv1.Security `json:"security,omitempty"`
S3Settings *OpensearchS3Settings `json:"s3,omitempty"`
}

type OpensearchS3Settings struct {
Endpoint string `json:"endpoint,omitempty"`
PathStyleAccess bool `json:"pathStyleAccess,omitempty"`
Protocol OpensearchS3Protocol `json:"protocol,omitempty"`
ProxyHost string `json:"proxyHost,omitempty"`
ProxyPort *int32 `json:"proxyPort,omitempty"`
CredentialSecret corev1.LocalObjectReference `json:"credentialSecret,omitempty"`
Repository S3PathSettings `json:"repository,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
178 changes: 177 additions & 1 deletion apis/logging/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/monitoring/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/ai.opni.io_opniclusters.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/ai.opni.io_pretrainedmodels.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/core.opni.io_alertingclusters.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/core.opni.io_bootstraptokens.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/core.opni.io_collectors.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/core.opni.io_gateways.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions config/crd/bases/core.opni.io_keyrings.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading