diff --git a/k8s/monica/monica.yaml b/k8s/monica/monica.yaml new file mode 100644 index 0000000..d9d79b4 --- /dev/null +++ b/k8s/monica/monica.yaml @@ -0,0 +1,106 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: monica + namespace: monica +spec: + rules: + - host: monica.k8s.home.finn.io + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: monica + port: + name: web +--- +apiVersion: v1 +kind: Service +metadata: + name: monica + namespace: monica +spec: + ports: + - name: web + port: 80 + selector: + app: monica +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: monica + namespace: monica +spec: + selector: + matchLabels: + app: monica + serviceName: monica + replicas: 1 + template: + metadata: + labels: + app: monica + spec: + containers: + - image: docker.io/library/monica:4-apache + name: monica + resources: {} + ports: + - name: web + containerPort: 80 + # env: + # - name: APP_URL + # value: https://monica.k8s.home.finn.io + # - name: APP_FORCE_URL + # value: "true" + envFrom: + - secretRef: + name: monica + - configMapRef: + name: monica + volumeMounts: + - name: storage + mountPath: /var/www/html/storage + volumeClaimTemplates: + - metadata: + name: storage + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: monica + namespace: monica +data: + DB_HOST: mysql + DB_DATABASE: monica + DB_USERNAME: monica + CACHE_DRIVER: database + SESSION_DRIVER: database + QUEUE_DRIVER: sync + APP_ENV: production + APP_TRUSTED_PROXIES: "*" + + # mail + MAIL_MAILER: smtp + MAIL_HOST: mx1.janky.email + MAIL_PORT: "587" + MAIL_USERNAME: monica@finn.io + MAIL_ENCRYPTION: tls + MAIL_FROM_ADDRESS: monica@finn.io + MAIL_FROM_NAME: Monica + + # s3 + FILESYSTEM_DISK: s3 + DEFAULT_FILESYSTEM: s3 + AWS_ENDPOINT: https://storage.home.finn.io + AWS_BUCKET: monica + AWS_DEFAULT_REGION: us-sea-1 + AWS_USE_PATH_STYLE_ENDPOINT: "true" diff --git a/k8s/monica/mysql.yaml b/k8s/monica/mysql.yaml new file mode 100644 index 0000000..660b9eb --- /dev/null +++ b/k8s/monica/mysql.yaml @@ -0,0 +1,56 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql + namespace: monica +spec: + ports: + - name: mysql + port: 3306 + selector: + app: mysql +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: mysql + namespace: monica +spec: + selector: + matchLabels: + app: mysql + serviceName: mysql + replicas: 1 + template: + metadata: + labels: + app: mysql + spec: + containers: + - image: docker.io/library/mysql:5.7 + name: mysql + resources: {} + ports: + - name: mysql + containerPort: 3306 + volumeMounts: + - name: storage + mountPath: /var/lib/mysql + env: + - name: MYSQL_DATABASE + value: monica + - name: MYSQL_USER + value: monica + - name: MYSQL_ROOT_PASSWORD + value: "true" + envFrom: + - secretRef: + name: mysql + volumeClaimTemplates: + - metadata: + name: storage + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi