Skip to content

Commit

Permalink
Add apache age extension for postgres alpine image
Browse files Browse the repository at this point in the history
Signed-off-by: souravbiswassanto <[email protected]>
  • Loading branch information
souravbiswassanto committed May 14, 2024
1 parent 72f78ee commit 5a66b4d
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 132 deletions.
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/postgres-docker.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

69 changes: 0 additions & 69 deletions .idea/workspace.xml

This file was deleted.

39 changes: 19 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
## Copyright The KubeDB Authors.
##
## 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.
# Copyright The KubeDB Authors.
#
FROM postgres:15.5-bookworm AS builder
# 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.

FROM postgres:15.5-alpine as builder
RUN apk add --update alpine-sdk clang15-dev llvm15 perl postgresql15-dev bison libc-dev gcc git flex zlib-dev readline-dev build-base

RUN apt-get update \
&& apt-get install -y git build-essential postgresql-server-dev-15 libreadline-dev zlib1g-dev flex bison clang-14
RUN git clone https://github.com/apache/age.git \
&& cd /age \
&& git checkout release/PG15/1.5.0 \
&& make PG_CONFIG=/usr/bin/pg_config install
&& make install PG_CONFIG=/usr/local/bin/pg_config

FROM postgres:15.5-bookworm
COPY --from=builder /usr/share/postgresql /usr/share/postgresql
COPY --from=builder /usr/lib/postgresql /usr/lib/postgresql
FROM postgres:15.5-alpine
COPY --from=builder /usr/local/share/postgresql /usr/local/share/postgresql
COPY --from=builder /usr/local/lib/postgresql /usr/local/lib/postgresql
7 changes: 3 additions & 4 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@
2. Create catalog.yaml

```
kubectl apply -f https://github.com/kubedb/postgres-docker/raw/release-15.3-alpine-tds_fdw/example/catalog.yaml
kubectl apply -f https://raw.githubusercontent.com/kubedb/postgres-docker/15.5-bookworm-age/example/catalog.yaml
```

3. Deploy a demo PostgreSQL database.

```
kubectl apply -f https://github.com/kubedb/postgres-docker/raw/release-15.3-alpine-tds_fdw/example/demo.yaml
kubectl apply -f https://raw.githubusercontent.com/kubedb/postgres-docker/15.5-bookworm-age/example/demo.yaml
```
4. Wait until postgres is ready.
```bash
NAME VERSION STATUS AGE
postgres.kubedb.com/ha-postgres 15.5-bookworm Ready 22m
postgres.kubedb.com/ha-postgres 15.5 Ready 22m

```
5. Exec into the pod and run psql command.
```bash
kubectl exec -it -n demo ha-postgres-0 -- bash
Defaulted container "postgres" out of: postgres, pg-coordinator, postgres-init-container (init)
postgres@ha-postgres-0:/$ psql
psql (15.7 (Debian 15.7-1.pgdg120+1))
Type "help" for help.

postgres=#
Expand Down
14 changes: 7 additions & 7 deletions example/catalog.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: catalog.kubedb.com/v1alpha1
kind: PostgresVersion
metadata:
name: 15.5-bookworm
name: "15.5"
spec:
archiver:
addon:
Expand All @@ -14,12 +14,12 @@ spec:
volumeSnapshot:
name: volume-snapshot
walg:
image: ghcr.io/kubedb/postgres-archiver:v0.6.0_15.5-bookworm
image: ghcr.io/kubedb/postgres-archiver:v0.6.0_15.5-alpine
coordinator:
image: ghcr.io/kubedb/pg-coordinator:v0.29.0
db:
baseOS: debian
image: souravbiswassanto/postgres-age-bookworm-okay:15
baseOS: alpine
image: souravbiswassanto/postgres:15.5-alpine-age
distribution: Official
exporter:
image: prometheuscommunity/postgres-exporter:v0.15.0
Expand All @@ -28,8 +28,8 @@ spec:
podSecurityPolicies:
databasePolicyName: postgres-db
securityContext:
runAsAnyNonRoot: true
runAsUser: 999
runAsAnyNonRoot: false
runAsUser: 70
stash:
addon:
backupTask:
Expand All @@ -39,4 +39,4 @@ spec:
updateConstraints:
allowlist:
- "14.2"
version: "15.5"
version: "15.5"
2 changes: 1 addition & 1 deletion example/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: ha-postgres
namespace: demo
spec:
version: "15.5-bookworm"
version: "15.5"
replicas: 3
storageType: Durable
storage:
Expand Down

0 comments on commit 5a66b4d

Please sign in to comment.