Giter Site home page Giter Site logo

Kubernetes installation about aimeos-headless HOT 1 CLOSED

aimeos avatar aimeos commented on May 18, 2024
Kubernetes installation

from aimeos-headless.

Comments (1)

aimeos avatar aimeos commented on May 18, 2024 3

Installation in the cloud (e.g. AWS) is pretty straight forward if you have a git repository containing your application. You only need to check in the ./vendor/ directory too because otherwise there will be problems with credentials if you use private packages.

Kubernetes requires some experience. If you have a working Kubernetes environment, you can use this configuration for own setups as example:

---
---
apiVersion: v1
kind: Namespace
metadata:
  name: example-dev
---
# Database storage
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: example-dev-db
  namespace: example-dev
spec:
  storageClassName: local-path
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
---
apiVersion: v1
kind: Service
metadata:
  name: example
  namespace: example-dev
spec:
  selector:
    app: example
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: example-db
  namespace: example-dev
spec:
  selector:
    app: example-db
  ports:
    - protocol: TCP
      port: 3306
      targetPort: 3306
---
# Database
apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-db
  namespace: example-dev
  labels:
    app: example-db
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: example-db
  template:
    metadata:
      name: example-db
      namespace: example-dev
      labels:
        app: example-db
    spec:
      volumes:
        - name: example-db
          persistentVolumeClaim:
            claimName: example-dev-db
      containers:
        - name: mariadb
          image: mariadb
          volumeMounts:
            - mountPath: "/var/lib/mysql"
              name: example-db
          ports:
            - containerPort: 3306
          env:
            - name: MARIADB_ROOT_PASSWORD
              value: "example"
            - name: MARIADB_DATABASE
              value: "example"
            - name: MARIADB_USER
              value: "example"
            - name: MARIADB_PASSWORD
              value: "example"
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: example-setup
  namespace: example-dev
data:
  99-setup.sh: |
    git clone https://github.com/aimeos/example /aimeos
    chgrp -R application /aimeos/bootstrap /aimeos/storage
    chmod -R g+w /aimeos/bootstrap /aimeos/storage
    rm -rf /app && mv /aimeos /app
    php /app/artisan optimize
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: example
  labels:
    app: example
  namespace: example-dev
spec:
  replicas: 1
  revisionHistoryLimit: 0
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 50%
      maxSurge: 1
  selector:
    matchLabels:
      app: example
  template:
    metadata:
      labels:
        app: example
    spec:
      volumes:
      - name: setup
        configMap:
          name: example-setup
      containers:
      - name: nginx-php
        image: webdevops/php-nginx:8.2-alpine
        ports:
          - containerPort: 80
        volumeMounts:
        - name: setup
          mountPath: /opt/docker/provision/entrypoint.d/99-setup.sh
          subPath: 99-setup.sh
        env:
        - name: WEB_DOCUMENT_ROOT
          value: /app/public/
        - name: PHP_DISMOD
          value: "ioncube"
        - name: PHP_MEMORY_LIMIT
          value: "128M"
        - name: PHP_MAX_EXECUTION_TIME
          value: "30"
        - name: DB_CONNECTION
          value: "mysql"
        - name: DB_HOST
          value: "example-db"
        - name: DB_PORT
          value: "3306"
        - name: DB_DATABASE
          value: "example"
        - name: DB_USERNAME
          value: "example"
        - name: DB_PASSWORD
          value: "example"
        - name: APP_NAME
          value: "example"
        - name: APP_KEY
          value: "base64:mAoDuaiV/lT/EwXXOC7Ohy7Qs8yiivioJuBU4rrTG8s="
        - name: APP_URL
          value: "https://dev.example.com"
        - name: ASSET_URL
          value: "https://dev.example.com"
        - name: APP_DEBUG
          value: "1"
        - name: APP_ENV
          value: "local"
---
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
  name: example-issuer
  namespace: example-dev
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    privateKeySecretRef:
      name: example-issuer-key
    solvers:
    - http01:
        ingress:
          ingressClassName: traefik
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: dev-example-de
  namespace: example-dev
spec:
  secretName: example-secret
  privateKey:
    rotationPolicy: Always
  dnsNames:
  - dev.example.com
  issuerRef:
    name: example-issuer
    kind: Issuer
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: example-ingress-http
  namespace: example-dev
spec:
  entryPoints:
  - web
  routes:
  - match: Host(`dev.example.com`)
    kind: Rule
    services:
    - name: example
      port: 80
      passHostHeader: true
      sticky:
        cookie:
          httpOnly: true
          name: example-host
          sameSite: lax
      strategy: RoundRobin
      weight: 10
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: example-ingress-https
  namespace: example-dev
spec:
  entryPoints:
  - websecure
  routes:
  - match: Host(`dev.example.com`)
    kind: Rule
    services:
    - name: example
      port: 80
      passHostHeader: true
      sticky:
        cookie:
          httpOnly: true
          name: example-host
          sameSite: lax
      strategy: RoundRobin
      weight: 10
  tls:
    secretName: example-secret

from aimeos-headless.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.