diff --git a/charts/fly-shortener/templates/ingress.yaml b/charts/fly-shortener/templates/ingress.yaml new file mode 100644 index 0000000..9e6d193 --- /dev/null +++ b/charts/fly-shortener/templates/ingress.yaml @@ -0,0 +1,40 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: gavinnewsom-shorties-ingress + namespace: spoke-rewired + annotations: + ingress.kubernetes.io/proxy-body-size: 50m + cert-manager.io/cluster-issuer: letsencrypt-prod + nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/proxy-body-size: 50m + nignx.ingress.kubernetes.io/force-ssl-redirect: "true" +spec: + ingressClassName: nginx + rules: + - host: gavinnewsom.me + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gavinnewsom-shortie + port: + number: 80 + - host: gavinnewsom.us + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: gavinnewsom-shortie + port: + number: 80 + tls: + - hosts: + - gavinnewsom.me + - gavinnewsom.us + secretName: tls-gavinnewsom-shorties diff --git a/charts/fly-shortener/templates/redis-deployment.yaml b/charts/fly-shortener/templates/redis-deployment.yaml new file mode 100644 index 0000000..788ecc0 --- /dev/null +++ b/charts/fly-shortener/templates/redis-deployment.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gavinnewsom-redis + namespace: spoke-rewired + labels: + app: gavinnewsom-redis +spec: + replicas: 1 + selector: + matchLabels: + app: gavinnewsom-redis + template: + metadata: + labels: + app: gavinnewsom-redis + spec: + containers: + - name: master + image: redis:6.2.7 + resources: + requests: + cpu: 100m + memory: 100Mi + ports: + - containerPort: 6379 diff --git a/charts/fly-shortener/templates/redis-service.yaml b/charts/fly-shortener/templates/redis-service.yaml new file mode 100644 index 0000000..7d67708 --- /dev/null +++ b/charts/fly-shortener/templates/redis-service.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: gavinnewsom-redis + namespace: spoke-rewired +spec: + selector: + app: gavinnewsom-redis + ports: + - protocol: TCP + port: 6379 + targetPort: 6379 diff --git a/charts/fly-shortener/templates/shortener-deployment.yaml b/charts/fly-shortener/templates/shortener-deployment.yaml new file mode 100644 index 0000000..6ad6410 --- /dev/null +++ b/charts/fly-shortener/templates/shortener-deployment.yaml @@ -0,0 +1,54 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: gavinnewsom-shortie + namespace: spoke-rewired + labels: + app: gavinnewsom-shortie +spec: + replicas: 1 + selector: + matchLabels: + app: gavinnewsom-shortie + template: + metadata: + labels: + app: gavinnewsom-shortie + spec: + containers: + - name: fly-shortener + image: us-east4-docker.pkg.dev/assemble-services/apps/link-shortener:1.3.2 + ports: + - containerPort: 8080 + env: + - name: REDIS_PORT + value: "6379" + - name: REDIS_FAMILY + value: "6" + - name: REDIS_USERNAME + value: "default" + - name: SOURCE + value: google-sheets + - name: GOOGLE_SHEET_RANGE + value: "'Live Links'!B2:D" + - name: GOOGLE_SERVICE_ACCOUNT_EMAIL + value: short-links@my-project.iam.gserviceaccount.com + - name: GOOGLE_SERVICE_ACCOUNT_KEY + value: "SECRET" + - name: AIRTABLE_API_KEY + value: ignore + - name: AIRTABLE_BASE + value: ignore + - name: ADMIN_SECRET + value: jaYsDPHdq8kolL7h9sZ45HobUikHVCdJ + - name: FALLBACK_URL + value: https://www.gavinnewsom.com/ + - name: TIMEZONE + value: America/Los_Angeles + - name: REDIS_HOST + value: "gavinnewsom-redis" + - name: REDIS_PASSWORD + value: "SECRET" + - name: GOOGLE_SHEET_DOC_ID + value: SECRET diff --git a/charts/fly-shortener/templates/shortener-service.yaml b/charts/fly-shortener/templates/shortener-service.yaml new file mode 100644 index 0000000..d77547a --- /dev/null +++ b/charts/fly-shortener/templates/shortener-service.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: gavinnewsom-shortie + namespace: spoke-rewired +spec: + selector: + app: gavinnewsom-shortie + ports: + - protocol: TCP + port: 80 + targetPort: 8080