Giter VIP home page Giter VIP logo

nr-patroni-chart's Introduction

Patroni Chart License Lifecycle:Maturing

A Reusable Helm chart for Patroni (Highly-Available PostgreSQL database), with a default configuration adapted to deployment on the BC Government's OpenShift cluster.

To learn more about the Common Services available visit the Common Services Showcase page.

Directory Structure

.github/                   - PR and Issue templates
charts/                    - Helm chart root
└── patroni/               - Patroni Helm chart root
    ├── templates/         - Patroni template objects
    ├── Chart.yaml         - Patroni Chart definition
    └── values.yaml        - Patroni Chart default values
CODE-OF-CONDUCT.md         - Code of Conduct
COMPLIANCE.yaml            - BCGov PIA/STRA compliance status
CONTRIBUTING.md            - Contributing Guidelines
LICENSE                    - License
SECURITY.md                - Security Policy and Reporting

Installation

You are deploying your application server with Helm

  1. Add Patroni as a dependency in your Chart.yaml
dependencies:
- name: patroni
    version: 0.0.4
    repository: https://bcgov.github.io/nr-patroni-chart
    # by default, the object created will be named <your-app>-patroni. You can use an alias to override the -patroni suffix
    # Example "alias: postgres" would have "postgres" as the suffix instead.
  1. Update your application (don't forget to update your helm dependencies with helm dep up)

You are not deploying your application with Helm

If this is your first time using helm, check out the quickstart guide. The steps below are similar to the one from the quickstart guide, but specifically for this chart

  1. Add Patroni Chart repository to Helm
$ helm repo add patroni-chart https://bcgov.github.io/nr-patroni-chart

Once the repo is added, you can check the available charts with:

$ helm search repo patroni-chart
NAME                    CHART VERSION   APP VERSION              DESCRIPTION
patroni-chart/patroni   0.1.0           2.0.1-12.4-latest        Highly available elephant herd: HA PostgreSQL c...
  1. Install an instance of the chart with:
$ helm install -n my-namespace my-patroni-instance patroni-chart/patroni
NAME: my-patroni-instance
LAST DEPLOYED: Mon Feb 28 15:38:32 2022
NAMESPACE: my-namespace
STATUS: deployed
REVISION: 1

Configuration and default behaviour

You can find an exhaustive list of the configurable settings in charts/patroni/values.yaml.

Accessing the database cluster

This chart creates two services, allowing to access the leader (read/write connection) and replica (read-only connection) pods, respectively. The postgres user's password is available in the secret created by this chart under the superuser-password key. Note that you should only use the postgres user to create the user that will actually be used by your application, as applications should not use superusers.

Documentation

Getting Help or Reporting an Issue

To report bugs/issues/features requests, please file an issue.

How to Contribute

If you would like to contribute, please see our contributing guidelines.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

Copyright 2022 Province of British Columbia

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.

nr-patroni-chart's People

Contributors

caggles avatar jujaga avatar timcsaky avatar wilwong89 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nr-patroni-chart's Issues

The two services that are being created, don't have any pods attached to them.

Hi! I am using the following values.yaml file to install a Patroni Postgres instance. The pods are up, but the services that are created don't have any pods attached to them. Could you please help me with this issue. Thanks!

# Default values for patroni.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 3

image:
  repository: artifacts.developer.gov.bc.ca/bcgov-docker-local
  pullPolicy: Always
  # Overrides the image name whose default is the chart name.
  name: patroni-postgres
  # Overrides the image tag whose default is the chart appVersion.
  tag: ~

imagePullSecrets: []
nameOverride: ~
fullnameOverride: ~

credentials:
  # # Username of replication account
  # replicationUsername: replication
  # # Username of superuser account
  # superuserUsername: postgres
  # # Application database name
  appDbName: bc-pvs
  # # Username of application account
  appDbUserame: admin
# To use an existing secret instead of having the chart generate one, provide the name of the existing secret here.
# Note that this secret must be formatted the same way as the secret generated by the chart.
# Leave it blank to allow the helm chart to generate a secret for you.
secretOverride: ~

serviceAccount:
  # Specifies whether a service account should be created
  create: true
  # Annotations to add to the service account
  annotations: {}
  # The name of the service account to use.
  # If not set and create is true, a name is generated using the fullname template
  name: ~

podAnnotations: {}

podAntiAffinity: true

podSecurityContext: {}
  # fsGroup: 2000

securityContext: {}
  # capabilities:
  #   drop:
  #   - ALL
  # readOnlyRootFilesystem: true
  # runAsNonRoot: true
  # runAsUser: 1000

service:
  enableReadOnly: true
  # Annotations to add to the service account
  annotations: {}
  type: ClusterIP
  port: 5432
  portName: db

networkPolicy:
  enabled: true

probes:
  liveness:
    enabled: true
  readiness:
    enabled: false

resources:
  # We usually recommend not to specify default resources and to leave this as a conscious
  # choice for the user. This also increases chances charts run on environments with little
  # resources, such as Minikube. If you do want to specify resources, uncomment the following
  # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
  limits:
    cpu: 500m
    memory: 1Gi
  requests:
    cpu: 20m
    memory: 512Mi

persistentVolume:
  enabled: true
  accessModes:
    - ReadWriteOnce
  annotations: {}
  mountPath: "/home/postgres/pgdata"
  size: 3Gi
  storageClass: "netapp-block-standard"

patronictl pause and resume function will not work with current PATRONI_RESTAPI_LISTEN setting

Describe the bug

The current setting for the PATRONI_RESTAPI_LISTEN environment variable is "0.0.0.0:8008".
However when running a patroninctl pause (to get into maintenance mode) and then the patroninctl resume it runs into an error where the system is left in maintenance mode. The error says that it cannot find the rest api at 0.0.0.0:8008.
By setting PATRONI_RESTAPI_LISTEN=$POD_IP:8008' the issue is solved.

I suggest to include this in the set up.

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 180 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Lets use common phrasing

TL;DR 🏎️

Teams are encouraged to favour modern inclusive phrasing both in their communication as well as in any source checked into their repositories. You'll find a table at the end of this text with preferred phrasing to socialize with your team.

Words Matter

We're aligning our development community to favour inclusive phrasing for common technical expressions. There is a table below that outlines the phrases that are being retired along with the preferred alternatives.

During your team scrum, technical meetings, documentation, the code you write, etc. use the inclusive phrasing from the table below. That's it - it really is that easy.

For the curious mind, the Public Service Agency (PSA) has published a guide describing how Words Matter in our daily communication. Its an insightful read and a good reminder to be curious and open minded.

What about the master branch?

The word "master" is not inherently bad or non-inclusive. For example people get a masters degree; become a master of their craft; or master a skill. It's generally when the word "master" is used along side the word "slave" that it becomes non-inclusive.

Some teams choose to use the word main for the default branch of a repo as opposed to the more commonly used master branch. While it's not required or recommended, your team is empowered to do what works for them. If you do rename the master branch consider using main so that we have consistency among the repos within our organization.

Preferred Phrasing

Non-Inclusive Inclusive
Whitelist => Allowlist
Blacklist => Denylist
Master / Slave => Leader / Follower; Primary / Standby; etc
Grandfathered => Legacy status
Sanity check => Quick check; Confidence check; etc
Dummy value => Placeholder value; Sample value; etc

Pro Tip 🤓

This list is not comprehensive. If you're aware of other outdated nomenclature please create an issue (PR preferred) with your suggestion.

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 180 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means it's critical that we work to make our content as discoverable as possible. Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's it, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip 🤓

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
IRR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Service Agency
PSSG Public Safety and Solicitor General
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

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.