1
0
Fork 0
Commit Graph

705 Commits (9e3ca9c84108453dd958b365eaf56a797832a6bb)

Author SHA1 Message Date
q3k f3dd382eed Merge "app/gerrit: fix advertised address" 2019-07-21 13:38:40 +00:00
q3k 9b5359d0f4 app/gerrit: fix advertised address
This should get rid of some :29418 ports publically visible.

Change-Id: Ied3114888ccfdea494580d19e04d88a847d96cfe
2019-07-21 15:38:21 +02:00
q3k 2da126caff go/svc/leasifier, proto/hswaw -> hswaw/
Continued from https://gerrit.hackerspace.pl/c/hscloud/+/73 .

Change-Id: Ie761c2af588e06739de94fa1eff4f715d1f9b145
2019-07-21 15:36:27 +02:00
q3k cea71e3be8 go/svc/{invoice,speedtest} -> bgpwtf/
Continued from https://gerrit.hackerspace.pl/c/hscloud/+/71 .

Change-Id: I5aef587c7e9a4cec301e3c95530c33914851ad44
2019-07-21 15:30:08 +02:00
Robert Gerus f1bdb9a984 Fix the shebang.
First step on the path of making bazel work here on NixOS.

Change-Id: Icc264dac250e116f4835a135f47423740a2e5096
2019-07-21 15:24:52 +02:00
q3k 61594bb088 go/svc/(dc stuff) -> dc/
We want to start keeping codebases separated per 'team'/intent, to then
have simple OWNER files/trees to specify review rules.

This means dc/ stuff can all be OWNED by q3k, and review will only
involve a +1 for style/readability, instead  of a +2 for approval.

Change-Id: I05afbc4e1018944b841ec0d88cd24cc95bec8bf1
2019-07-21 15:20:51 +02:00
q3k 96a528b2c9 personal/q3k: add django-admin
Also add Django and uwsgi to requirements, and bump rules_pip to fix https://github.com/apt-itude/rules_pip/issues/14

Change-Id: I78eb3af019897c4c9630987649a9ffacd979145c
2019-07-21 15:11:18 +02:00
q3k e653e6a620 bgpwtf/cccampix/peeringdb: init
First pass at a proxy to expose PeeringDB data.

Change-Id: I844973755473b3abc5d334586744004b86d1c3a3
2019-07-20 18:03:35 +02:00
q3k 57be3f7c40 bgpwtf/cccampix: init
Add sync script for camp IX.

This will likely be triggered externally from some sort of long-running
service.

Change-Id: I4ead566e4308d24fdb64e789a7ca0e3dbf0214fb
2019-07-19 21:05:15 +02:00
q3k ebee511732 pip/requirements: add requests
Change-Id: Ie213a2a3bf618fd03cf802e4aed76c69de0f1cd5
2019-07-19 20:54:50 +02:00
q3k d5ac5d112f WORKSPACE: bump rules_pip
Change-Id: I8e5ed9ab7743a71de0c216fa425fe2ecb1bbca81
2019-07-19 20:53:21 +02:00
Serge Bazanski 2ce367681a *: move away from python_rules
python_rules is completely broken when it comes to py2/py3 support.

Here, we replace it with native python rules from new Bazel versions [1] and rules_pip for PyPI dependencies [2].

rules_pip is somewhat little known and experimental, but it seems to work much better than what we had previously.

We also unpin rules_docker and fix .bazelrc to force Bazel into Python 2 mode - hopefully, this repo will now work
fine under operating systems where `python` is python2 (as the standard dictates).

[1] - https://docs.bazel.build/versions/master/be/python.html

[2] - https://github.com/apt-itude/rules_pip

Change-Id: Ibd969a4266db564bf86e9c96275deffb9610dd44
2019-07-16 22:22:05 +00:00
Serge Bazanski 38aea81f64 bzl/rules.bzl: fix incompatibilities
Counteracts:

 - --incompatible_depset_is_not_iterable=false
 - --incompatible_new_actions_api=false

Change-Id: Ib0e63b717f643e4e3b57684b53d3165d5925daac
2019-07-16 22:21:55 +00:00
q3k 838cf6526a go/svc: finish porting services to Bazel
The following services were never ported:
 - cmc-proxy
 - arista-proxy
 - m6220-proxy
 - topo

They now build.

Change-Id: I0688bfe43cdff946e6662e21969ef539382c0e86
2019-07-16 23:31:25 +02:00
q3k 3e21233b14 go/svc/speedtest: prod deploy
This is deployed on https://speedtest.hackerspace.pl/

Change-Id: I510d98535ae64d13e745613c49acf96b4d7e90c9
2019-07-13 18:11:11 +02:00
q3k b4f6fb3c3b app/registry: allow inf and q3k to push to app/* and go/svc/*
We have quite a bit of them at this point, and we're likely going to use
app/* and go/svc/* for 'core' services only anyway.

Change-Id: Ic315fbd2d672e525439992bfcd9ead730d1a1b71
2019-07-13 17:13:09 +02:00
q3k f448f99385 go/svc/speedtest: bazelify
Change-Id: If83422929432a316c11e25c7dda68d8172f25167
2019-07-13 16:28:14 +02:00
q3k a51df9c2ab go/svc/speedtest: init from github.com/q3k/speedtest
commit: 6109ea9470199468120836d1fb1c89cac7667d86
Change-Id: If93617b3b8f0ac5bc548ab81a6801e464a03143d
2019-07-13 16:17:05 +02:00
q3k 1cace13396 WORKSPACE: bump rules_go
This fixes builds with new Bazel (--incompatible_require_ctx_in_configure_features)

Change-Id: I62498a121cd8c5bac8d4e942d6f13e2f733c438e
2019-07-13 16:17:05 +02:00
q3k 4343e9289e Merge "app/internet: initialize with landing page" 2019-07-09 11:24:28 +00:00
q3k 94f8dbf347 app/internet: initialize with landing page
This is already rolled out at https://internet.hackerspace.pl/.

Change-Id: Ibebaeb830a4b58cecfc1ecbf63d07cc63ded7e2b
2019-07-09 13:03:30 +02:00
q3k 0ef497e461 Merge "app/registry: abstract away pushers" 2019-07-09 10:39:40 +00:00
q3k c292410d15 app/factorio: update to 0.17.52
Change-Id: I70230b1f83a40cc70015e135e25319116c6e15e8
2019-06-30 17:35:57 +02:00
q3k 92be486f39 Revert "cluster/kube/lib/nginx: use Local traffic policy"
This reverts commit 09a0f06d2a.

Reason for revert: prevents registry from being accessible on nodes:

q3k@anathema ~/Software/hscloud $ curl registry.k0.hswaw.net
<html>
[..., ok]

[root@bc01n03:~]# curl registry.k0.hswaw.net
^C

Change-Id: I0da97aaf7a8791ea3f62c70b6c1502f4a48a300f
2019-06-29 22:58:19 +00:00
q3k 1c825949c4 app/registry: abstract away pushers
Another change I lost somewhere in the process of remembering how to
gerrit.

I rewrote it (lost the original commit), and also added the (upcoming)
egressifier service.

Change-Id: I1647bc3b1e504a192150ab76f4c6d1709e608f0a
2019-06-30 00:37:34 +02:00
q3k 09a0f06d2a cluster/kube/lib/nginx: use Local traffic policy
Diff against prod:

  - live services nginx-system.ingress-nginx
  + config services nginx-system.ingress-nginx
    {
      "apiVersion": "v1",
      "kind": "Service",
      "metadata": {
        "annotations": {},
        "labels": {
          "app.kubernetes.io/name": "ingress-nginx",
          "app.kubernetes.io/part-of": "ingress-nginx"
        },
        "name": "ingress-nginx",
        "namespace": "nginx-system"
      },
      "spec": {
  -     "externalTrafficPolicy": "Cluster",
  +     "externalTrafficPolicy": "Local",
        "ports": [
          {
            "name": "ssh",
            "port": 22,
            "protocol": "TCP",
            "targetPort": 22
          },
          {
            "name": "http",
            "port": 80,
            "protocol": "TCP",
            "targetPort": 80
          },
          {
            "name": "https",
            "port": 443,
            "protocol": "TCP",
            "targetPort": 443
          }
        ],
        "selector": {
          "app.kubernetes.io/name": "ingress-nginx",
          "app.kubernetes.io/part-of": "ingress-nginx"
        },
        "type": "LoadBalancer"
      }
    }

Change-Id: I0dd66e3f1643efa975d6180cc163a265d4b484ef
2019-06-29 22:44:53 +02:00
q3k 543b412a65 cluster/kube/lib/nginx: add gerrit forwarding
This is already running in production since gerrit was deployed - it
just got lost during submit.

Change-Id: I8a1580b1ca3ec3142a8fa4320dc9f51a599a914f
2019-06-29 22:42:39 +02:00
q3k 59f5fd315c cluster/openssl.cnf: remove
This was used in the old openssl-based TLS certificate generation code.

Change-Id: I5da8c5b012b6af8c2f8b990237b3c4933b90a349
2019-06-25 15:02:45 +02:00
q3k 1e5e81227a Merge changes I4ef1f6ed,I20b0ecbb,Ida9dff72,I92e70536
* changes:
  cluster/cube/lib/cockroachdb: clean up topology
  cluster/kube/lib/cockroach: move client to deployment
  app/gerrit/kube: implement
  app/gerrit: import OAuth provider and add SSO support
2019-06-25 00:49:10 +00:00
q3k 184678b0f4 cluster/cube/lib/cockroachdb: clean up topology
IP addresses are not necessary in the topology definitions of a
cockroach cluster.

They were mis-commited leftovers from trying to run the cluster on
DaemonSets with hostNetworking: true.

Change-Id: I4ef1f6ed9a745efc6b05846bc13aba9d1f8dc7c8
2019-06-22 21:18:29 +00:00
q3k dec401c7dd cluster/kube/lib/cockroach: move client to deployment
This prevents a bug where kubecfg fails to update the client pod when
running a cluster/kube/cluster.jsonnet update. The pod update is
attempted because of runtime/intent differences at serviceAccounts
specification, which causes kubecfg to see a diff, which causes it to
attempt and update, which causes kube-apiserver to reject the change
(because pods are immutable), which causes kubecfg to fail.

Change-Id: I20b0ecbb264213a2eb483d475c7683b4965c82be
2019-06-22 23:14:25 +02:00
q3k b094f08744 tools/: add __pycache__ to gitignore
Change-Id: Iaddfe140df1e82611df8e2594b7560e3bdafd896
2019-06-21 22:14:41 +02:00
q3k a7e26ccfe1 app/gerrit/kube: implement
This change impelements the k8s machinery for Gerrit.

This might look somewhat complex at first, but the gist of it is:

 - k8s mounts etc, git, cache, db, index as RW PVs
 - k8s mounts a configmap containing gerrit.conf into an external
   directory
 - k8s mounts a secret containing secure.conf into an external directory
 - on startup, gerrit's entrypoint will copy over {gerrit,secure}.conf
   and start a small updater script that copies over gerrit.conf if
   there's any change. This should, in theory, make gerrit reload its
   config.

This is already running on production. You're probably looking at this
change through the instance deployed by itself :)

Change-Id: Ida9dff721c17cf4da7fb6ccbb54d2c4024672572
2019-06-21 20:47:53 +02:00
q3k 573da78859 app/gerrit: import OAuth provider and add SSO support
This change:

 - imports gerrit-oauth-provider from upstream
 - adds sso.hackerspae.pl support to it

Change-Id: I92e7053614a9297bf1ced3aac044c0002acd836a
2019-06-21 20:09:01 +02:00
q3k c7258f4644 cluster/kube: refactor, add crdb-waw1 2019-06-21 00:24:09 +02:00
q3k e53e39a8be cluster/kube/lib/cockroachdb: use manual node pinning
We move away from the StatefulSet based deployment to manually starting
a deployment per intended node. This allows us to pin indivisual
instances of Cockroach to particular nodes, so that they state
co-located with their data.
2019-06-20 23:36:35 +02:00
q3k 662a3cdcca cluster/kube/lib/cockroachdb: refactor
We refactor this library to:

 - support multiple databases, but with a strong suggestion of having
   one per k8s cluster
 - drop the database creation logic
 - redo naming (allowing for two options: multiple clusters per
   namespace or an exclusive namespace for the cluster)
 - unhardcode dns names
2019-06-20 19:45:03 +02:00
q3k 224a50bbfe cluster/kube/lib/cockroach: fix imports 2019-06-20 16:43:01 +02:00
q3k 3c117fa841 make cockroachdb into a cluster service 2019-06-20 16:43:01 +02:00
Patryk Jakuszew fae3a9d514 add grace period for client pod, rename volume mounts 2019-06-20 16:43:01 +02:00
Patryk Jakuszew 5dfd4cc799 initial commit of cockroachdb.libsonnet 2019-06-20 16:43:01 +02:00
q3k c3b0f7627c cluster/kube: set operator replicas to 0 2019-06-20 16:42:19 +02:00
q3k c0fc3ee442 cluster/clustercfg: add clustercfg-nocerts 2019-06-20 16:11:38 +02:00
q3k bc27e64692 go/svc/invoice: template changes for EU VAT invoices, restore FV/ numbering 2019-06-20 16:11:07 +02:00
q3k 0de4368f5c nix/cluster-configuration: mention CNI plugin issue 2019-06-20 12:55:02 +02:00
q3k 9d6929f7c0 app/radio: fix fallback mounts, fix admin login 2019-06-20 12:52:38 +02:00
q3k f970a7ef0f nix/cluster-configuration: fix CNI plugins being deleted on kubelet restart 2019-06-20 12:51:51 +02:00
q3k c807f86b6a app/radio: lower resource requests and limits 2019-06-19 16:18:28 +02:00
q3k f9281d844f app/radio: add standby 2019-06-19 14:55:11 +02:00
q3k 610bec40a2 app/radio: init 2019-06-19 14:31:19 +02:00