Feature Gate Installation Guide
This page provides an overview of the feature gates an administrator can enable or disable during installation of Crunchy Postgres for Kubernetes. If you've downloaded the installer from the Crunchy Data Customer Portal, please refer to the customer guide there for alternative setup information.
Feature Gates Available in Crunchy Postgres for Kubernetes
PGO Feature Gate | Default setting | Since | Until |
---|---|---|---|
AppendCustomQueries | false | v5.5.0 | - |
AutoCreateUserSchema | false | v5.6.1 | v5.6.2 |
AutoCreateUserSchema | true | v5.6.2 | - |
AutoGrowVolumes | false | v5.6.0 | - |
InstanceSidecars | false | v5.2.0 | - |
PGUpgradeCPUConcurrency | false | v5.6.4 | - |
PGBouncerSidecars | false | v5.2.0 | - |
TablespaceVolumes | false | v5.4.0 | - |
VolumeSnapshots | false | v5.7.0 | - |
- 1Use the values in the PGO Feature Gate column in place of FeatureName in the installation instructions below.
Helm
First, go to GitHub and fork the Postgres Operator examples repository, which contains the Crunchy Postgres for Kubernetes Helm installer.
To enable feature gates with Helm, find helm/install/values.yaml
in the examples repository and uncomment the features
key.
Add a key from the table above for each PGO Feature Gate you want to enable, and set the
value to true. For example, you can enable disk auto-grow and custom queries for monitoring like this:
features:
AutoGrowVolumes: true
AppendCustomQueries: true
If you haven't installed the operator yet, run:
helm install $NAME -n $NAMESPACE helm/install
Otherwise, run:
helm upgrade $NAME -n $NAMESPACE helm/install
Kustomize
First, go to GitHub and fork the Postgres Operator examples repository, which contains the Crunchy Postgres for Kubernetes Kustomize installer.
PGO Feature Gates can be enabled with Kustomize by setting the PGO_FEATURE_GATES
env variable in your
container spec. In the kustomize/install/default/kustomization.yaml
file in the examples repository
you will see a section like this:
patches:
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgo
spec:
template:
spec:
containers:
- name: operator
env:
- name: PGO_FEATURE_GATES
value: ""
...which patches the operator Deployment, adding the PGO_FEATURE_GATES
environment variable.
To turn on feature gates, set the value for PGO_FEATURE_GATES
as "FeatureName=true,FeatureName2=true,FeatureName3=true",
where each FeatureName is the PGO Feature Gate you want to enable. You can list as many PGO Feature Gates as you need.
To apply the changes, run:
kubectl apply --server-side -k kustomize/install/default
OLM
After Crunchy Postgres for Kubernetes has been installed from OperatorHub, you can set feature gates by clicking on Installed Operators and selecting Crunchy Postgres for Kubernetes. From there, select Subscription and from the Actions dropdown menu select Edit Subscription. Scroll to the spec section and you can create a config block to set environment variables like this:
spec:
config:
env:
- name: PGO_FEATURE_GATES
value: "FeatureName=true,FeatureName2=true,FeatureName3=true"
...where each FeatureName is the PGO Feature Gate you want to enable. You can list as many PGO Feature Gates as you need. After you’ve adjusted the Subscription to meet your needs, save it and observe that the environment variables in your PGO pod have updated.
Checking which Feature Gates are enabled
You can check what features are enabled by checking the logs when the operator pod is first deployed.
The logs include both the user-defined PGO_FEATURE_GATES
environment variable
and what feature gates are actually enabled. This way you can check both what you've set
and what features are on by default (and haven't been explicitly disabled).