From 16fddbc6aa0c9f97f5483af681d5798c4697d0ed Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Thu, 17 Feb 2022 11:53:15 +0100 Subject: [PATCH] Fixed ignore list --- .gitignore | 1 + examples/basic/docker-compose.yaml | 30 +++++++++++++++++++++ examples/same-pod/docker-compose.yaml | 38 +++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) create mode 100644 examples/basic/docker-compose.yaml create mode 100644 examples/same-pod/docker-compose.yaml diff --git a/.gitignore b/.gitignore index cb7c669..bdd2841 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ docker-compose.yaml katenary *.env docker-compose* +!examples/**/docker-compose* diff --git a/examples/basic/docker-compose.yaml b/examples/basic/docker-compose.yaml new file mode 100644 index 0000000..6f99b9a --- /dev/null +++ b/examples/basic/docker-compose.yaml @@ -0,0 +1,30 @@ +version: "3" + +services: + + webapp: + image: php:7-apache + + environment: + DB_HOST: database + ports: + - "8080:80" + labels: + # expose an ingress + katenary.io/ingress: 80 + # DB_HOST is actually a service name + katenary.io/env-to-service: DB_HOST + depends_on: + - database + + database: + image: mariadb:10 + environment: + MARIADB_ROOT_PASSWORD: foobar + MARIADB_USER: foo + MARIADB_PASSWORD: foo + MARIADB_DATABASE: myapp + labels: + # because we don't provide "ports" or "expose", alert katenary + # to use the mysql port for service declaration + katenary.io/ports: 3306 diff --git a/examples/same-pod/docker-compose.yaml b/examples/same-pod/docker-compose.yaml new file mode 100644 index 0000000..a215527 --- /dev/null +++ b/examples/same-pod/docker-compose.yaml @@ -0,0 +1,38 @@ +version: "3" + +services: + + http: + image: nginx:alpine + ports: + - "8080:80" + volumes: + - "sock:/sock" + - "./config/nginx:/etc/nginx/conf.d:z" + + labels: + # the "sock" volume will need to be shared to the same pod, so let's + # declare that this is not a PVC + katenary.io/empty-dirs: sock + + # use ./config/nginx as a configMap + katenary.io/configmap-volumes: ./config/nginx + + # declare an ingress + katenary.io/ingress: 80 + + php: + image: php:fpm + volumes: + - "sock:/sock" + - "./config/php/www.conf:/usr/local/etc/php-fpm.d/www.conf:z" + labels: + # fpm will need to use a unix socket shared + # with nginx (http service above), so we want here + # make a single pod containing nginx and php + katenary.io/same-pod: http + # use the ./config/php files as a configMap + katenary.io/configmap-volumes: ./config/php/www.conf + +volumes: + sock: