Page MenuHomeDevCentral

Prevent Hauk from using swap
ClosedPublic

Authored by dereckson on Feb 20 2023, 23:19.
Referenced Files
F3777352: D2807.diff
Mon, Nov 25, 01:07
F3777294: D2807.diff
Mon, Nov 25, 00:53
Unknown Object (File)
Fri, Nov 22, 20:25
Unknown Object (File)
Fri, Nov 22, 09:46
Unknown Object (File)
Fri, Nov 22, 09:37
Unknown Object (File)
Fri, Nov 22, 09:30
Unknown Object (File)
Sun, Nov 17, 22:53
Unknown Object (File)
Thu, Nov 14, 03:59
Subscribers
None

Details

Summary

For privacy purpose, don't allow the container to use swap.
Geolocalisation will so only stored on RAM, never on disk.

Reference: https://docs.docker.com/config/containers/resource_constraints/

Test Plan
  • deploy container on docker-002
  • docker stats hauk should show /256M as memory limit
  • docker inspect hauk should show both values

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson created this revision.
dereckson added a project: privacy.

Not really the expected values:

$ salt docker-002 state.sls_id hauk roles/paas-docker/containers/hauk test=True                                                                                                (git)-[deploy]
docker-002:
----------
          ID: hauk
    Function: docker_container.running
      Result: None
     Comment: Container 'hauk' would be replaced
     Started: 23:37:19.584131
    Duration: 1290.788 ms
     Changes:
              ----------
              container:
                  ----------
                  HostConfig:
                      ----------
                      Memory:
                          ----------
                          new:
                              268435456
                          old:
                              0
                      MemorySwap:
                          ----------
                          new:
                              536870912
                          old:
                              0

Summary for docker-002
------------
Succeeded: 1 (unchanged=1, changed=1)
Failed:    0
------------
Total states run:     1
Total run time:   1.291 s

Use docker-py keys for memory

This revision is now accepted and ready to land.Feb 20 2023, 23:49
This revision was automatically updated to reflect the committed changes.