diff --git a/devops/docs/helm-ops.md b/devops/docs/helm-ops.md index 8295b918b6..b00a148cc1 100644 --- a/devops/docs/helm-ops.md +++ b/devops/docs/helm-ops.md @@ -2,6 +2,15 @@ Please run these commands from `root` +Make sure to use the right kubernetes context before making any changes + +``` +kubectl config get-contexts + +# replace NAME with the context name +kubectl config use-context NAME +``` + ### Lint chart ``` @@ -31,7 +40,7 @@ helm install -f ./helm-chart/public/fyipe/values.yaml -f ./kubernetes/values-saa Staging: ``` -kubectl config set-context do-nyc1-fyipe-staging +kubectl config use-context arn:aws:eks:us-east-2:972164494713:cluster/fyipe-staging helm upgrade -f ./helm-chart/public/fyipe/values.yaml -f ./kubernetes/values-saas-staging.yaml fi ./helm-chart/public/fyipe ``` @@ -40,7 +49,7 @@ Use default values first and then use staging values. Production: ``` -kubectl config set-context do-nyc3-fyipe-production +kubectl config use-context arn:aws:eks:us-east-2:972164494713:cluster/fyipe-production helm upgrade -f ./helm-chart/public/fyipe/values.yaml -f ./kubernetes/values-saas-production.yaml fi ./helm-chart/public/fyipe ``` diff --git a/devops/docs/kube-ops.md b/devops/docs/kube-ops.md index 68808a67c6..fcc16798ab 100644 --- a/devops/docs/kube-ops.md +++ b/devops/docs/kube-ops.md @@ -4,7 +4,7 @@ ``` sudo kubectl config get-contexts -sudo kubectl config use-context do-nyc1-fyipe-staging +sudo kubectl config use-context arn:aws:eks:us-east-2:972164494713:cluster/fyipe-staging ``` # Pods diff --git a/devops/docs/mongo-ops.md b/devops/docs/mongo-ops.md index 5979eb91d5..55dbf505ca 100644 --- a/devops/docs/mongo-ops.md +++ b/devops/docs/mongo-ops.md @@ -12,7 +12,7 @@ Admin mongodb username is: `root` ## MongoDB common issues. -MongoDB has will give you a lot of issues like: +MongoDB will give you a lot of issues like: #### MongoDB Crashloop Backoff @@ -27,7 +27,7 @@ Important: Backup surving member. See backup section in this document for more i Resolution: Delete all statefulset and start again. ``` -kubectl delete pvc datadir-fi-mongodb-0 datadir-fi-mongodb-0 +kubectl delete pvc datadir-fi-mongodb-0 datadir-fi-mongodb-1 # If staging sudo helm upgrade -f ./helm-chart/public/fyipe/values.yaml -f ./kubernetes/values-saas-staging.yaml fi ./helm-chart/public/fyipe @@ -49,16 +49,8 @@ Run these on source cluster: Example: ``` -# Delete audit logs (optional, but recommended) - -sudo kubectl exec -it fi-mongodb-0 -- bash -mongo -use fyipedb -db.auth('fyipe', 'password') -db.auditlogs.remove({}) - - # Open MongoDB to the internet. +# Only run this when MongoDB is not open to the internet sudo kubectl delete job fi-init-script @@ -78,7 +70,7 @@ On the destination cluster: ``` kubectl exec -it fi-mongodb-0 -- bash -mongodump --uri="mongodb://fyipe:password@:27017/fyipedb" --archive="/bitnami/mongodb/fyipedata.archive" +mongodump --uri="mongodb://fyipe:password@:27017/fyipedb" --archive="/bitnami/mongodb/fyipedata.archive" --excludeCollection=auditlogs --excludeCollection=monitorlogs mongorestore --uri="mongodb://fyipe:password@localhost:27017/fyipedb" --archive="/bitnami/mongodb/fyipedata.archive" ``` @@ -103,7 +95,7 @@ sudo helm upgrade -f ./kubernetes/values-saas-staging.yaml --set mongodb.externa Syntax: -`sudo kubectl exec -- mongodump --uri="mongodb://:@localhost:27017/" --archive=""` +`sudo kubectl exec -- mongodump --uri="mongodb://:@localhost:27017/" --archive="" --excludeCollection=auditlogs --excludeCollection=monitorlogs` Example: