@@ -5,22 +5,8 @@ PGO_IMAGE_DESCRIPTION ?= $(PGO_IMAGE_SUMMARY)
5
5
PGO_IMAGE_URL ?= https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes
6
6
PGO_IMAGE_PREFIX ?= localhost
7
7
8
- CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME ?= crunchy-postgres-exporter
9
- CRUNCHY_POSTGRES_EXPORTER_MAINTAINER ?= $(PGO_IMAGE_MAINTAINER )
10
- CRUNCHY_POSTGRES_EXPORTER_SUMMARY ?= Metrics exporter for PostgreSQL
11
- CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION ?= \
12
- When run with the crunchy-postgres family of containers, crunchy-postgres-exporter reads the PostgreSQL data directory \
13
- and has a SQL interface to a database to allow for metrics collection.
14
- CRUNCHY_POSTGRES_EXPORTER_URL ?= https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes
15
- CRUNCHY_POSTGRES_EXPORTER_IMAGE_PREFIX ?= $(PGO_IMAGE_PREFIX )
16
- CRUNCHY_POSTGRES_EXPORTER_PG_VERSION ?= 15
17
- CRUNCHY_POSTGRES_EXPORTER_PG_FULL_VERSION ?= 15.3
18
-
19
8
PGMONITOR_DIR ?= hack/tools/pgmonitor
20
9
PGMONITOR_VERSION ?= v4.8.1
21
- POSTGRES_EXPORTER_VERSION ?= 0.12.1
22
- POSTGRES_EXPORTER_ARCHITECTURE ?= amd64
23
- POSTGRES_EXPORTER_URL ?= https://github.com/prometheus-community/postgres_exporter/releases/download/v${POSTGRES_EXPORTER_VERSION}/postgres_exporter-${POSTGRES_EXPORTER_VERSION}.linux-${POSTGRES_EXPORTER_ARCHITECTURE}.tar.gz
24
10
QUERIES_CONFIG_DIR ?= hack/tools/queries
25
11
26
12
# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
@@ -59,12 +45,10 @@ help: ## Display this help.
59
45
.PHONY : all
60
46
all : # # Build all images
61
47
all : build-postgres-operator-image
62
- all : build-crunchy-postgres-exporter-image
63
48
64
49
.PHONY : setup
65
50
setup : # # Run Setup needed to build images
66
51
setup : get-pgmonitor
67
- setup : get-postgres-exporter
68
52
69
53
.PHONY : get-pgmonitor
70
54
get-pgmonitor :
@@ -75,13 +59,6 @@ get-pgmonitor:
75
59
cp -r ' $(PGMONITOR_DIR)/postgres_exporter/common/.' ' ${QUERIES_CONFIG_DIR}'
76
60
cp ' $(PGMONITOR_DIR)/postgres_exporter/linux/queries_backrest.yml' ' ${QUERIES_CONFIG_DIR}'
77
61
78
- .PHONY : get-postgres-exporter
79
- get-postgres-exporter :
80
- [ ! -e hack/tools/postgres_exporter.tar.gz ] || (rm hack/tools/postgres_exporter.tar.gz && echo " Deleting old exporter tar" )
81
- wget -O hack/tools/postgres_exporter.tar.gz ' $(POSTGRES_EXPORTER_URL)'
82
- [ ! -e hack/bin/postgres_exporter ] || (rm -r hack/bin/postgres_exporter && echo " Deleting old exporter binary" )
83
- tar -xzf hack/tools/postgres_exporter.tar.gz -C hack/tools/ && mv hack/tools/postgres_exporter-${POSTGRES_EXPORTER_VERSION} .linux-${POSTGRES_EXPORTER_ARCHITECTURE} hack/bin/postgres_exporter
84
-
85
62
.PHONY : clean
86
63
clean : # # Clean resources
87
64
clean : clean-deprecated
@@ -96,7 +73,6 @@ clean: clean-deprecated
96
73
[ ! -d hack/tools/pgmonitor ] || rm -rf hack/tools/pgmonitor
97
74
[ ! -n " $$ (ls hack/tools)" ] || rm -r hack/tools/*
98
75
[ ! -d hack/.kube ] || rm -r hack/.kube
99
- [ ! -d hack/bin/postgres_exporter ] || rm -r hack/bin/postgres_exporter
100
76
101
77
.PHONY : clean-deprecated
102
78
clean-deprecated : # # Clean deprecated resources
@@ -112,8 +88,10 @@ clean-deprecated: ## Clean deprecated resources
112
88
@# keys used to be generated before install
113
89
[ ! -d conf/pgo-backrest-repo ] || rm -r conf/pgo-backrest-repo
114
90
[ ! -d conf/postgres-operator ] || rm -r conf/postgres-operator
115
- @# crunchy-postgres-exporter used to use scripts stored in bin/crunchy-postgres-exporter
91
+ @# crunchy-postgres-exporter used to live in this repo
116
92
[ ! -d bin/crunchy-postgres-exporter ] || rm -r bin/crunchy-postgres-exporter
93
+ [ ! -d build/crunchy-postgres-exporter ] || rm -r build/crunchy-postgres-exporter
94
+
117
95
118
96
# #@ Deployment
119
97
.PHONY : createnamespaces
@@ -169,44 +147,6 @@ build-postgres-operator: ## Build the postgres-operator binary
169
147
-o bin/postgres-operator ./cmd/postgres-operator
170
148
171
149
# #@ Build - Images
172
- .PHONY : build-crunchy-postgres-exporter-image
173
- build-crunchy-postgres-exporter-image : # # Build the crunchy-postgres-exporter image
174
- build-crunchy-postgres-exporter-image : CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION := $(shell git rev-parse HEAD)
175
- build-crunchy-postgres-exporter-image : CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP := $(shell date -u +% FT% TZ)
176
- build-crunchy-postgres-exporter-image : build/crunchy-postgres-exporter/Dockerfile
177
- $(if $(shell (echo 'buildah version 1.24'; $(word 1,$(BUILDAH_BUILD ) ) --version) | sort -Vc 2>&1) , \
178
- $(warning WARNING: old buildah does not invalidate its cache for changed labels: \
179
- https://github.com/containers/buildah/issues/3517))
180
- $(if $(IMAGE_TAG ) ,, $(error missing IMAGE_TAG) )
181
- $(strip $(BUILDAH_BUILD ) ) \
182
- --tag $(BUILDAH_TRANSPORT )$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_PREFIX ) /$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME ) :$(IMAGE_TAG ) \
183
- --label name=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME)' \
184
- --label build-date=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP)' \
185
- --label description=' $(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
186
- --label maintainer=' $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
187
- --label summary=' $(CRUNCHY_POSTGRES_EXPORTER_SUMMARY)' \
188
- --label url=' $(CRUNCHY_POSTGRES_EXPORTER_URL)' \
189
- --label vcs-ref=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION)' \
190
- --label vendor=' $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
191
- --label postgres.version.major=' $(CRUNCHY_POSTGRES_EXPORTER_PG_VERSION)' \
192
- --label postgres.version=' $(CRUNCHY_POSTGRES_EXPORTER_PG_FULL_VERSION)' \
193
- --label io.k8s.display-name=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME)' \
194
- --label io.k8s.description=' $(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
195
- --label io.openshift.tags=" postgresql,postgres,monitoring,database,crunchy" \
196
- --annotation org.opencontainers.image.authors=' $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
197
- --annotation org.opencontainers.image.vendor=' $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
198
- --annotation org.opencontainers.image.created=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP)' \
199
- --annotation org.opencontainers.image.description=' $(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
200
- --annotation org.opencontainers.image.revision=' $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION)' \
201
- --annotation org.opencontainers.image.title=' $(CRUNCHY_POSTGRES_EXPORTER_SUMMARY)' \
202
- --annotation org.opencontainers.image.url=' $(CRUNCHY_POSTGRES_EXPORTER_URL)' \
203
- $(if $(PGO_VERSION ) ,$(strip \
204
- --label release=' $(PGO_VERSION)' \
205
- --label version=' $(PGO_VERSION)' \
206
- --annotation org.opencontainers.image.version=' $(PGO_VERSION)' \
207
- )) \
208
- --file $< --format docker --layers .
209
-
210
150
.PHONY : build-postgres-operator-image
211
151
build-postgres-operator-image : # # Build the postgres-operator image
212
152
build-postgres-operator-image : PGO_IMAGE_REVISION := $(shell git rev-parse HEAD)
@@ -377,14 +317,3 @@ release-postgres-operator-image-labels:
377
317
$(if $(PGO_IMAGE_NAME ) ,, $(error missing PGO_IMAGE_NAME) )
378
318
$(if $(PGO_IMAGE_SUMMARY ) ,, $(error missing PGO_IMAGE_SUMMARY) )
379
319
$(if $(PGO_VERSION ) ,, $(error missing PGO_VERSION) )
380
-
381
- .PHONY : release-crunchy-postgres-exporter-image release-crunchy-postgres-exporter-image-labels
382
- release-crunchy-postgres-exporter-image : # # Build the postgres-operator image and all its prerequisites
383
- release-crunchy-postgres-exporter-image : release-crunchy-postgres-exporter-image-labels
384
- release-crunchy-postgres-exporter-image : build-crunchy-postgres-exporter-image
385
- release-crunchy-postgres-exporter-image-labels :
386
- $(if $(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION ) ,, $(error missing CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION) )
387
- $(if $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER ) ,, $(error missing CRUNCHY_POSTGRES_EXPORTER_MAINTAINER) )
388
- $(if $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME ) ,, $(error missing CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME) )
389
- $(if $(CRUNCHY_POSTGRES_EXPORTER_SUMMARY ) ,, $(error missing CRUNCHY_POSTGRES_EXPORTER_SUMMARY) )
390
- $(if $(PGO_VERSION ) ,, $(error missing PGO_VERSION) )
0 commit comments