-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from amazeeio/postgres
Add support for PostgreSQL
- Loading branch information
Showing
54 changed files
with
1,979 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ resources: | |
kind: MariaDBProvider | ||
version: v1 | ||
version: "2" | ||
multigroup: true |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
// Package v1 contains API Schema definitions for the postgres v1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=postgres.amazee.io | ||
package v1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "postgres.amazee.io", Version: "v1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// PostgreSQLConsumerSpec defines the desired state of PostgreSQLConsumer | ||
type PostgreSQLConsumerSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
// These are the spec options for consumers | ||
Environment string `json:"environment,omitempty"` | ||
Provider PostgreSQLConsumerProvider `json:"provider,omitempty"` | ||
Consumer PostgreSQLConsumerData `json:"consumer,omitempty"` | ||
} | ||
|
||
// PostgreSQLConsumerData defines the provider link for this consumer | ||
type PostgreSQLConsumerData struct { | ||
Database string `json:"database,omitempty"` | ||
Password string `json:"password,omitempty"` | ||
Username string `json:"username,omitempty"` | ||
Services PostgreSQLConsumerServices `json:"services,omitempty"` | ||
} | ||
|
||
// PostgreSQLConsumerServices defines the provider link for this consumer | ||
type PostgreSQLConsumerServices struct { | ||
Primary string `json:"primary,omitempty"` | ||
} | ||
|
||
// PostgreSQLConsumerProvider defines the provider link for this consumer | ||
type PostgreSQLConsumerProvider struct { | ||
Name string `json:"name,omitempty"` | ||
Namespace string `json:"namespace,omitempty"` | ||
Hostname string `json:"hostname,omitempty"` | ||
Port string `json:"port,omitempty"` | ||
} | ||
|
||
// PostgreSQLConsumerStatus defines the observed state of PostgreSQLConsumer | ||
type PostgreSQLConsumerStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// PostgreSQLConsumer is the Schema for the postgresqlconsumers API | ||
type PostgreSQLConsumer struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec PostgreSQLConsumerSpec `json:"spec,omitempty"` | ||
Status PostgreSQLConsumerStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// PostgreSQLConsumerList contains a list of PostgreSQLConsumer | ||
type PostgreSQLConsumerList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []PostgreSQLConsumer `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&PostgreSQLConsumer{}, &PostgreSQLConsumerList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! | ||
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. | ||
|
||
// PostgreSQLProviderSpec defines the desired state of PostgreSQLProvider | ||
type PostgreSQLProviderSpec struct { | ||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
|
||
// These are the spec options for providers | ||
Environment string `json:"environment,omitempty"` | ||
Hostname string `json:"hostname,omitempty"` | ||
Password string `json:"password,omitempty"` | ||
Port string `json:"port,omitempty"` | ||
Username string `json:"user,omitempty"` | ||
Name string `json:"name,omitempty"` | ||
Namespace string `json:"namespace,omitempty"` | ||
Type string `json:"type,omitempty"` | ||
} | ||
|
||
// PostgreSQLProviderStatus defines the observed state of PostgreSQLProvider | ||
type PostgreSQLProviderStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// PostgreSQLProvider is the Schema for the postgresqlproviders API | ||
type PostgreSQLProvider struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec PostgreSQLProviderSpec `json:"spec,omitempty"` | ||
Status PostgreSQLProviderStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// PostgreSQLProviderList contains a list of PostgreSQLProvider | ||
type PostgreSQLProviderList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []PostgreSQLProvider `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&PostgreSQLProvider{}, &PostgreSQLProviderList{}) | ||
} |
Oops, something went wrong.