Skip to content

Commit 967843f

Browse files
Paulo Gomes da Cruz Juniorrenovate-bot
andauthored
feat(FSADT1-739): certificate volume claim (#149)
* feat: certificate volume claim adding volume claim to certificate to allow for faster deployments * fix: fixing name * chore: updating init container for testing * fix(deps): update dependency org.springframework.boot:spring-boot-starter-parent to v3.0.5 * chore: updating init container for testing * chore: updating init container for testing * feat: moving init from java to shell * chore: adding cert secret * fix: setting a version for the dockerfile --------- Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com>
1 parent 0357e81 commit 967843f

File tree

5 files changed

+63
-282
lines changed

5 files changed

+63
-282
lines changed

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
FROM eclipse-temurin:17.0.6_10-jdk-alpine@sha256:a765a97826df90554f3d3a98be5586012bbc53593876f669ff4b2e68717be71d
2-
3-
WORKDIR /app
1+
FROM alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d
42

53
ENV LANG en_CA.UTF-8
64
ENV LANGUAGE en_CA.UTF-8
75
ENV LC_ALL en_CA.UTF-8
86

7+
RUN apk --no-cache add openssl openjdk8
8+
9+
RUN which openssl
10+
RUN which keytool
11+
912
COPY startup.sh .
10-
COPY InstallCert.java .
1113

12-
RUN chmod g+w /app && \
13-
chmod g+x startup.sh && \
14-
chmod g+w ${JAVA_HOME}/lib/security/cacerts
14+
RUN chmod g+x startup.sh
1515

1616
# Non-privileged user
1717
USER app
1818

19-
ENTRYPOINT ["sh", "startup.sh"]
19+
ENTRYPOINT ["sh", "startup.sh"]

InstallCert.java

Lines changed: 0 additions & 262 deletions
This file was deleted.

openshift.deploy.yml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ parameters:
5858
- name: ORACLEDB_SECRET
5959
description: Oracle database keystore secret/password
6060
required: true
61+
- name: CERT_PVC_SIZE
62+
description: The amount of storage the cert PVC should have
63+
value: 25Mi
6164
objects:
6265
- apiVersion: v1
6366
kind: Secret
@@ -88,6 +91,19 @@ objects:
8891
name: ${REGISTRY}/${PROMOTE}
8992
referencePolicy:
9093
type: Local
94+
- apiVersion: v1
95+
kind: PersistentVolumeClaim
96+
metadata:
97+
labels:
98+
app: ${NAME}-${ZONE}
99+
name: ${NAME}-${ZONE}-${COMPONENT}
100+
spec:
101+
accessModes:
102+
- ReadWriteMany
103+
resources:
104+
requests:
105+
storage: ${CERT_PVC_SIZE}
106+
storageClassName: netapp-file-standard
91107
- apiVersion: v1
92108
kind: DeploymentConfig
93109
metadata:
@@ -117,8 +133,9 @@ objects:
117133
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
118134
spec:
119135
volumes:
120-
- name: certs
121-
emptyDir: {}
136+
- name: ${NAME}-${ZONE}-${COMPONENT}
137+
persistentVolumeClaim:
138+
claimName: ${NAME}-${ZONE}-${COMPONENT}
122139
initContainers:
123140
- name: ${NAME}-init
124141
image: ${REGISTRY}/bcgov/${NAME}/init:${ZONE}
@@ -129,11 +146,16 @@ objects:
129146
secretKeyRef:
130147
name: ${NAME}-${ZONE}-${COMPONENT}
131148
key: oracle-host
149+
- name: ORACLEDB_SECRET
150+
valueFrom:
151+
secretKeyRef:
152+
name: ${NAME}-${ZONE}-${COMPONENT}
153+
key: oracle-secret
132154
- name: ORACLEDB_PORT
133155
value: "1543"
134156
volumeMounts:
135-
- mountPath: /cert
136-
name: certs
157+
- name: ${NAME}-${ZONE}-${COMPONENT}
158+
mountPath: /cert
137159
resources:
138160
limits:
139161
cpu: ${CPU_LIMIT}
@@ -211,7 +233,7 @@ objects:
211233
timeoutSeconds: 5
212234
volumeMounts:
213235
- mountPath: /cert
214-
name: certs
236+
name: ${NAME}-${ZONE}-${COMPONENT}
215237
- apiVersion: v1
216238
kind: Service
217239
metadata:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.springframework.boot</groupId>
66
<artifactId>spring-boot-starter-parent</artifactId>
7-
<version>3.0.4</version>
7+
<version>3.0.5</version>
88
<relativePath />
99
</parent>
1010

0 commit comments

Comments
 (0)