Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aiven/aiven-operator
Provision and manage Aiven Services from your Kubernetes cluster.
https://github.com/aiven/aiven-operator
automation data databases kubernetes operator
Last synced: 16 days ago
JSON representation
Provision and manage Aiven Services from your Kubernetes cluster.
- Host: GitHub
- URL: https://github.com/aiven/aiven-operator
- Owner: aiven
- License: apache-2.0
- Created: 2020-03-04T09:38:08.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T12:37:03.000Z (10 months ago)
- Last Synced: 2024-04-12T18:47:35.536Z (10 months ago)
- Topics: automation, data, databases, kubernetes, operator
- Language: Go
- Homepage: https://aiven.github.io/aiven-operator
- Size: 10.1 MB
- Stars: 27
- Watchers: 67
- Forks: 15
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Aiven Operator
Provision and manage [Aiven Services](https://aiven.io/) from your Kubernetes cluster.
See the full documentation [here](https://aiven.github.io/aiven-operator/).
## Installation
To install the Operator, please follow the [installation instructions](https://aiven.github.io/aiven-operator/installation/helm.html).
## Deploying PostgreSQL at Aiven
Now let's create a `PostgreSQL` resource with the following YAML – please fill in your project name under in the `project` field:
```yaml
apiVersion: aiven.io/v1alpha1
kind: PostgreSQL
metadata:
name: aiven-pg
spec:
# reads the authentication token
authSecretRef:
name: aiven-token
key: token# stores the PostgreSQL connection information on the specified Secret
connInfoSecretTarget:
name: pg-connectionproject: PROJECT_NAME
cloudName: google-europe-west1
plan: hobbyist
maintenanceWindowDow: friday
maintenanceWindowTime: 23:00:00
userConfig:
pg_version: "15"
```Watch the resource being created and wait until its status is `RUNNING`:
```bash
watch kubectl get postgresql.aiven.io aiven-pg
```After created, the Operator will create a Kubernetes Secret containing the PostgreSQL connection information:
```bash
kubectl describe secret pg-connection
```Use the following [jq](https://github.com/jqlang/jq) command to decode the Secret:
```bash
kubectl get secret pg-connection -o json | jq '.data | map_values(@base64d)'
```## Connecting to PostgreSQL
Let's run a `psql` command to test the database connection using the generated Secret:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: psql-test-connection
spec:
restartPolicy: Never
containers:
- image: postgres:11
name: postgres
command: ["psql", "$(DATABASE_URI)", "-c", "SELECT version();"]
envFrom:
- secretRef:
name: pg-connection
```The Pod should the PostgreSQL version. You can verify with the following command:
```bash
$ kubectl logs psql-test-connection
version
---------------------------------------------------------------------------------------------
PostgreSQL 11.12 on x86_64-pc-linux-gnu, compiled by gcc, a 68c5366192 p 6b9244f01a, 64-bit
(1 row)
```## Contributing
We welcome and encourage contributions to this project. Please take a look at our [Contribution guide line](https://aiven.github.io/aiven-operator/contributing/index.html).
## License
[Apache 2](LICENSE).