SLAC18: PHP in the Container Cloud

SLAC18: PHP in the Container Cloud

License: CC BY-SA

Slides of my talk at the Secure Linux Administration Conference in Berlin at May 7th, 2018.

2b68bc93708466a655a4c60458dc7955?s=128

Martin Helmich

May 07, 2018
Tweet

Transcript

  1. 1.

    PHP IN THE CONTAINER CLOUD MARTIN HELMICH MITTWALD CM SERVICE

    GmbH & Co. KG SLAC2018, BERLIN MAY 7th, 2018
  2. 2.

    This work is licensed under a Creative Commons Attribution- ShareAlike

    4.0 International License. http://creativecommons.org/licenses/by-sa/4.0/
  3. 3.

    MARTIN HELMICH SOFTWARE & SYSTEMS ARCHITECT @ MITTWALD CM SERVICE

    LECTURER @ PHWT VECHTA http://stackoverflow.com/story/martinhelmich https://github.com/martin-helmich https://www.martin-helmich.de
  4. 4.
  5. 5.
  6. 6.
  7. 8.
  8. 13.
  9. 14.
  10. 17.
  11. 19.

    apiVersion: v1 kind: Pod metadata: name: some-pod spec: containers: -

    name: web image: nginx ports: - containerPort: 80
  12. 20.

    $ kubectl apply -f pod.yaml pod "some-pod" created $ kubectl

    get pods NAME READY STATUS some-pod 1/1 Running apiVersion: v1 kind: Pod metadata: name: some-pod spec: containers: - name: web image: nginx ports: - containerPort: 80
  13. 21.

    KUBERNETES CORE CONCEPTS POD - 1(ISH) CONTAINER - SHORT-LIVED -

    DISPOSABLE REPLICA SET - MANAGES MULTIPLE PODS DEPLOYMENT - MANAGES MULTIPLE VERSIONS OF REPLICA SETS - ROLLING UPDATES/ ROLLBACKS SERVICE - STABLE DNS/ IP ADDRESS
  14. 22.

    SPACES CONTAINER ARCHITECTURE DATABASE PODS (STATEFUL SET) CACHING PODS (REDIS;

    STATEFUL SET) APPLICATION PODS (CUSTOM IMAGE; DEPLOYMENT) LOGGING POD (NXLOG; DEPLOYMENT) MANAGEMENT (SALTSTACK; DEPLOYMENT) NETWORK FILESYSTEM (PERSISTENT VOLUME)
  15. 23.

    $ kubectl scale deployment my-app --replicas=32 deployment "my-app" scaled $

    kubectl get deployments NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE my-app 32 32 32 15 30m $ kubectl get pods NAME READY STATUS RESTARTS AGE my-app-2035384211-7ci7o 1/1 Running 0 18s my-app-2035384211-kzszj 1/1 Running 0 18s my-app-2035384211-qqcnn 1/1 Running 0 18s …
  16. 25.
  17. 28.

    SHARED FILESYSTEM /fileadmin /typo3conf /typo3temp /uploads SOLUTION #1: CONFIGURE APPLICATION

    TO USE OBJECT STORE (S3, CEPH, …) AND CENTRALIZED CACHES SOLUTION #2: USE NETWORK FILESYSTEM (NFS, GLUSTER, CEPHFS, …)
  18. 33.

    8 CPUS 64 GiB RAM KUBERNETES SCHEDULING THE NODE THE

    PODS REQUESTS LIMIT .5 CPU / 1 CPU 128 MiB/ 256 MiB LIMITS = REQUESTS -> GUARANTEED POD LIMITS > REQUESTS -> OVERCOMITTMENT SCHEDULING POD REQUESTS MUST FIT NODE POD LIMITS MAY BE LARGER THAN NODE CAPACITY LIMITS > CAPACITY -> OK
  19. 36.