From 27440ecae72d48f542a8e2825ac9b9ff1447214c Mon Sep 17 00:00:00 2001 From: Martyn Ranyard Date: Tue, 14 Nov 2023 12:11:14 +0100 Subject: [PATCH] cloudtube and newleaf Signed-off-by: Martyn Ranyard --- apps-kustomized/cloudtube/configmap.yaml | 24 ++++++++++++++ apps-kustomized/cloudtube/deploy.yaml | 41 ++++++++++++++++++++++++ apps-kustomized/cloudtube/pvc.yaml | 11 +++++++ apps-kustomized/cloudtube/service.yaml | 16 +++++++++ apps-kustomized/newleaf/configmap.yaml | 23 +++++++++++++ apps-kustomized/newleaf/deploy.yaml | 36 +++++++++++++++++++++ apps-kustomized/newleaf/service.yaml | 16 +++++++++ everything-app/cloudtube.yaml | 14 ++++++++ everything-app/newleaf.yaml | 14 ++++++++ 9 files changed, 195 insertions(+) create mode 100644 apps-kustomized/cloudtube/configmap.yaml create mode 100644 apps-kustomized/cloudtube/deploy.yaml create mode 100644 apps-kustomized/cloudtube/pvc.yaml create mode 100644 apps-kustomized/cloudtube/service.yaml create mode 100644 apps-kustomized/newleaf/configmap.yaml create mode 100644 apps-kustomized/newleaf/deploy.yaml create mode 100644 apps-kustomized/newleaf/service.yaml create mode 100644 everything-app/cloudtube.yaml create mode 100644 everything-app/newleaf.yaml diff --git a/apps-kustomized/cloudtube/configmap.yaml b/apps-kustomized/cloudtube/configmap.yaml new file mode 100644 index 0000000..37a3da1 --- /dev/null +++ b/apps-kustomized/cloudtube/configmap.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +data: + cloudtube.config.js: | + module.exports = { + /* + Copy this file to `config.js`, and add options here. + They'll override the options from `utils/constants.js`. + For example, the next block changes the default instance. + */ + user_settings: { + instance: { + default: "http://newleaf.martyn.berlin" + } + }, + /* + If cloudtube and Newleaf is not in same docker-network, you need to also set local_instance_origin. + */ + server_setup: { + local_instance_origin: "http://newleaf.cloudtube.svc.cluster.local:3000" + } + } +kind: ConfigMap +metadata: + name: cloudtube diff --git a/apps-kustomized/cloudtube/deploy.yaml b/apps-kustomized/cloudtube/deploy.yaml new file mode 100644 index 0000000..21ed848 --- /dev/null +++ b/apps-kustomized/cloudtube/deploy.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + app: cloudtube + name: cloudtube +spec: + replicas: 1 + selector: + matchLabels: + app: cloudtube + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + app: cloudtube + spec: + containers: + - image: abeltramo/cloudtube:59266a6 + name: cloudtube + resources: {} + volumeMounts: + - mountPath: /workdir/db + name: db + - mountPath: /workdir/config/config.js + name: config + subPath: cloudtube.config.js + volumes: + - configMap: + defaultMode: 420 + items: + - key: cloudtube.config.js + path: cloudtube.config.js + name: cloudtube + name: config + - name: db + persistentVolumeClaim: + claimName: cloudtube-db-data +status: {} diff --git a/apps-kustomized/cloudtube/pvc.yaml b/apps-kustomized/cloudtube/pvc.yaml new file mode 100644 index 0000000..7dd6b41 --- /dev/null +++ b/apps-kustomized/cloudtube/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: cloudtube-db-data +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + storageClassName: local-path diff --git a/apps-kustomized/cloudtube/service.yaml b/apps-kustomized/cloudtube/service.yaml new file mode 100644 index 0000000..8bd3bb8 --- /dev/null +++ b/apps-kustomized/cloudtube/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: cloudtube + app.kubernetes.io/instance: cloudtube + name: cloudtube + annotations: + external-dns.alpha.kubernetes.io/hostname: cloudtube.martyn.berlin +spec: + ports: + - targetPort: 10412 + port: 80 + selector: + app: cloudtube + type: LoadBalancer diff --git a/apps-kustomized/newleaf/configmap.yaml b/apps-kustomized/newleaf/configmap.yaml new file mode 100644 index 0000000..1c4a70f --- /dev/null +++ b/apps-kustomized/newleaf/configmap.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +data: + newleaf-configuration.py: |- + # ============================== + # You MUST set these settings. + # ============================== + + # A URL that this site can be accessed on. Do not include a trailing slash. + website_origin = "http://newleaf.martyn.berlin" + + + # ============================== + # These settings are optional. + # ============================== + + # The address of the interface to bind to. + #bind_host = "0.0.0.0" + + # The port to bind to. + #bind_port = 3000 +kind: ConfigMap +metadata: + name: newleaf diff --git a/apps-kustomized/newleaf/deploy.yaml b/apps-kustomized/newleaf/deploy.yaml new file mode 100644 index 0000000..dfca9cb --- /dev/null +++ b/apps-kustomized/newleaf/deploy.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + creationTimestamp: null + labels: + app: newleaf + name: newleaf +spec: + replicas: 1 + selector: + matchLabels: + app: newleaf + strategy: {} + template: + metadata: + creationTimestamp: null + labels: + app: newleaf + spec: + containers: + - image: abeltramo/newleaf:97b7661 + name: newleaf + resources: {} + volumeMounts: + - mountPath: /workdir/configuration.py + name: config + subPath: newleaf-configuration.py + volumes: + - configMap: + defaultMode: 420 + items: + - key: newleaf-configuration.py + path: newleaf-configuration.py + name: newleaf + name: config +status: {} diff --git a/apps-kustomized/newleaf/service.yaml b/apps-kustomized/newleaf/service.yaml new file mode 100644 index 0000000..3935678 --- /dev/null +++ b/apps-kustomized/newleaf/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: newleaf + app.kubernetes.io/instance: newleaf + name: newleaf + annotations: + external-dns.alpha.kubernetes.io/hostname: newleaf.martyn.berlin +spec: + ports: + - port: 80 + targetPort: 3000 + selector: + app: newleaf + type: LoadBalancer diff --git a/everything-app/cloudtube.yaml b/everything-app/cloudtube.yaml new file mode 100644 index 0000000..c815d99 --- /dev/null +++ b/everything-app/cloudtube.yaml @@ -0,0 +1,14 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cloudtube + namespace: argocd +spec: + destination: + namespace: cloudtube + server: https://kubernetes.default.svc + project: apps + source: + path: apps-kustomized/cloudtube + repoURL: https://git.martyn.berlin/martyn/infra4talos + targetRevision: HEAD diff --git a/everything-app/newleaf.yaml b/everything-app/newleaf.yaml new file mode 100644 index 0000000..859b4e8 --- /dev/null +++ b/everything-app/newleaf.yaml @@ -0,0 +1,14 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: newleaf + namespace: argocd +spec: + destination: + namespace: newleaf + server: https://kubernetes.default.svc + project: apps + source: + path: apps-kustomized/newleaf + repoURL: https://git.martyn.berlin/martyn/infra4talos + targetRevision: HEAD