mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
chore(redash): improve upgrade steps
This commit is contained in:
@@ -37,6 +37,9 @@ aws ecs wait services-stable --cluster 'stg' --services 'grafana'
|
||||
# Update services' attributes
|
||||
aws ecs update-service --cluster 'stg' --service 'grafana' --enable-execute-command --force-new-deployment
|
||||
|
||||
# Scale services
|
||||
aws ecs update-service --cluster 'stg' --service 'grafana' --desired-count '3'
|
||||
|
||||
# Check tasks' attributes
|
||||
aws ecs describe-tasks --cluster 'staging' --tasks 'ef6260ed8aab49cf926667ab0c52c313' --output 'yaml' \
|
||||
--query 'tasks[0] | {
|
||||
@@ -87,3 +90,8 @@ aws ecs stop-service-deployment --stop-type 'ROLLBACK' \
|
||||
aws ecs list-service-deployments --cluster 'staging' --service 'mimir' \
|
||||
--query "serviceDeployments[?@.status=='IN_PROGRESS'].serviceDeploymentArn" --output 'text' \
|
||||
| xargs -pn 1 aws ecs stop-service-deployment --service-deployment-arn
|
||||
|
||||
# Get the image of specific containers.
|
||||
aws ecs list-tasks --cluster 'someCluster' --service-name 'someService' --query 'taskArns[0]' --output 'text' \
|
||||
| xargs -oI '%%' aws ecs describe-tasks --cluster 'someCluster' --task '%%' \
|
||||
--query 'tasks[].containers[?name==`someContainer`].image' --output 'text'
|
||||
|
||||
@@ -192,11 +192,34 @@ aws eks describe-addon-configuration --addon-name 'aws-ebs-csi-driver' --addon-v
|
||||
# ------------------
|
||||
###
|
||||
|
||||
# Describe replication groups
|
||||
aws elasticache describe-replication-groups
|
||||
aws elasticache describe-replication-groups --query 'ReplicationGroups[].ReplicationGroupId'
|
||||
aws elasticache describe-replication-groups --replication-group-id 'some-app' --output 'text' \
|
||||
--query "ReplicationGroups[].NodeGroups[].PrimaryEndpoint[].join(':', [Address, to_string(Port)])"
|
||||
aws elasticache describe-replication-groups --replication-group-id 'some-app' --output 'text' \
|
||||
--query "ReplicationGroups[].NodeGroups[].PrimaryEndpoint[].join('', [`redis://`,Address,`:`,to_string(Port),`/0`])"
|
||||
|
||||
# List pending changes to replication groups
|
||||
aws elasticache describe-replication-groups --query 'ReplicationGroups[].PendingModifiedValues'
|
||||
aws elasticache describe-replication-groups --replication-group-id 'some-app' --query 'ReplicationGroups[].PendingModifiedValues'
|
||||
|
||||
# Upgrade replication groups' engine
|
||||
aws elasticache modify-replication-group --replication-group-id 'some-app' --engine-version '6.2' --apply-immediately
|
||||
|
||||
# Describe clusters
|
||||
aws elasticache describe-cache-clusters
|
||||
aws elasticache describe-cache-clusters --query 'CacheClusters[].CacheClusterId'
|
||||
|
||||
aws elasticache describe-replication-groups
|
||||
aws elasticache describe-replication-groups --query 'ReplicationGroups[].ReplicationGroupId'
|
||||
# List pending changes to clusters
|
||||
aws elasticache describe-cache-clusters --query 'CacheClusters[].PendingModifiedValues'
|
||||
aws elasticache describe-cache-clusters \
|
||||
--query 'CacheClusters[?length(PendingModifiedValues)>`0`].{"CacheClusterId":CacheClusterId,"PendingModifiedValues":PendingModifiedValues}'
|
||||
aws elasticache describe-cache-clusters --cache-cluster-id 'some-cluster' --query 'CacheClusters[].PendingModifiedValues'
|
||||
|
||||
# Apply pending changes to clusters
|
||||
aws elasticache modify-cache-cluster --cache-cluster-id 'some-cluster' --num-cache-nodes 'current-number-of-nodes' \
|
||||
--apply-immediately
|
||||
|
||||
|
||||
###
|
||||
@@ -418,6 +441,28 @@ aws rds describe-db-parameters --db-parameter-group-name 'default.postgres15' \
|
||||
|
||||
aws rds create-db-snapshot --db-instance-identifier 'some-db-instance' --db-snapshot-identifier 'some-db-snapshot'
|
||||
|
||||
aws rds describe-db-instances --db-instance-identifier 'some-instance' \
|
||||
--query 'DBInstances[0].InstanceCreateTime' --output 'text'
|
||||
|
||||
aws rds describe-db-instances --db-instance-identifier 'some-db-instance' --output 'text' \
|
||||
--query 'DBInstances[0].Endpoint|join(`:`,[Address,to_string(Port)])'
|
||||
aws rds describe-db-instances --db-instance-identifier 'some-db-instance' --output 'text' \
|
||||
--query '
|
||||
DBInstances[0]
|
||||
| join(``, [
|
||||
`postgresql://`,
|
||||
MasterUsername,
|
||||
`:`,
|
||||
`PASSWORD_PLACEHOLDER`,
|
||||
`@`,
|
||||
Endpoint.Address,
|
||||
`:`,
|
||||
to_string(Endpoint.Port),
|
||||
`/`,
|
||||
DBName || `postgres`
|
||||
])
|
||||
'
|
||||
|
||||
|
||||
###
|
||||
# Route53
|
||||
|
||||
@@ -12,6 +12,9 @@ docker volume inspect -f '{{ .Mountpoint }}' 'website'
|
||||
sudo vim '/var/lib/docker/volumes/website/_data/index.html'
|
||||
|
||||
docker run -d --name 'some-nginx' -v '/some/content:/usr/share/nginx/html:ro' 'nginx'
|
||||
docker run --rm --name 'redash-db-migrations' --platform 'linux/amd64' --dns '172.31.0.2' \
|
||||
--env 'REDASH_COOKIE_SECRET' --env 'REDASH_DATABASE_URL' --env 'REDASH_REDIS_URL' \
|
||||
"$REDASH_IMAGE" manage db upgrade
|
||||
docker run --rm --name 'pulumi' \
|
||||
--env 'AWS_DEFAULT_REGION' --env 'AWS_ACCESS_KEY_ID' --env 'AWS_SECRET_ACCESS_KEY' --env 'AWS_PROFILE' \
|
||||
--env-file '.env' --env-file '.env.local' \
|
||||
|
||||
Reference in New Issue
Block a user