-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from SubbuTechTutorials/release
Merge Request from release to main
- Loading branch information
Showing
17 changed files
with
820 additions
and
297 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mysql-db-preprod | ||
namespace: pre-prod | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: mysql | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql | ||
spec: | ||
containers: | ||
- name: mysql | ||
image: mysql:8.4 | ||
ports: | ||
- containerPort: 3306 | ||
env: | ||
- name: MYSQL_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_USER | ||
- name: MYSQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_PASSWORD | ||
- name: MYSQL_ROOT_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_ROOT_PASSWORD | ||
- name: MYSQL_DATABASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_DATABASE # Updated to use the secret key instead of ConfigMap | ||
volumeMounts: | ||
- mountPath: /var/lib/mysql | ||
name: mysql-persistent-storage | ||
subPath: mysql | ||
volumes: | ||
- name: mysql-persistent-storage | ||
persistentVolumeClaim: | ||
claimName: mysql-pvc-preprod # Must match your PersistentVolumeClaim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: mysql-pvc-preprod | ||
namespace: pre-prod # Specify the namespace | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce # Same access mode as the PV | ||
storageClassName: manual # This matches the storage class name used in the PV | ||
resources: | ||
requests: | ||
storage: 2Gi # Same size as the PV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql-service-preprod | ||
namespace: pre-prod | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 3306 | ||
targetPort: 3306 | ||
selector: | ||
app: mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: petclinic-app-preprod | ||
namespace: pre-prod | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: petclinic | ||
template: | ||
metadata: | ||
labels: | ||
app: petclinic | ||
spec: | ||
containers: | ||
- name: petclinic | ||
image: 905418425077.dkr.ecr.ap-south-1.amazonaws.com/preprod-petclinic:233aaef-14 | ||
imagePullPolicy: Always | ||
ports: | ||
- containerPort: 8081 | ||
env: | ||
- name: SERVER_PORT | ||
value: "8081" | ||
- name: MYSQL_URL | ||
valueFrom: | ||
configMapKeyRef: | ||
name: app-config-preprod | ||
key: MYSQL_URL | ||
- name: MYSQL_USER | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_USER | ||
- name: MYSQL_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_PASSWORD | ||
- name: MYSQL_DATABASE | ||
valueFrom: | ||
secretKeyRef: | ||
name: db-secrets-preprod | ||
key: MYSQL_DATABASE # Updated to use the secret key instead of ConfigMap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: petclinic-service-preprod | ||
namespace: pre-prod | ||
spec: | ||
type: LoadBalancer | ||
ports: | ||
- port: 8081 | ||
targetPort: 8081 | ||
protocol: TCP | ||
name: http # Add this line | ||
selector: | ||
app: petclinic |
Oops, something went wrong.