Skip to content

Commit

Permalink
feat(): polish deployment environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Christiantyemele committed Dec 16, 2024
1 parent 703dcea commit 624e8da
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 86 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/CD.yml

This file was deleted.

81 changes: 81 additions & 0 deletions docs/deployment-environment-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

# **Application Deployment Documentation**

## **1. Prerequisites**
- **Tools and Software Required**:
- Helm version (e.g., `Helm 3.x`)
- Kubernetes version (e.g., `1.25+`)
- Minikube/Cluster setup
- Other dependencies (e.g., Docker, kubectl, etc.)
- **Environment Setup**:
- Access to the Kubernetes cluster
- Required configurations or credentials


## **3. Helm Chart Structure**
- **Chart Overview**:
- Structure of the Helm chart (values.yaml, templates, etc.).
- Purpose of critical templates (e.g., Deployment, Service, ConfigMap).
- Default vs. custom configurations.
- **Customization**:
- How to override values.yaml using custom configurations.
Example:
```bash
helm install mediator ./mediator-charts --values custom-values.yaml
```
- mandatory values are;

**MONGO_DBN**,
**MONGO_URI**,
**SERVER_LOCAL_PORT** and
**SERVER_PUBLIC_DOMAIN**


## **4. Deployment Guide**
- **Steps to Deploy**:
1. Clone the repository:
```bash
git clone https://github.com/adorsys/didcomm-mediator-rs.git
```
2. Install dependencies:
```bash
helm dependency update mediator-charts
```
3. Deploy using Helm:
```bash
helm install mediator mediator-charts --namespace didcomm-mediator
```
4. Verify deployment status:
```bash
kubectl get pods -n didcomm-mediator
kubectl get services -n didcomm-mediator
```
- **Notes on Namespaces**:
- Importance of creating and using the correct namespace.
- **Rollback Instructions**:
- How to roll back to a previous release:
```bash
helm rollback my-app <revision>
```

---

## **5. Accessing the Application**
- **Port Forwarding**:
- Steps to forward the service ports locally for testing:
```bash
kubectl port-forward service/<service-name> 8080:<target-port>
```
- **Ingress/LoadBalancer Details**:
- Steps to access the application if exposed via Ingress or LoadBalancer.

## **7. Monitoring and Debugging**
- **Logs**:
- How to fetch logs for debugging:
```bash
kubectl logs <pod-name> -n didcomm-mediator
```
- **Monitoring Tools**:
- Mention tools used (e.g., Prometheus, Grafana, ELK Stack).
- Steps to configure and access monitoring dashboards.

47 changes: 0 additions & 47 deletions docs/environment-setup.md

This file was deleted.

11 changes: 6 additions & 5 deletions mediator-charts/templates/env-configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apiVersion: v1
data:
MONGO_DBN: mediator-coordination
MONGO_URI: mongodb://mongodb:27017
SERVER_LOCAL_PORT: "3000"
SERVER_PUBLIC_DOMAIN: http://alice-mediator.com
STORAGE_DIRPATH: crates/generic-server/target/storage
MONGO_DBN: {{ .Values.envConfig.MONGO_DBN }}
MONGO_URI: {{ .Values.envConfig.MONGO_URI }}
SERVER_LOCAL_PORT: {{ .Values.envConfig.SERVER_LOCAL_PORT }}
SERVER_PUBLIC_DOMAIN: {{ .Values.envConfig.SERVER_PUBLIC_DOMAIN }}

kind: ConfigMap
metadata:
namespace: {{ .Values.namespace }}
creationTimestamp: null
labels:
io.kompose.service: mediator-env
Expand Down
2 changes: 1 addition & 1 deletion mediator-charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: didcomm-mediator-ingress
namespace: default
namespace: {{ .Values.namespace }}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: "/" # Rewrite paths if necessary
spec:
Expand Down
3 changes: 2 additions & 1 deletion mediator-charts/templates/mediator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-mediator-deployment
namespace: {{ .Values.namespace }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
Expand All @@ -27,7 +28,7 @@ spec:
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mongo-password
name: {{ .Release.Name }}-secret
key: password
- name: MONGO_HOST
value: {{ .Release.Name }}-mongodb-service
Expand Down
1 change: 1 addition & 0 deletions mediator-charts/templates/mediator-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-mediator-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Release.Name }}-mediator
Expand Down
3 changes: 2 additions & 1 deletion mediator-charts/templates/mongodb-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-mongodb-deployment
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
Expand All @@ -27,7 +28,7 @@ spec:
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mongo-password
name: {{ .Release.Name }}-secret
key: password
volumeMounts:
- name: {{ .Release.Name }}-mongo-persistent-storage
Expand Down
1 change: 1 addition & 0 deletions mediator-charts/templates/mongodb-pv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Release.Name }}-mongo-pv
namespace: {{ .Values.namespace }}
spec:
capacity:
storage: {{ .Values.mongoVolume.persistentVolume.storageSize }}
Expand Down
1 change: 1 addition & 0 deletions mediator-charts/templates/mongodb-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-mongo-pvc
namespace: {{ .Values.namespace }}
spec:
accessModes:
- ReadWriteOnce
Expand Down
1 change: 1 addition & 0 deletions mediator-charts/templates/mongodb-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-mongodb-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Release.Name }}-mongodb
Expand Down
13 changes: 3 additions & 10 deletions mediator-charts/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-mongo-username
name: {{ .Release.Name }}-secret
namespace: {{ .Values.namespace }}
type: Opaque
stringData:
username: root

apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-mongo-password
type: Opaque
stringData:
password: root
password: root
9 changes: 8 additions & 1 deletion mediator-charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
replicaCount: 1
namespace: didcomm-mediator

mongodb:
databaseName: mongodb
Expand All @@ -18,4 +19,10 @@ mongoVolume:
pathOnHost: /var/lib/mongodb


mountPath: /var/lib/mongodb
mountPath: /var/lib/mongodb

envConfig:
MONGO_DBN: mediator-coordination
MONGO_URI: mongodb://mongodb:27017
SERVER_LOCAL_PORT: "3000"
SERVER_PUBLIC_DOMAIN: http://alice-mediator.com

0 comments on commit 624e8da

Please sign in to comment.