diff --git a/kubernetes/backend/deployment.yaml b/kubernetes/backend/deployment.yaml index 67b10ce..0a7f331 100644 --- a/kubernetes/backend/deployment.yaml +++ b/kubernetes/backend/deployment.yaml @@ -4,8 +4,7 @@ metadata: name: backend namespace: study-notion labels: - role: backend - env: demo + app: backend spec: replicas: 2 strategy: @@ -15,14 +14,12 @@ spec: maxUnavailable: 25% selector: matchLabels: - role: backend + app: backend template: metadata: labels: - role: backend + app: backend spec: - imagePullSecrets: - - name: ecr-registry-secret containers: - name: backend resources: @@ -32,23 +29,7 @@ spec: requests: cpu: "0.5" memory: "200Mi" - envFrom: - - secretRef: - name: backend-sec - image: 339713132076.dkr.ecr.ap-south-1.amazonaws.com/study-notion-backend:latest + image: amit2210/study-notion:backend imagePullPolicy: Always - env: - - name: MONGO_CONN_STR - value: mongodb+srv://mongodb-svc@cluster0.gdxackk.mongodb.net/StudyNotion?directConnection=true - - name: MONGO_USERNAME - valueFrom: - secretKeyRef: - name: mongo-sec - key: username - - name: MONGO_PASSWORD - valueFrom: - secretKeyRef: - name: mongo-sec - key: password ports: - - containerPort: 8080 + - containerPort: 4000 diff --git a/kubernetes/backend/pod.yaml b/kubernetes/backend/pod.yaml new file mode 100644 index 0000000..0edce8f --- /dev/null +++ b/kubernetes/backend/pod.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Pod +metadata: + name: backend + namespace: study-notion + labels: + app: backend +spec: + containers: + - name: backend + image: amit2210/study-notion:backend + resources: + limits: + cpu: "1" + memory: "500Mi" + requests: + cpu: "0.5" + memory: "200Mi" + imagePullPolicy: Always + ports: + - containerPort: 4000 \ No newline at end of file diff --git a/kubernetes/backend/service.yaml b/kubernetes/backend/service.yaml index e3d0c4a..4dd9cc2 100644 --- a/kubernetes/backend/service.yaml +++ b/kubernetes/backend/service.yaml @@ -4,9 +4,11 @@ metadata: name: backend namespace: study-notion spec: - ports: - - port: 3500 - protocol: TCP - type: ClusterIP selector: - role: backend \ No newline at end of file + app: backend + ports: + - protocol: TCP + port: 90 + targetPort: 4000 + nodePort: 30006 + type: NodePort diff --git a/kubernetes/database/deployment.yaml b/kubernetes/database/deployment.yaml deleted file mode 100644 index c03a2ff..0000000 --- a/kubernetes/database/deployment.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - namespace: study-notion - name: mongodb -spec: - replicas: 1 - selector: - matchLabels: - app: mongodb - template: - metadata: - labels: - app: mongodb - spec: - containers: - - name: mon - # resources: - # limits: - # cpu: "1" - # memory: "500Mi" - # requests: - # cpu: "0.5" - # memory: "200Mi" - image: mongo:7 - command: - - "numactl" - - "--interleave=all" - - "mongod" - - "--bind_ip" - - "0.0.0.0" - ports: - - containerPort: 27017 - env: - - name: MONGO_INITDB_ROOT_USERNAME - valueFrom: - secretKeyRef: - name: mongo-sec - key: username - - name: MONGO_INITDB_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: mongo-sec - key: password - volumeMounts: - - name: mongo-volume - mountPath: /data/db - volumes: - - name: mongo-volume - persistentVolumeClaim: - claimName: mongo-volume-claim \ No newline at end of file diff --git a/kubernetes/database/pv.yaml b/kubernetes/database/pv.yaml deleted file mode 100644 index 9e73fc1..0000000 --- a/kubernetes/database/pv.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: mongo-pv - namespace: study-notion -spec: - capacity: - storage: 1Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - hostPath: - path: /data/db diff --git a/kubernetes/database/pvc.yaml b/kubernetes/database/pvc.yaml deleted file mode 100644 index b35a468..0000000 --- a/kubernetes/database/pvc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: mongo-volume-claim - namespace: study-notion -spec: - accessModes: - - ReadWriteOnce - storageClassName: "" - resources: - requests: - storage: 1Gi diff --git a/kubernetes/database/secrets.yaml b/kubernetes/database/secrets.yaml deleted file mode 100644 index 8324383..0000000 --- a/kubernetes/database/secrets.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - namespace: study-notion - name: mongo-sec -type: Opaque -data: - password: "" - username: "" \ No newline at end of file diff --git a/kubernetes/database/service.yaml b/kubernetes/database/service.yaml deleted file mode 100644 index b60b066..0000000 --- a/kubernetes/database/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - namespace: study-notion - name: mongodb-svc -spec: - selector: - app: mongodb - ports: - - name: mongodb-svc - protocol: TCP - port: 27017 - targetPort: 27017 \ No newline at end of file