GithubHelp home page GithubHelp logo

kustom-spilo-postgres's Introduction

kustom-spilo-postgres

Kustomize-enabled manifests for deploying zalando/spilo HA PostgreSQL clusters into Kubernetes.

Usage

Create a kustomization.yaml file in your own repo. Here's an example:

bases:
  - git::ssh://[email protected]/hagmonk/kustom-spilo-postgres
  
commonLabels:
  cluster-name: mini

Ensure that environment variables SUPERUSER_PASSWORD and REPLICATION_PASSWORD are set when running the kustomize build command:

env SUPERUSER_PASSWORD=hovercraft REPLICATION_PASSWORD=eels kustomize build

This should product valid YAML that can be piped directly to kubectl apply -f -

Configuration

Kustomize has excellent documentation and examples, but here are some ideas to get you started for overriding config.

The underlying Spilo image is configured through environment variables, which are documented here for Patroni and here for Spilo.

kustomization.yaml

bases:
  - git::ssh://[email protected]/hagmonk/kustom-spilo-postgres

commonLabels:
  cluster-name: mini

# Target a different namespace
namespace: wonderland 

# Prefix all resource names with this
namePrefix: production-

# Merge new environment variables in
configMapGenerator:
- name: postgres
  behavior: merge
  literals: 
    - PGUSER_ADMIN=lord-foobar

# Tweak the statefulset for replicas and storage
patches:
  - statefulset-patch.yaml

statefulset-patch.yaml

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: postgres
spec:
  replicas: 3
  volumeClaimTemplates:
    - metadata:
        name: pgdata
      spec:
        storageClassName: hyper-ssd-gold-edition
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 300Gi

kustom-spilo-postgres's People

Contributors

hagmonk avatar

Watchers

 avatar  avatar

kustom-spilo-postgres's Issues

error: json: unknown field "commands"

kustomization.yaml

bases:
  - git::ssh://[email protected]/hagmonk/kustom-spilo-postgres

commonLabels:
  cluster-name: mini

# Target a different namespace
namespace: wonderland

# Prefix all resource names with this
namePrefix: production-

# Merge new environment variables in
configMapGenerator:
  - name: postgres
    behavior: merge
    literals:
      - PGUSER_ADMIN=lord-foobar
env SUPERUSER_PASSWORD=hovercraft REPLICATION_PASSWORD=eels  kustomize build
Error: accumulating resources: couldn't make target for path 'git::ssh://[email protected]/hagmonk/kustom-spilo-postgres': json: unknown field "commands"

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.