Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • tomprince/PrivateStorageio
  • privatestorage/PrivateStorageio
2 results
Select Git revision
Show changes
Showing
with 121 additions and 82 deletions
...@@ -11,7 +11,8 @@ You can find more information about some of these secrets in ``ops/generating-ke ...@@ -11,7 +11,8 @@ You can find more information about some of these secrets in ``ops/generating-ke
deploy_key deploy_key
---------- ----------
This is an SSH private key which will be authorized to trigger a deployment update on the deployment hosts themselves. This SSH private key authenticates an account used by the continuous deployment system.
Each node authorizes that account to trigger a deployment update on itself.
The corresponding SSH public key is kept in the ``public-keys`` location. The corresponding SSH public key is kept in the ``public-keys`` location.
grafana-admin.password grafana-admin.password
...@@ -19,6 +20,20 @@ grafana-admin.password ...@@ -19,6 +20,20 @@ grafana-admin.password
This is the initial admin password for the Grafana web admin on the monitoring host. This is the initial admin password for the Grafana web admin on the monitoring host.
grafana-slack-url
-----------------
This file is read by Grafana's systemd service to set an environment variable with a secret Slack WebHook URL to post alerts to.
The only line in the file should be the secret URL.
Use the url from `this 1Password entry <https://privatestorage.1password.com/vaults/7flqasy5hhhmlbtp5qozd3j4ga/allitems/cgznskz2oix2tyx5xyntwaos5i>`_ or get a new secret URL for your Slack channel at https://www.slack.com/apps/A0F7XDUAZ.
grafana-zulip-url
-----------------
This file should contain a single line with the secret Zulip alerting Webhook Bot URL.
The URLs for Staging and Production are both stored in 1Password.
See `https://zulip.com/integrations/doc/grafana`_ for documentation and ``grid/local/private-keys/grafana-zulip-url`` for an example.
stripe.secret stripe.secret
------------- -------------
......
The most interesting passphrase in the world.
-----BEGIN OPENSSH PRIVATE KEY-----
ratatatratatatratatatratatatratatatratatatratatatratatatratatatratatat
ratatatratatatratatatratatatratatatratatatratatatratatatratatatratatat
ratatatratatatratatatratatatratatatratatatratatatratatatratatatratatat
ratatatratatatratatatratatatratatatratatatratatatratatatratatatratatat
ratatatratatatratatatratatatratatatratatatc=
-----END OPENSSH PRIVATE KEY-----
https://hooks.slack.com/services/x/y/z
https://yourZulipDomain.zulipchat.com/api/v1/external/grafana?api_key=abcdefgh&stream=stream%20name&topic=your%20topic
whsec_12121212121212121212121212121212121212
abc123de@abc123de.repo.borgbase.com:repo
vwx789yz@vwx789yz.repo.borgbase.com:repo
let
# Add your public key. Example: # Add your public key. Example:
# let key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHx7wJQNqKn8jOC4AxySRL2UxidNp7uIK9ad3pMb1ifF flo@fs-la"; # key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHx7wJQNqKn8jOC4AxySRL2UxidNp7uIK9ad3pMb1ifF flo@fs-la";
# You can use the following to get key from the local machine. # You can use the following to get key from the local machine.
# let key = builtins.readFile ~/.ssh/id_ed25519.pub; # key = builtins.readFile ~/.ssh/id_ed25519.pub;
let key = undefined; key = undefined;
in { "root" = key; "vagrant" = key; } keys = [key]
in {
"root" = keys;
"vagrant" = keys;
}
...@@ -5,15 +5,16 @@ ...@@ -5,15 +5,16 @@
, "monitoringvpnEndpoint": "monitoring.private.storage:51820" , "monitoringvpnEndpoint": "monitoring.private.storage:51820"
, "passValue": 1000000 , "passValue": 1000000
, "issuerDomains": [ , "issuerDomains": [
"payments.privatestorage.io" "payments.private.storage"
, "payments.private.storage" , "payments.privatestorage.io"
]
, "monitoringDomains": [
"monitoring.private.storage"
, "monitoring.privatestorage.io"
] ]
, "letsEncryptAdminEmail": "jean-paul@privatestorage.io" , "letsEncryptAdminEmail": "jean-paul@privatestorage.io"
, "allowedChargeOrigins": [ , "allowedChargeOrigins": [
"https://privatestorage.io" "https://private.storage"
, "https://www.privatestorage.io"
, "https://private.storage"
, "https://www.private.storage"
] ]
, "monitoringGoogleOAuthClientID": "802959152038-klpkk38sfnqmknn1ucg7pvs4hcc2k8ae.apps.googleusercontent.com" , "monitoringGoogleOAuthClientID": "802959152038-klpkk38sfnqmknn1ucg7pvs4hcc2k8ae.apps.googleusercontent.com"
} }
# See morph/grid/local/grid.nix for additional commentary. # See morph/grid/local/grid.nix for additional commentary.
let let
pkgs = import <nixpkgs> { };
gridlib = import ../../lib; gridlib = import ../../lib;
grid-config = pkgs.lib.trivial.importJSON ./config.json; grid-config = builtins.fromJSON (builtins.readFile ./config.json);
# Module with per-grid configuration # Module with per-grid configuration
grid-module = {config, ...}: { grid-module = {config, ...}: {
...@@ -21,6 +19,7 @@ let ...@@ -21,6 +19,7 @@ let
grid = { grid = {
publicKeyPath = toString ./. + "/${grid-config.publicKeyPath}"; publicKeyPath = toString ./. + "/${grid-config.publicKeyPath}";
privateKeyPath = toString ./. + "/${grid-config.privateKeyPath}"; privateKeyPath = toString ./. + "/${grid-config.privateKeyPath}";
inherit (grid-config) monitoringvpnEndpoint letsEncryptAdminEmail;
}; };
# Configure deployment management authorization for all systems in the grid. # Configure deployment management authorization for all systems in the grid.
services.private-storage.deployment = { services.private-storage.deployment = {
...@@ -33,32 +32,38 @@ let ...@@ -33,32 +32,38 @@ let
imports = [ imports = [
gridlib.issuer gridlib.issuer
gridlib.hardware-aws gridlib.hardware-aws
(gridlib.customize-issuer (grid-config // {
monitoringvpnIPv4 = "172.23.23.11";
}))
grid-module grid-module
]; ];
config = {
grid.monitoringvpnIPv4 = "172.23.23.11";
grid.issuer = {
inherit (grid-config) issuerDomains allowedChargeOrigins;
};
};
}; };
monitoring = { monitoring = {
imports = [ imports = [
gridlib.monitoring gridlib.monitoring
gridlib.hardware-aws gridlib.hardware-aws
(gridlib.customize-monitoring {
inherit hostsMap vpnClientIPs nodeExporterTargets paymentExporterTargets;
inherit (grid-config) letsEncryptAdminEmail;
googleOAuthClientID = grid-config.monitoringGoogleOAuthClientID;
monitoringvpnIPv4 = "172.23.23.1";
stateVersion = "19.09";
})
grid-module grid-module
]; ];
config = {
grid.monitoringvpnIPv4 = "172.23.23.1";
grid.monitoring = {
inherit paymentExporterTargets blackboxExporterHttpsTargets;
inherit (grid-config) monitoringDomains;
googleOAuthClientID = grid-config.monitoringGoogleOAuthClientID;
enableZulipAlert = true;
};
system.stateVersion = "19.09";
};
}; };
defineStorageNode = name: { vpnIP, stateVersion }: defineStorageNode = name: { vpnIP, stateVersion }:
let let
nodecfg = import "${./.}/${name}-config.nix"; nodecfg = import (./. + "/${name}-config.nix");
hardware ="${./.}/${name}-hardware.nix"; hardware = (./. + "/${name}-hardware.nix");
in { in {
imports = [ imports = [
# Get some of the very lowest-level system configuration for this # Get some of the very lowest-level system configuration for this
...@@ -69,24 +74,33 @@ let ...@@ -69,24 +74,33 @@ let
# Slightly awkwardly, enable some of our hardware / network / bootloader options. # Slightly awkwardly, enable some of our hardware / network / bootloader options.
../../../nixos/modules/100tb.nix ../../../nixos/modules/100tb.nix
# At least some of our storage nodes utilize MegaRAID storage controllers.
# Monitor their array status.
../../../nixos/modules/monitoring/exporters/megacli2prom.nix
# Get all of the configuration that is common across all storage nodes. # Get all of the configuration that is common across all storage nodes.
gridlib.storage gridlib.storage
# Then customize the storage system a little bit based on this node's particulars.
(gridlib.customize-storage (grid-config // nodecfg // {
monitoringvpnIPv4 = vpnIP;
inherit stateVersion;
}))
# Also configure deployment management authorization # Also configure deployment management authorization
grid-module grid-module
]; ];
config = {
grid.monitoringvpnIPv4 = vpnIP;
grid.storage = {
inherit (grid-config) passValue publicStoragePort;
};
system.stateVersion = stateVersion;
# And supply configuration for those hardware / network / bootloader # And supply configuration for those hardware / network / bootloader
# options. See the 100tb module for handling of this value. The module # options. See the 100tb module for handling of this value. The module
# name is quoted because `1` makes `100tb` look an awful lot like a # name is quoted because `1` makes `100tb` look an awful lot like a
# number. # number.
"100tb".config = nodecfg; "100tb".config = nodecfg;
# Enable statistics gathering for MegaRAID cards.
# TODO would be nice to enable only on machines that have such a device.
services.private-storage.monitoring.exporters.megacli2prom.enable = true;
};
}; };
# Define all of the storage nodes for this grid. # Define all of the storage nodes for this grid.
...@@ -98,38 +112,22 @@ let ...@@ -98,38 +112,22 @@ let
storage005 = { vpnIP = "172.23.23.25"; stateVersion = "19.03"; }; storage005 = { vpnIP = "172.23.23.25"; stateVersion = "19.03"; };
}; };
# TBD: derive these automatically: paymentExporterTargets = [ "payments.monitoringvpn" ];
hostsMap = { blackboxExporterHttpsTargets = [
"172.23.23.1" = [ "monitoring" "monitoring.monitoringvpn" ]; "https://private.storage/"
"172.23.23.11" = [ "payments" "payments.monitoringvpn" ]; "https://www.private.storage/"
"172.23.23.21" = [ "storage001" "storage001.monitoringvpn" ]; "https://privatestorage.io/"
"172.23.23.22" = [ "storage002" "storage002.monitoringvpn" ]; "https://www.privatestorage.io/"
"172.23.23.23" = [ "storage003" "storage003.monitoringvpn" ]; "https://payments.private.storage/"
"172.23.23.24" = [ "storage004" "storage004.monitoringvpn" ]; "https://payments.privatestorage.io/"
"172.23.23.25" = [ "storage005" "storage005.monitoringvpn" ]; "https://monitoring.private.storage/"
}; "https://monitoring.privatestorage.io/"
vpnClientIPs = [
"172.23.23.11"
"172.23.23.21"
"172.23.23.22"
"172.23.23.23"
"172.23.23.24"
"172.23.23.25"
];
nodeExporterTargets = [
"monitoring"
"payments"
"storage001"
"storage002"
"storage003"
"storage004"
"storage005"
]; ];
paymentExporterTargets = [ "payments" ];
in { in {
network = { network = {
description = "PrivateStorage.io Production Grid"; description = "PrivateStorage.io Production Grid";
inherit (gridlib) pkgs;
}; };
inherit payments; inherit payments;
inherit monitoring; inherit monitoring;
......
gye1flhy@gye1flhy.repo.borgbase.com:repo
l4642x1g@l4642x1g.repo.borgbase.com:repo
c7400xl6@c7400xl6.repo.borgbase.com:repo
sbn13vf8@sbn13vf8.repo.borgbase.com:repo
wg8x4po7@wg8x4po7.repo.borgbase.com:repo
let key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGN4VQm3BIQKEFTw6aPrEwNuShf640N+Py2LOKznFCRT exarkun@bottom"; let
in { "root" = key; "jcalderone" = key; } flo = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII6EUU/KNDr7y3m5OVWBZAuPiMJ4us3YOBEhxpG29yPN flo@la"];
last-resort = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE1hy9mPkJI+7mY2Uq6CLpuFMMLOTfiY2sRJHwpihgRt cardno:26 269 859 - Last Resort A-Key"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJPYMUVNuWr2y+FL1GxW6S6jb3BWYhbzJ2zhvQVKu2ll cardno:23 845 763 - Last Resort C-key"
];
in {
"root" = flo ++ last-resort;
inherit flo last-resort;
}
# Do not modify this file! It was generated by ‘nixos-generate-config’ # NixOS configuration specific to this node
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
...@@ -12,7 +10,7 @@ ...@@ -12,7 +10,7 @@
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernel.sysctl = { "vm.swappiness" = 0; }; boot.kernel.sysctl = { "vm.swappiness" = 1; };
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/f72c1f46-6723-45bf-9ef7-92f31cc37589"; { device = "/dev/disk/by-uuid/f72c1f46-6723-45bf-9ef7-92f31cc37589";
...@@ -38,6 +36,6 @@ ...@@ -38,6 +36,6 @@
} ]; } ];
nix.maxJobs = lib.mkDefault 24; nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }
# Do not modify this file! It was generated by ‘nixos-generate-config’ # NixOS configuration specific to this node
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
{ {
...@@ -12,7 +10,7 @@ ...@@ -12,7 +10,7 @@
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.kernel.sysctl = { "vm.swappiness" = 0; }; boot.kernel.sysctl = { "vm.swappiness" = 1; };
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/0e92ada9-effb-42e2-a26a-9cdb529bcdc7"; { device = "/dev/disk/by-uuid/0e92ada9-effb-42e2-a26a-9cdb529bcdc7";
...@@ -37,6 +35,6 @@ ...@@ -37,6 +35,6 @@
randomEncryption = true; randomEncryption = true;
} ]; } ];
nix.maxJobs = lib.mkDefault 24; nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }
# Do not modify this file! It was generated by ‘nixos-generate-config’ # NixOS configuration specific to this node
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
...@@ -13,7 +11,7 @@ ...@@ -13,7 +11,7 @@
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
boot.kernel.sysctl = { "vm.swappiness" = 0; }; boot.kernel.sysctl = { "vm.swappiness" = 1; };
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/240fc1f6-cd55-48a3-ac80-5b3550a32ef5"; { device = "/dev/disk/by-uuid/240fc1f6-cd55-48a3-ac80-5b3550a32ef5";
...@@ -38,6 +36,6 @@ ...@@ -38,6 +36,6 @@
randomEncryption = true; randomEncryption = true;
} ]; } ];
nix.maxJobs = lib.mkDefault 24; nix.settings.max-jobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
} }