Skip to content

Commit

Permalink
feat(gateway-proxy): use configmap in addition to secret
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-ni committed Jul 14, 2024
1 parent a6af7b3 commit fe1359d
Showing 1 changed file with 36 additions and 5 deletions.
41 changes: 36 additions & 5 deletions kubernetes/poketwo/gateway-proxy.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{ ... }:

{
namespaces.poketwo = {
resources = {
"apps/v1".Deployment.gateway-proxy.spec = {
replicas = 1;
selector.matchLabels.app = "gateway-proxy";
template = {
metadata.labels.app = "gateway-proxy";
Expand All @@ -21,13 +24,14 @@
};
volumeMounts = [{
name = "config";
mountPath = "/config.json";
subPath = "config.json";
mountPath = "/config";
}];
env = [{ name = "CONFIG"; value = "/config/config.json"; }];
envFrom = [{ secretRef = { name = "poketwo"; }; }];
}];
volumes = [{
name = "config";
secret = { secretName = "gateway-proxy"; };
configMap = { name = "gateway-proxy"; };
}];
imagePullSecrets = [{ name = "ghcr-auth"; }];
};
Expand All @@ -39,8 +43,35 @@
ports = [{ port = 7878; }];
};

v1.Secret.gateway-proxy.stringData = {
"config.json" = "";
v1.Secret.poketwo.stringData = {
"TOKEN" = "";
};

v1.ConfigMap.gateway-proxy.data = {
"config.json" = builtins.toJSON {
log_level = "info";
shards = 1600;
intents = 32509;
port = 7878;
activity = { type = 0; name = "@Pokétwo help"; };
status = "online";
backpressure = 100;
validate_token = true;
externally_accessible_url = "ws://gateway-proxy.poketwo.svc.cluster.local:7878";
cache = {
channels = true;
presences = false;
emojis = false;
current_member = true;
members = false;
roles = true;
scheduled_events = false;
stage_instances = false;
stickers = false;
users = true;
voice_states = false;
};
};
};
};
};
Expand Down

0 comments on commit fe1359d

Please sign in to comment.