Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

Martin Helmich

May 07, 2018
Tweet

More Decks by Martin Helmich

Other Decks in Programming

Transcript

  1. PHP IN THE CONTAINER CLOUD MARTIN HELMICH MITTWALD CM SERVICE

    GmbH & Co. KG SLAC2018, BERLIN MAY 7th, 2018
  2. This work is licensed under a Creative Commons Attribution- ShareAlike

    4.0 International License. http://creativecommons.org/licenses/by-sa/4.0/
  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. apiVersion: v1 kind: Pod metadata: name: some-pod spec: containers: -

    name: web image: nginx ports: - containerPort: 80
  5. $ 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
  6. 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
  7. 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)
  8. $ 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 …
  9. 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, …)
  10. 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