diff --git a/k8s/development/auth/deployment.yaml b/k8s/development/auth/deployment.yaml deleted file mode 100644 index f3e07244..00000000 --- a/k8s/development/auth/deployment.yaml +++ /dev/null @@ -1,55 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: auth - name: auth - namespace: chicmoz -spec: - replicas: 1 - selector: - matchLabels: - app: auth - strategy: {} - template: - metadata: - labels: - app: auth - spec: - containers: - - image: auth:latest - resources: - limits: - memory: 500Mi - cpu: 50m - ports: - - name: http-app - containerPort: 80 - protocol: TCP - name: auth - env: - - name: PORT - value: "80" - - name: POSTGRES_IP - value: "postgresql" - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_DB_NAME - value: "auth" - - name: POSTGRES_ADMIN - value: "admin" - - name: POSTGRES_PASSWORD - value: "secret-local-password" # TODO: change to env-var - - name: REDIS_HOST - value: "redis-master" - - name: REDIS_PORT - value: "6379" - - name: NODE_ENV - value: "development" - readinessProbe: - httpGet: - path: /health - port: 80 - initialDelaySeconds: 15 - periodSeconds: 10 -status: {} diff --git a/k8s/development/auth/service.yaml b/k8s/development/auth/service.yaml deleted file mode 100644 index 93752a19..00000000 --- a/k8s/development/auth/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: auth - namespace: chicmoz -spec: - selector: - app: auth - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: http-app diff --git a/k8s/development/aztec-listener/deployment.yaml b/k8s/development/aztec-listener/deployment.yaml deleted file mode 100644 index 34442a83..00000000 --- a/k8s/development/aztec-listener/deployment.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: aztec-listener - name: aztec-listener - namespace: chicmoz -spec: - replicas: 1 - selector: - matchLabels: - app: aztec-listener - strategy: {} - template: - metadata: - labels: - app: aztec-listener - spec: - containers: - - image: aztec-listener:latest - resources: - limits: - memory: 750Mi - cpu: 250m - name: aztec-listener - env: - - name: NODE_ENV - value: "development" - - name: BLOCK_INTERVAL_MS - value: "2000" - - name: BATCH_SIZE - value: "50" - - name: CHAIN_NAME - value: "AZTEC" - - name: NETWORK_NAME - value: "SANDBOX" - - name: MAX_BATCH_SIZE_FETCH_MISSED_BLOCKS - value: "50" - - name: LISTEN_FOR_BLOCKS - value: "true" - - name: CATCHUP_ENABLED - value: "false" - - name: POSTGRES_IP - value: "postgresql" - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_DB_NAME - value: "azteclistener" - - name: POSTGRES_ADMIN - value: "admin" - - name: POSTGRES_PASSWORD - value: "secret-local-password" - - name: AZTEC_RPC - value: "http://host.minikube.internal:8080" - - name: IGNORE_PROCESSED_HEIGHT - value: "true" -status: {} diff --git a/k8s/development/aztec-listener/service.yaml b/k8s/development/aztec-listener/service.yaml deleted file mode 100644 index 485ff512..00000000 --- a/k8s/development/aztec-listener/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: aztec-listener - namespace: chicmoz -spec: - selector: - app: aztec-listener - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: http-app diff --git a/k8s/development/common/namespace.yaml b/k8s/development/common/namespace.yaml deleted file mode 100644 index ce8151b5..00000000 --- a/k8s/development/common/namespace.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: chicmoz - labels: - name: chicmoz ---- -apiVersion: v1 -kind: Namespace -metadata: - name: ingress-nginx - labels: - name: ingress-nginx diff --git a/k8s/development/dummy-node/deployment.yaml b/k8s/development/dummy-node/deployment.yaml deleted file mode 100644 index 52271165..00000000 --- a/k8s/development/dummy-node/deployment.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: dummy-node - name: dummy-node - namespace: chicmoz -spec: - replicas: 1 - selector: - matchLabels: - app: dummy-node - strategy: {} - template: - metadata: - labels: - app: dummy-node - spec: - containers: - - image: dummy-node:latest - resources: - limits: - memory: 500Mi - cpu: 50m - ports: - - name: http-app - containerPort: 80 - protocol: TCP - name: dummy-node - env: - - name: PORT - value: "80" - readinessProbe: - httpGet: - path: /health - port: 80 - initialDelaySeconds: 15 - periodSeconds: 10 -status: {} diff --git a/k8s/development/dummy-node/ingress.yaml b/k8s/development/dummy-node/ingress.yaml deleted file mode 100644 index d27cdabe..00000000 --- a/k8s/development/dummy-node/ingress.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress-node - namespace: chicmoz - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$1 - nginx.ingress.kubernetes.io/auth-url: http://auth.chicmoz.svc.cluster.local - nginx.ingress.kubernetes.io/auth-response-headers: x-api-key -spec: - ingressClassName: nginx - rules: - - http: - paths: - - backend: - service: - name: dummy-node - port: - name: http-app - path: /v1/.+?/(.+) - pathType: Prefix -status: - loadBalancer: {} diff --git a/k8s/development/dummy-node/service.yaml b/k8s/development/dummy-node/service.yaml deleted file mode 100644 index 364f66b9..00000000 --- a/k8s/development/dummy-node/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: dummy-node - namespace: chicmoz -spec: - selector: - app: dummy-node - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: http-app diff --git a/k8s/development/explorer-api/deployment.yaml b/k8s/development/explorer-api/deployment.yaml deleted file mode 100644 index 914ceb89..00000000 --- a/k8s/development/explorer-api/deployment.yaml +++ /dev/null @@ -1,63 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: explorer-api - name: explorer-api - namespace: chicmoz -spec: - replicas: 1 - selector: - matchLabels: - app: explorer-api - strategy: {} - template: - metadata: - labels: - app: explorer-api - spec: - containers: - - image: explorer-api:latest - resources: - limits: - memory: 4096Mi - cpu: 350m - ports: - - name: http-app - containerPort: 80 - protocol: TCP - name: explorer-api - env: - - name: NODE_ENV - value: "development" - - name: PORT - value: "80" - - name: NETWORK_NAME - value: "SANDBOX" - - name: POSTGRES_IP - value: "postgresql" - - name: POSTGRES_PORT - value: "5432" - - name: POSTGRES_DB_NAME - value: "auth" - - name: POSTGRES_ADMIN - value: "admin" - - name: POSTGRES_PASSWORD - value: "secret-local-password" # TODO: change to env-var - - name: BLOCK_INTERVAL_MS - value: "2000" - - name: BLOCK_DB_VALIDATION_ENABLED - value: "false" - - name: BLOCK_DB_VALIDATION_INTERVAL - value: "50" - - name: BLOCK_BD_VALIDATION_OFFSET - value: "50" - - name: CACHE_EXPIRATION_MS - value: "5000" - readinessProbe: - httpGet: - path: /health - port: 80 - initialDelaySeconds: 15 - periodSeconds: 10 -status: {} diff --git a/k8s/development/explorer-api/ingress.yaml b/k8s/development/explorer-api/ingress.yaml deleted file mode 100644 index 89548c01..00000000 --- a/k8s/development/explorer-api/ingress.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress-explorer-api - namespace: chicmoz - annotations: - nginx.ingress.kubernetes.io/use-regex: "true" - nginx.ingress.kubernetes.io/rewrite-target: /$2 - nginx.ingress.kubernetes.io/auth-url: http://auth.chicmoz.svc.cluster.local - nginx.ingress.kubernetes.io/auth-response-headers: x-api-key -spec: - ingressClassName: nginx - rules: - - host: explorer-api.localhost - http: - paths: - - path: /v1/([^/]+)/(.*) - pathType: ImplementationSpecific - backend: - service: - name: explorer-api - port: - name: http-app -status: - loadBalancer: {} diff --git a/k8s/development/explorer-api/service.yaml b/k8s/development/explorer-api/service.yaml deleted file mode 100644 index 1ef96f59..00000000 --- a/k8s/development/explorer-api/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: explorer-api - namespace: chicmoz -spec: - selector: - app: explorer-api - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: http-app diff --git a/k8s/development/explorer-ui/deployment.yaml b/k8s/development/explorer-ui/deployment.yaml deleted file mode 100644 index 60e0f218..00000000 --- a/k8s/development/explorer-ui/deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app: explorer-ui - name: explorer-ui - namespace: chicmoz -spec: - replicas: 1 - selector: - matchLabels: - app: explorer-ui - strategy: {} - template: - metadata: - labels: - app: explorer-ui - spec: - containers: - - image: explorer-ui:latest - resources: - limits: - memory: 500Mi - cpu: 200m - ports: - - name: http-app - containerPort: 3000 - protocol: TCP - name: explorer-ui -status: {} diff --git a/k8s/development/explorer-ui/ingress.yaml b/k8s/development/explorer-ui/ingress.yaml deleted file mode 100644 index 09389742..00000000 --- a/k8s/development/explorer-ui/ingress.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress-explorer-ui - namespace: chicmoz -spec: - ingressClassName: nginx - rules: - - host: explorer-ui.localhost - http: - paths: - - backend: - service: - name: explorer-ui - port: - name: http-app - path: / - pathType: Prefix -status: - loadBalancer: {} diff --git a/k8s/development/explorer-ui/service.yaml b/k8s/development/explorer-ui/service.yaml deleted file mode 100644 index b20db502..00000000 --- a/k8s/development/explorer-ui/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: explorer-ui - namespace: chicmoz -spec: - selector: - app: explorer-ui - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: 80 diff --git a/k8s/development/kafka-ui/configmap-env.yaml b/k8s/development/kafka-ui/configmap-env.yaml deleted file mode 100644 index d968dae4..00000000 --- a/k8s/development/kafka-ui/configmap-env.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: kafka-ui-helm-values - namespace: chicmoz -data: - DYNAMIC_CONFIG_ENABLED: "true" -# To connect to kafka set the following from the dashboard -# Cluster name: "chicmoz" -# Bootstrap servers: kafka:9092 -# Auth method: SASL/PLAIN -# Security protocol: SASL_PLAINTEXT -# Username: controller_user -# Password: test diff --git a/k8s/development/kafka-ui/configmap.yaml b/k8s/development/kafka-ui/configmap.yaml deleted file mode 100644 index b62f2ee5..00000000 --- a/k8s/development/kafka-ui/configmap.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: kafka-ui-configmap - namespace: chicmoz -data: - config.yml: |- - kafka: - clusters: - - name: yaml - bootstrapServers: kafka-cluster-broker-endpoints:9092 - auth: - type: disabled - management: - health: - ldap: - enabled: false diff --git a/k8s/development/kafka-ui/ingress.yaml b/k8s/development/kafka-ui/ingress.yaml deleted file mode 100644 index ebe52e8c..00000000 --- a/k8s/development/kafka-ui/ingress.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress-kafka-ui - namespace: chicmoz -spec: - ingressClassName: nginx - rules: - - host: kafka.localhost - http: - paths: - - backend: - service: - name: kafka-ui - port: - name: http - path: / - pathType: Prefix -status: - loadBalancer: {} diff --git a/k8s/development/metrics/ingress.yaml b/k8s/development/metrics/ingress.yaml deleted file mode 100644 index 1617ef0b..00000000 --- a/k8s/development/metrics/ingress.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ingress-metrics - namespace: chicmoz - annotations: - nginx.ingress.kubernetes.io/rewrite-target: /_external/$2 - nginx.ingress.kubernetes.io/limit-rps: "100" -spec: - ingressClassName: nginx - rules: - - http: - paths: - - backend: - service: - name: metrics - port: - name: http-app - path: /metrics(/|$)(.*) - pathType: Prefix -status: - loadBalancer: {} diff --git a/k8s/development/metrics/service.yaml b/k8s/development/metrics/service.yaml deleted file mode 100644 index 18e1637e..00000000 --- a/k8s/development/metrics/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: metrics - namespace: chicmoz -spec: - selector: - app: metrics - ports: - - name: http-app - protocol: TCP - port: 80 - targetPort: http-app diff --git a/k8s/development/postgres/values.yaml b/k8s/development/postgres/values.yaml deleted file mode 100644 index ee9a5eb4..00000000 --- a/k8s/development/postgres/values.yaml +++ /dev/null @@ -1,72 +0,0 @@ -primary: - initdb: - scripts: - init.sql: | - SELECT 'CREATE DATABASE auth' - WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'auth')\gexec - \c auth - CREATE TABLE public."auth_api-keys" ( - id integer NOT NULL, - "apiKey" uuid NOT NULL, - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL - ); - - CREATE SEQUENCE public."auth_api-keys_id_seq" - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - ALTER SEQUENCE public."auth_api-keys_id_seq" OWNED BY public."auth_api-keys".id; - - ALTER TABLE ONLY public."auth_api-keys" ALTER COLUMN id SET DEFAULT nextval('public."auth_api-keys_id_seq"'::regclass); - - COPY public."auth_api-keys" (id, "apiKey", "createdAt", "updatedAt") FROM stdin; - 1 d1e2083a-660c-4314-a6f2-1d42f4b944f4 2023-11-02 12:22:48.82+00 2023-11-02 12:22:48.82+00 - \. - SELECT pg_catalog.setval('public."auth_api-keys_id_seq"', 1, true); - ALTER TABLE ONLY public."auth_api-keys" - ADD CONSTRAINT "auth_api-keys_pkey" PRIMARY KEY (id); - CREATE UNIQUE INDEX "auth_api-keys_api_key" ON public."auth_api-keys" USING btree ("apiKey"); - - SELECT 'CREATE DATABASE apikey' - WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'apikey')\gexec - \c apikey - CREATE TABLE public."api-key_api-keys" ( - id integer NOT NULL, - "apiKey" uuid NOT NULL, - "userId" character varying(255), - "createdAt" timestamp with time zone NOT NULL, - "updatedAt" timestamp with time zone NOT NULL - ); - - CREATE SEQUENCE public."api-key_api-keys_id_seq" - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - - ALTER SEQUENCE public."api-key_api-keys_id_seq" OWNED BY public."api-key_api-keys".id; - - ALTER TABLE ONLY public."api-key_api-keys" ALTER COLUMN id SET DEFAULT nextval('public."api-key_api-keys_id_seq"'::regclass); - - COPY public."api-key_api-keys" (id, "apiKey", "userId", "createdAt", "updatedAt") FROM stdin; - 1 d1e2083a-660c-4314-a6f2-1d42f4b944f4 \N 2023-11-02 12:22:48.82+00 2023-11-02 12:22:48.82+00 - \. - SELECT pg_catalog.setval('public."api-key_api-keys_id_seq"', 67, true); - ALTER TABLE ONLY public."api-key_api-keys" - ADD CONSTRAINT "api-key_api-keys_pkey" PRIMARY KEY (id); - CREATE UNIQUE INDEX "api-key_api-keys_api_key" ON public."api-key_api-keys" USING btree ("apiKey"); - - SELECT 'CREATE DATABASE metrics' - WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'metrics')\gexec - - SELECT 'CREATE DATABASE azteclistener' - WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'azteclistener')\gexec - SELECT 'CREATE DATABASE explorer-api' - WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'explorer-api')\gexec diff --git a/k8s/development/skaffold.development.yaml b/k8s/development/skaffold.development.yaml deleted file mode 100644 index d738e4f4..00000000 --- a/k8s/development/skaffold.development.yaml +++ /dev/null @@ -1,131 +0,0 @@ -apiVersion: skaffold/v4beta6 -kind: Config -metadata: - name: chicmoz -build: - artifacts: - - image: chicmoz-base - context: . - docker: - dockerfile: Dockerfile - - image: dummy-node - context: services/dummy-node - docker: - dockerfile: Dockerfile - requires: - - image: chicmoz-base - alias: BASE - # - image: explorer-ui - # context: services/explorer-ui - # docker: - # dockerfile: Dockerfile - # buildArgs: - # NODE_ENV: "development" - # VITE_API_URL: "http://explorer-api.localhost:80/v1/d1e2083a-660c-4314-a6f2-1d42f4b944f4" - # requires: - # - image: chicmoz-base - # alias: BASE - - image: auth - context: services/auth - docker: - dockerfile: Dockerfile - requires: - - image: chicmoz-base - alias: BASE - - image: aztec-listener - context: services/aztec-listener - docker: - dockerfile: Dockerfile - requires: - - image: chicmoz-base - alias: BASE - - image: explorer-api - context: services/explorer-api - docker: - dockerfile: Dockerfile - requires: - - image: chicmoz-base - alias: BASE -manifests: - rawYaml: - - k8s/local/common/namespace.yaml - # - k8s/local/explorer-ui/ingress.yaml - # - k8s/local/explorer-ui/deployment.yaml - - k8s/local/explorer-ui/service.yaml - - k8s/local/explorer-api/ingress.yaml - - k8s/local/explorer-api/deployment.yaml - - k8s/local/explorer-api/service.yaml - - k8s/local/auth/deployment.yaml - - k8s/local/auth/service.yaml - - k8s/local/dummy-node/ingress.yaml - - k8s/local/dummy-node/deployment.yaml - - k8s/local/dummy-node/service.yaml - - k8s/local/aztec-listener/deployment.yaml - - k8s/local/aztec-listener/service.yaml - - k8s/local/kafka-ui/configmap.yaml - - k8s/local/kafka-ui/configmap-env.yaml - - k8s/local/kafka-ui/ingress.yaml - helm: - releases: - - name: ingress-nginx - remoteChart: ingress-nginx - repo: https://kubernetes.github.io/ingress-nginx - namespace: chicmoz - createNamespace: false - recreatePods: false - skipBuildDependencies: false - useHelmSecrets: false - wait: false - - name: postgresql - version: 12.10.0 - remoteChart: postgresql - repo: https://charts.bitnami.com/bitnami - valuesFiles: - - k8s/local/postgres/values.yaml - setValues: - global.postgresql.auth.postgresPassword: "secret-local-password" # TODO: change to env-var - global.postgresql.auth.username: "admin" - global.postgresql.auth.password: "secret-local-password" # TODO: change to env-var - image.debug: true - namespace: chicmoz - createNamespace: false - recreatePods: false - skipBuildDependencies: false - useHelmSecrets: false - wait: false - - name: redis - version: 18.17.1 - remoteChart: redis - repo: https://charts.bitnami.com/bitnami - namespace: chicmoz - createNamespace: false - recreatePods: false - skipBuildDependencies: false - useHelmSecrets: false - wait: false - setValues: - auth.enabled: false - - name: kafka - version: 26.4.2 - remoteChart: kafka - repo: https://charts.bitnami.com/bitnami - namespace: chicmoz - setValues: - sasl.enabledMechanisms: plain - sasl.controllerMechanism: plain - sasl.interBrokerMechanism: plain - sasl.controller.user: controller_user - sasl.controller.password: test - sasl.interbroker.user: inter_broker_user - sasl.interbroker.password: test - sasl.client.users: - - controller_user - sasl.client.passwords: - - test - extraConfig: | - message.max.bytes=10000000 - createNamespace: false - recreatePods: true - skipBuildDependencies: false - useHelmSecrets: false - wait: false