Git Product home page Git Product logo

aiven-operator's Introduction

Aiven Operator

Provision and manage Aiven Services from your Kubernetes cluster.

See the full documentation here.

Installation

To install the Operator, please follow the installation instructions.

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:

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-connection

  project: <your-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:

watch kubectl get postgresql.aiven.io aiven-pg

After created, the Operator will create a Kubernetes Secret containing the PostgreSQL connection information:

kubectl describe secret pg-connection

Use the following jq command to decode the Secret:

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:

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:

$ 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.

License

Apache 2.

aiven-operator's People

Contributors

ivan-savciuc avatar dependabot[bot] avatar byashimov avatar mhoffm-aiven avatar rriski avatar serpentiel avatar pkalliok-aiven avatar jeff-held-aiven avatar github-actions[bot] avatar hab-anka avatar staceysalamon-aiven avatar encima avatar tsharju avatar mortenlj avatar nkchern-avn avatar sjamgade avatar ryaneorth avatar kaessert avatar chazu avatar christoffer-eide avatar dariusch avatar staaldraad avatar vidofnir avatar amstee avatar lukas-vlcek avatar zyguy-ankorstore avatar sebastienblanc avatar tv2rd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.