Skip to content

Commit

Permalink
Merge pull request #3 from SubbuTechTutorials/release
Browse files Browse the repository at this point in the history
Merge Request from release to main
  • Loading branch information
SubbuTechTutorials authored Oct 23, 2024
2 parents a415091 + 2d601cf commit 55d5fa7
Show file tree
Hide file tree
Showing 17 changed files with 820 additions and 297 deletions.
402 changes: 402 additions & 0 deletions Jenkinsfile

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions k8s/mysql-deployment.yaml
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
12 changes: 12 additions & 0 deletions k8s/mysql-pvc.yaml
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
12 changes: 12 additions & 0 deletions k8s/mysql-service.yaml
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
44 changes: 44 additions & 0 deletions k8s/petclinic-deployment.yaml
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
14 changes: 14 additions & 0 deletions k8s/petclinic-service.yaml
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
Loading

0 comments on commit 55d5fa7

Please sign in to comment.