sonarqube docker container's setting is lost after stopping ec2 instance - amazon-web-services

I am running Jenkins server on which sonarqube docker container is running but we stop this server once build is done hence the sonarqube container's setting is lost, is there any way for it.
Please suggest me the proper way to handle this scenario.
I am running Jenkins on Ubuntu ec2 instance

Related

Testing connection out from within running container. Kubernetes. Amazon Linux 2

I am trying to test an outbound connection from within a Amazon Linux 2 container that is running in Kubernetes. I have a service set up and I am able to telnet to that service through a VPN. But I want to test a connection coming out from that container. Is there a way that this can be done.
I have tried the ping, etc. but the commands all say "command not found"
Is there any command I can run that can test an outbound connection?
Please provide more context. What exact image are you running? When debugging connectivity of kubernetes pods and services, you can exec into the pod with
kubectl exec -it <pod_name> -n <namespace> -- <bash|ash|sh>
Once you gain access to the pod and can emulate a shell inside, you can update + upgrade the runtime with the package manager (apt, yum, depends on the distro).
After upgrading, you can install curl and try to curl an external site.

Connect to a container running in Docker (Redis) from Cloud Run Emulator locally

I'm making local cloud run services with the Cloud Code plugin to Intellij (PyCharm) but the locally deployed service cannot connect to the redis instance running in Docker:
redis.exceptions.ConnectionError: Error 111 connecting to 127.0.0.1:6379. Connection refused.
I can connect to the locally running redis instance from a python shell, it's just the cloud run service running in minikube/docker that cannot seem to connect to it.
Any ideas?
Edit since people are suggesting completely unrelated posts - The locally running Cloud Run instance makes use of Docker and Minikube to run, and is automatically configured by Cloud Code for Intellij. I suspect that Cloud Code for intellij puts Cloud Run instances into an environment that cannot access services running on MacOS localhost (but can access the Internet), which is why I tagged those specific items in the post. Please limit suggestions to ones that takes these items into account.
If you check Docker network using:
docker network list
You'll see a network called cloud-run-dev-internal. You need to connect your Redis container to that network. To do that, run this command (This instruction assumes that your container name is some-redis):
docker network connect cloud-run-dev-internal some-redis
Double check that your container is connected to the network:
docker network inspect cloud-run-dev-internal
Then connect to Redis Host using the container name:
import redis
...
redis_host = os.environ.get('REDISHOST', 'some-redis')
redis_port = int(os.environ.get('REDISPORT', 6379))
redis_client = redis.StrictRedis(host=redis_host, port=redis_port)

aws-ecs, how to add a filebeat to existing container?

I'm running web service (nginx - uwsgi) on ECS.
I'm running the two applications using supervisor.
Now I want to add another service (filebeat) which will read logs of the web servers and send to logstash on another machine.
I've been told it is good idea to separate applications (all applications run on it's own docker container and get rid of supervisor)
So I'm trying to add a filebeat container to the already running webserver
If I go to define task tab of ECS menu, it seems I'm launching a new ec2 / fargate instance, that's not what I want.
Because filebeat has to run on the same host as the webserver
How do I run filebeat docker container along with webserver container?

Monitor application running on docker at EC2 instance

I have nodejs application in docker on AWS EC2 instance. It exposes port. Sometimes this application terminates and I am not able to restart it automatically. What would be the best approach on AWS EC2 in order to check and restart in case of failure?
My recommendation is to use Supervisor
Very easy to install and configure. It will start the application when the system starts up and also monitors it. If the application is not running, it will start the application.
Adding a Program

Restarting machines in a docker swarm on AWS

I have successfully created a docker swarm of 5 VMs on AWS using docker-machine. I stopped one VM using the command
docker-machine stop aws01 and then I tried docker-machine start aws01
but Immediately I get an error
Error checking TLS connection: Error checking and/or regenerating the certs:
There was an error validating certificates for host "5x.20x.23x.10x:2376":
x509: certificate is valid for 5x.2x.17x.25x, not 5x.20x.23x.10x
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers
Is really stoping and starting a container such a big deal that everytime I do this, I need to regenerate certs?
Is there a low impact way of stoping and starting my machines.
This never happened to me when I was using a local virtualbox VM for docker. This started only when I created docker machine on AWS.
As you can see that since I have 5 machines, starting and stopping is a big pain for me because I need to regenerate certs for all machines everytime I stop them? Obviously since its AWS I can't keep my machines running all the time.