Skip to content

Instantly share code, notes, and snippets.

import "time"
# Check if today is a weekday (Mon–Fri)
is_weekday = rule {
weekday = time.weekday(time.now())
weekday >= 1 and weekday <= 5
}
# Check if current hour is between 9 and 17 (9 AM to 5 PM)
is_business_hours = rule {
@jruels
jruels / azure-tf-vnet.md
Created July 18, 2025 16:40
Terraform code to provision Azure networking resources

Lab Exercise: Automating Network Deployment with Terraform


Lab Overview

In this final lab, you will use Terraform to automate the creation of a VNet and subnet as IaC, building on previous concepts for repeatable deployments.


@jruels
jruels / argo-getting-started.md
Last active December 14, 2023 19:38
Getting Started with Argo CD

GitOps with ArgoCD

Argo CD is an open-source GitOps continuous delivery tool. It monitors your cluster and your declaratively-defined infrastructure stored in a Git repository and resolves differences between the two — effectively automating an application deployment.

In this lab you will:

  • Create an all-in-one Kubernetes cluster on the Ubuntu VM
  • Install kubectl
  • Deploy Argo CD
  • Configure Argo to monitor a GitHub project

Creating a GitHub Personal Access Token

  1. Go to your GitHub profile and click on Settings.
  2. In the left sidebar, click on Developer settings.
  3. Click on Personal access tokens.
  4. Click on Generate new token.
  5. Give the token a descriptive name.
  6. Select the scopes you need for the token (e.g., repo, read:user, user:email).
  7. Click on Generate token.
  8. Copy the token to your clipboard.
@jruels
jruels / nodejs.yaml
Created July 12, 2022 21:07
Helm-microservices-templates nodejs
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecsdemo-nodejs
labels:
app: ecsdemo-nodejs
namespace: default
spec:
replicas: {{ .Values.replicas }}
selector:
@jruels
jruels / crystal.yaml
Created July 12, 2022 21:06
Helm-microservices-templates crystal
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecsdemo-crystal
labels:
app: ecsdemo-crystal
namespace: default
spec:
replicas: {{ .Values.replicas }}
selector:
@jruels
jruels / frontend.yaml
Last active July 12, 2022 21:10
Helm-microservice-frontend
apiVersion: apps/v1
kind: Deployment
metadata:
name: ecsdemo-frontend
labels:
app: ecsdemo-frontend
namespace: default
spec:
replicas: {{ .Values.replicas }}
selector:
@jruels
jruels / apkfilter.js
Created May 30, 2020 19:21
Profanity filter
!function(e){var t={};function i(s){if(t[s])return t[s].exports;var o=t[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,s){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(s,o,function(t){return e[t]}.bind(null,o));return s},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)}([function(e,t,i){"use strict";function s(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,co

To create a Kops cluster

Install AWSCLI

pip install awscli

Add to path

export PATH=~/.local/bin:$PATH
@jruels
jruels / install-dashboard.md
Created February 12, 2019 23:35
Install Kubernetes Dashboard

Kubeadm expose Dashboard

Deploy dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

List tokens

Confirm a kubernetes-dashboard service account token was created