Skip to content

Instantly share code, notes, and snippets.

@xrl
xrl / deploying_on_ovh.md
Created December 12, 2016 08:25
Deploying DCOS on OVH

OVH is a decent host -- cheap, large-scale hardware. Around 1/5 the cost of the big guys, without the polished API or slick experience (and none of the live migration of bad instances).

Let's run DCOS on OVH!

You'll need 3 instances:

  1. The 'agent' or heavy lifting host
  2. The 'master' or coordinating host
  3. The 'bootstrapping' or dumb-file-serving host
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/bootstrap-os/tasks/bootstrap-ubuntu.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/bootstrap-os/tasks/bootstrap-coreos.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/bootstrap-os/tasks/bootstrap-centos.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/bootstrap-os/tasks/setup-pipelining.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/kubernetes/preinstall/tasks/pre-upgrade.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/kubernetes/preinstall/tasks/gitinfos.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/kubernetes/preinstall/tasks/set_facts.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/kubernetes/preinstall/tasks/set_resolv_facts.yml
statically included: /Users/xlange/code/viasat/itsec-kube/kargo-deuce/roles/kube
This file has been truncated, but you can view the full file.
LP-XLANGE-OSX:kubernetes xlange$ ./hack/godep-save.sh
+ set -o errexit
+ set -o nounset
+ set -o pipefail
++ dirname ./hack/godep-save.sh
+ KUBE_ROOT=./hack/..
+ source ./hack/../hack/lib/init.sh
++ set -o errexit
++ set -o nounset
#[bench]
fn parse_file(b: &mut Bencher) {
use std::fs::{ File };
use std::io::{ Seek, SeekFrom };
let mut f = File::open("/Users/xlange/30ece7c43b7c302f43e54ac9f299ca36efb8184375eac0563c9340a15100ee3c-json.log").unwrap();
b.iter(|| {
{
use std::io::{BufRead, BufReader};
/Users/xlange/.cargo/bin/cargo test --color=always -- --nocapture
Compiling whaletail v0.1.0 (file:///Users/xlange/IdeaProjects/whale-tail)
warning: unused import: `test::Bencher`
--> src/lib.rs:22:9
|
22 | use test::Bencher;
| ^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default
LP-XLANGE-OSX:tmp xlange$ echo "hi" >> deleteme/file.1
@xrl
xrl / kops-formula.rb
Created January 18, 2018 20:10
kops formula for vpc connections
class Kops < Formula
desc "Production Grade K8s Installation, Upgrades, and Management"
homepage "https://github.com/kubernetes/kops"
url "https://github.com/kubernetes/kops/archive/1.7.1.tar.gz"
sha256 "044c5c7a737ed3acf53517e64bb27d3da8f7517d2914df89efeeaf84bc8a722a"
head "https://github.com/tureus/kops.git", :revision => "1.6.2-allow-no-igw"
# head "https://github.com/k8s-for-greeks/kops.git", :revision => "k8s-for-greeks-integration"
bottle do
cellar :any_skip_relocation
@xrl
xrl / audit.py
Created February 22, 2019 01:34
#!/usr/bin/env python
import json
import subprocess
import pprint
###
### Compare the EC2 state with that state of pods in your kube cluster
### Loads from EC2 with the awscli and loads from kube with kubectl
###
@xrl
xrl / lease.rs
Created July 30, 2021 20:58
Using rust kube-rs to check, poll, and renew advisory locks in Kubernetes
use k8s_openapi::api::coordination::v1::{Lease as KubeLease, LeaseSpec as KubeLeaseSpec};
use chrono::{Local, Utc};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime;
use std::time::Duration;
use kube::api::{PatchParams, PostParams, ObjectMeta};
use kube::Api;
use tokio::task::JoinHandle;
use tokio::sync::oneshot::Sender;
const LEASE_DURATION_SECONDS: u64 = 5;
// FROM /opt/homebrew/include/rdkit/GraphMol/ROMol.h
//
// Copyright (C) 2003-2022 Greg Landrum and other RDKit contributors
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//