diff --git a/services/aefeup/website/00-namespace.yaml b/services/aefeup/website/00-namespace.yaml new file mode 100644 index 00000000..2188c57e --- /dev/null +++ b/services/aefeup/website/00-namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: website-ae diff --git a/services/aefeup/website/01-deployment.yaml b/services/aefeup/website/01-deployment.yaml new file mode 100644 index 00000000..c780d20d --- /dev/null +++ b/services/aefeup/website/01-deployment.yaml @@ -0,0 +1,44 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: website-ae + namespace: website-ae + annotations: + keel.sh/policy: "force" + keel.sh/match-tag: "true" +spec: + selector: + matchLabels: + app: website-ae + template: + metadata: + labels: + app: website-ae + spec: + containers: + - name: website-ae + image: registry.niaefeup.pt/niaefeup/website-ae:main + resources: + limits: + memory: "256Mi" + cpu: "500m" + ports: + - containerPort: 3000 + imagePullPolicy: Always + imagePullSecrets: + - name: harbor-pull-secret +--- +apiVersion: v1 +kind: Service +metadata: + name: website-ae-service + namespace: website-ae +spec: + selector: + app: website-ae + ports: + - port: 80 + targetPort: 3000 + type: "ClusterIP" + diff --git a/services/aefeup/website/02-certificates.yaml b/services/aefeup/website/02-certificates.yaml new file mode 100644 index 00000000..0cb43870 --- /dev/null +++ b/services/aefeup/website/02-certificates.yaml @@ -0,0 +1,14 @@ +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: website-ae-cert + namespace: website-ae +spec: + secretName: website-ae-cert + issuerRef: + name: letsencrypt-aefeup + kind: ClusterIssuer + commonName: aefeup.pt + dnsNames: + - aefeup.pt + - www.aefeup.pt diff --git a/services/aefeup/website/03-ingress-routes.yaml b/services/aefeup/website/03-ingress-routes.yaml new file mode 100644 index 00000000..d13b9ae9 --- /dev/null +++ b/services/aefeup/website/03-ingress-routes.yaml @@ -0,0 +1,19 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: website-ae-https + namespace: website-ae +spec: + entryPoints: + - websecure + routes: + - match: Host(`aefeup.pt`) || Host(`www.aefeup.pt`) + kind: Rule + services: + - name: website-ae-service + port: 80 + + tls: + secretName: website-ae-cert +--- + diff --git a/services/cert-manager/01-cluster-issuer.yaml b/services/cert-manager/01-cluster-issuer.yaml index 0faf02cd..a7a2605c 100644 --- a/services/cert-manager/01-cluster-issuer.yaml +++ b/services/cert-manager/01-cluster-issuer.yaml @@ -8,6 +8,16 @@ type: Opaque stringData: api-token: +--- +apiVersion: v1 +kind: Secret +metadata: + name: cloudflare-aefeup-api-token-secret + namespace: cert-manager +type: Opaque +stringData: + api-token: + --- apiVersion: cert-manager.io/v1 kind: ClusterIssuer @@ -29,6 +39,24 @@ spec: --- apiVersion: cert-manager.io/v1 kind: ClusterIssuer +metadata: + name: letsencrypt-aefeup +spec: + acme: + email: geral@aefeup.pt + privateKeySecretRef: + name: letsencrypt-aefeup + server: https://acme-v02.api.letsencrypt.org/directory + solvers: + - dns01: + cloudflare: + email: geral@aefeup.pt + apiTokenSecretRef: + name: cloudflare-aefeup-api-token-secret + key: api-token +--- +apiVersion: cert-manager.io/v1 +kind: ClusterIssuer metadata: name: letsencrypt-production spec: @@ -43,4 +71,4 @@ spec: email: ni@aefeup.pt apiTokenSecretRef: name: cloudflare-api-token-secret - key: api-token \ No newline at end of file + key: api-token diff --git a/services/databases/postgresql/cnpg-cluster.yaml b/services/databases/postgresql/cnpg-cluster.yaml index 84644b3f..205dd469 100644 --- a/services/databases/postgresql/cnpg-cluster.yaml +++ b/services/databases/postgresql/cnpg-cluster.yaml @@ -39,6 +39,12 @@ spec: login: true passwordSecret: name: tts-staging-secret + - name: website-ae + ensure: present + createdb: false + login: true + passwordSecret: + name: website-ae-secret storage: size: 20Gi diff --git a/services/databases/postgresql/cnpg-secrets.yaml b/services/databases/postgresql/cnpg-secrets.yaml index ac273b0c..9f57c16d 100644 --- a/services/databases/postgresql/cnpg-secrets.yaml +++ b/services/databases/postgresql/cnpg-secrets.yaml @@ -46,4 +46,15 @@ kind: Secret metadata: name: sinf-website-2023-secret namespace: pg -type: kubernetes.io/basic-auth \ No newline at end of file +type: kubernetes.io/basic-auth +--- +apiVersion: v1 +stringData: + password: + username: website-ae +kind: Secret +metadata: + name: website-ae-secret + namespace: pg +type: kubernetes.io/basic-auth +