Skip to content

Commit

Permalink
feat: add forms.poketwo.net
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Jul 3, 2024
1 parent e74840b commit 6dd1c56
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions kubernetes/guiduck/poketwo-forms.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{ ... }:

{
namespaces.guiduck = {
resources."apps/v1".Deployment.poketwo-forms.spec = {
replicas = 1;
selector.matchLabels.app = "poketwo-forms";
template = {
metadata.labels.app = "poketwo-forms";
spec = {
containers = [{
name = "poketwo-forms";
image = "ghcr.io/poketwo/forms.poketwo.net:latest";
imagePullPolicy = "Always";
env = [
{ name = "DATABASE_HOST"; value = "mongodb-0.mongodb-svc,mongodb-1.mongodb-svc,mongodb-2.mongodb-svc"; }
{ name = "DATABASE_USERNAME"; value = "guiduck"; }
{ name = "DATABASE_PASSWORD"; valueFrom.secretKeyRef = { name = "mongodb-user"; key = "password"; }; }
{ name = "DATABASE_NAME"; value = "support"; }
{ name = "DATABASE_URI"; value = "mongodb://$(DATABASE_USERNAME):$(DATABASE_PASSWORD)@$(DATABASE_HOST)/?authSource=admin&tls=true&tlsAllowInvalidCertificates=true"; }

{ name = "SECRET_KEY"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "secret-key"; }; }
{ name = "SENDGRID_KEY"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "sendgrid-key"; }; }
{ name = "NEXT_PUBLIC_FORMIUM_PROJECT_ID"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "formium-project-id"; }; }
{ name = "FORMIUM_TOKEN"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "formium-token"; }; }
{ name = "DISCORD_CLIENT_ID"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "discord-client-id"; }; }
{ name = "DISCORD_CLIENT_SECRET"; valueFrom.secretKeyRef = { name = "poketwo-forms"; key = "discord-client-secret"; }; }
];
}];
imagePullSecrets = [{ name = "ghcr-auth"; }];
};
};
};

resources.v1.Service.poketwo-forms.spec = {
selector.app = "poketwo-forms";
ports = [{
port = 80;
targetPort = 3000;
}];
};

resources."networking.k8s.io/v1".Ingress.poketwo-forms-ingress = {
metadata.annotations."cert-manager.io/cluster-issuer" = "letsencrypt";
spec = {
rules = [{
host = "forms.poketwo.net";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "poketwo-forms";
port.number = 80;
};
}];
}];
tls = [{
hosts = [ "forms.poketwo.net" ];
secretName = "poketwo-forms-ingress-tls";
}];
};
};

resources.v1.Secret.poketwo-forms = {
type = "Opaque";
stringData = {
secret-key = "";
sendgrid-key = "";
formium-project-id = "";
formium-token = "";
discord-client-id = "";
discord-client-secret = "";
};
};
};
}

0 comments on commit 6dd1c56

Please sign in to comment.