docker: Error response from daemon: error while mounting volume ‘/var/lib/docker/volumes/…/_data’: failed to mount local volume: mount :/data:/var/lib/docker/volumes/…/_data, data: addr=…,vers=4: operation not permitted.
docker: Error response from daemon: error while mounting volume ‘/var/lib/docker/volumes/…/_data’: failed to mount local volume: mount :/data:/var/lib/docker/volumes/…/_data, data: addr=…,vers=4: connection refused.
To be able to mount the volume from macOS, use the insecure option in /etc/exports
PostgreSQL converts all column and table names to lowercase in the SQL query.
If the column or table name contains uppercase letters, we need to use double quotes to be able to reference them.
When we get the error message
ERROR: column “username” does not exist
select * from public.”AspNetUsers” where UserName = ‘… ^
HINT: Perhaps you meant to reference the column “AspNetUsers.UserName”. SQL state: 42703
This error message shows, that PostgreSQL converted UserName to username. To be able to reference the column, use double quotes. If you reference the table name too, don’t copy the hint, make sure the table and column names are separate strings in double quotes with a period between them.
select * from public."AspNetUsers" where "AspNetUsers"."UserName" = 'MY_VALUE';
Docker images are stored on the host to launch as fast as possible. The drawback is, Docker can fill the hard drive with unused images. A recent possible bug in Docker caused the accumulation of unused, unreferenced images on the host. To delete all Docker containers and images, use these commands in the terminal
Get the base line
# Get the free disk space
# List the running containers
# List all containers
docker ps -a
# List the Docker images
Gentle clean up
all stopped containers
all networks not used by at least one container
all dangling images
all dangling build cache
docker system prune
This will stop and delete ALL containers and images on the computer !!!
# Stop all running containers
docker stop $(docker ps -q)
# Remove all containers
docker rm $(docker ps -qa)
# Remove all Docker images
docker rmi -f $(docker images -q)
# A final clean
docker system prune
In this exercise we will use Traefik, another popular proxy server. Traefik is widely used for multiple reasons: it is easier to configure, can automatically generate and renew SSL certificates using Let’s Encrypt. We will also use most of the scripts from the prior exercise.
Create the Traefik Role Based Access Control with ClusterRoleBinding. This will allow Traefik to serve all namespaces of the cluster. To restrict the Traefik to one namespace only, use the “namespace-specific RoleBindings”.
Large organizations need to control the incoming traffic to the Kubernetes cluster. The most secure way is to use an ingress controller and create an ingress to channel all incoming traffic to the cluster.
In this exercise we will expose the service via an NGINX ingress controller. Delete type: LoadBalancer in the app1-frontend-service.yaml file, so Kubernetes will use type: ClusterIP, the default value.