Skip to content

Commit

Permalink
[pgo] add PGO chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jshimko committed Oct 4, 2024
1 parent e3900be commit 3ab88d8
Show file tree
Hide file tree
Showing 15 changed files with 11,474 additions and 0 deletions.
3 changes: 3 additions & 0 deletions charts/pgo/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://github.com/github/linguist/issues/4905
# https://github.com/github/linguist/issues/5092#issuecomment-730262298
/templates/*.tpl linguist-language=handlebars
1 change: 1 addition & 0 deletions charts/pgo/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git*
8 changes: 8 additions & 0 deletions charts/pgo/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v2
name: pgo
description: Installer for PGO, the open source Postgres Operator from Crunchy Data. https://access.crunchydata.com/documentation/postgres-operator/latest

type: application
# The version below should match the version on the PostgresCluster CRD
version: 5.6.1
appVersion: 5.6.1
40 changes: 40 additions & 0 deletions charts/pgo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Crunchy Postgres Operator

This chart is used to deploy [Crunchy Postgres Operator](https://access.crunchydata.com/documentation/postgres-operator/latest) (PGO).

This chart is just a copy of [their official chart](https://github.com/CrunchyData/postgres-operator-examples/tree/main/helm/install). It is only copied here so that it is published in a Helm repository (the official chart is not published anywhere and requires a manual git clone).

Docs:

<https://access.crunchydata.com/documentation/postgres-operator/latest/>

Examples Repo:

<https://github.com/CrunchyData/postgres-operator-examples>

Original source of this chart:

<https://github.com/CrunchyData/postgres-operator-examples/tree/main/helm/postgres>

## Usage

Add this chart repository if you haven't already:

```sh
helm repo add jshimko https://jshimko.github.io/helm-charts
helm repo update
```

To install PGO in your cluster:

```sh
helm install pgo -n pgo jshimko/pgo
```

Now you can deploy a `PostgresCluster` in any namespace:

```sh
helm install my-pg-cluster -n my-namespace -f my-values.yaml jshimko/postgrescluster
```

See the [postgrescluster chart](../postgrescluster) for more info.
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
labels:
app.kubernetes.io/name: pgo
app.kubernetes.io/version: 5.6.1
name: crunchybridgeclusters.postgres-operator.crunchydata.com
spec:
group: postgres-operator.crunchydata.com
names:
kind: CrunchyBridgeCluster
listKind: CrunchyBridgeClusterList
plural: crunchybridgeclusters
singular: crunchybridgecluster
scope: Namespaced
versions:
- name: v1beta1
schema:
openAPIV3Schema:
description: CrunchyBridgeCluster is the Schema for the crunchybridgeclusters API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: CrunchyBridgeClusterSpec defines the desired state of CrunchyBridgeCluster to be managed by Crunchy Data Bridge
properties:
clusterName:
description: The name of the cluster --- According to Bridge API/GUI errors, "Field name should be between 5 and 50 characters in length, containing only unicode characters, unicode numbers, hyphens, spaces, or underscores, and starting with a character", and ending with a character or number.
maxLength: 50
minLength: 5
pattern: ^[A-Za-z][A-Za-z0-9\-_ ]*[A-Za-z0-9]$
type: string
isHa:
description: Whether the cluster is high availability, meaning that it has a secondary it can fail over to quickly in case the primary becomes unavailable.
type: boolean
isProtected:
description: Whether the cluster is protected. Protected clusters can't be destroyed until their protected flag is removed
type: boolean
majorVersion:
description: The ID of the cluster's major Postgres version. Currently Bridge offers 13-16
maximum: 16
minimum: 13
type: integer
metadata:
description: Metadata contains metadata for custom resources
properties:
annotations:
additionalProperties:
type: string
type: object
labels:
additionalProperties:
type: string
type: object
type: object
plan:
description: The ID of the cluster's plan. Determines instance, CPU, and memory.
type: string
provider:
description: The cloud provider where the cluster is located. Currently Bridge offers aws, azure, and gcp only
enum:
- aws
- azure
- gcp
type: string
x-kubernetes-validations:
- message: immutable
rule: self == oldSelf
region:
description: The provider region where the cluster is located.
type: string
x-kubernetes-validations:
- message: immutable
rule: self == oldSelf
roles:
description: Roles for which to create Secrets that contain their credentials which are retrieved from the Bridge API. An empty list creates no role secrets. Removing a role from this list does NOT drop the role nor revoke their access, but it will delete that role's secret from the kube cluster.
items:
properties:
name:
description: 'Name of the role within Crunchy Bridge. More info: https://docs.crunchybridge.com/concepts/users'
type: string
secretName:
description: The name of the Secret that will hold the role credentials.
maxLength: 253
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
required:
- name
- secretName
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
secret:
description: The name of the secret containing the API key and team id
type: string
storage:
anyOf:
- type: integer
- type: string
description: The amount of storage available to the cluster in gigabytes. The amount must be an integer, followed by Gi (gibibytes) or G (gigabytes) to match Kubernetes conventions. If the amount is given in Gi, we round to the nearest G value. The minimum value allowed by Bridge is 10 GB. The maximum value allowed by Bridge is 65535 GB.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
required:
- clusterName
- isHa
- majorVersion
- plan
- provider
- region
- storage
type: object
status:
description: CrunchyBridgeClusterStatus defines the observed state of CrunchyBridgeCluster
properties:
conditions:
description: conditions represent the observations of postgres cluster's current state.
items:
description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type\
\ // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
host:
description: The Hostname of the postgres cluster in Bridge, provided by Bridge API and null until then.
type: string
id:
description: The ID of the postgres cluster in Bridge, provided by Bridge API and null until then.
type: string
isHa:
description: Whether the cluster is high availability, meaning that it has a secondary it can fail over to quickly in case the primary becomes unavailable.
type: boolean
isProtected:
description: Whether the cluster is protected. Protected clusters can't be destroyed until their protected flag is removed
type: boolean
majorVersion:
description: The cluster's major Postgres version.
type: integer
name:
description: The name of the cluster in Bridge.
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation on which the status was based.
format: int64
minimum: 0
type: integer
ongoingUpgrade:
description: The cluster upgrade as represented by Bridge
items:
properties:
flavor:
type: string
starting_from:
type: string
state:
type: string
required:
- flavor
- starting_from
- state
type: object
type: array
plan:
description: The ID of the cluster's plan. Determines instance, CPU, and memory.
type: string
responses:
description: Most recent, raw responses from Bridge API
type: object
x-kubernetes-preserve-unknown-fields: true
state:
description: State of cluster in Bridge.
type: string
storage:
anyOf:
- type: integer
- type: string
description: The amount of storage available to the cluster.
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
served: true
storage: true
subresources:
status: {}
Loading

0 comments on commit 3ab88d8

Please sign in to comment.