Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dbones
Last active July 4, 2022 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbones/05eac8002abfe3fe781063fd4e7f7fbc to your computer and use it in GitHub Desktop.
Save dbones/05eac8002abfe3fe781063fd4e7f7fbc to your computer and use it in GitHub Desktop.
# /org
# dbones-labs.yaml
#
# /platform-services
# github.yaml
# rancher.yaml
# discord.yaml
#
# /users
# dbones.yaml
# bob.yaml
# sammi.yaml
#
# /tenencies
# platform.yaml
# galaxy.yaml
# open-sourcerors.yaml
#
# /zones
# apex.yaml
# frontier.yaml
# /tenency-galaxy
# /members
# dbones.yaml
# /services
# billing.yaml
# /libraries
# core.yaml
# /tenency-open-sourcerors
# /members
# dbones.yaml
# sammi.yaml
# /libraries
# auditable.yaml
# /zone-frontier this is production
# cluster-aqua.yaml
# postgres-spike.yaml
# postgres-goku.yaml
# rabbitmq-asuna.yaml
# /zone-apex this is development
# cluster-saber.yaml
# postgres-kirito.yaml
# rabbitmq-levi.yaml
---
apiVersion: lab.dev/v1
kind: Organisation
metadata:
name: dbones-labs
namespace: lab # sets the org namespace
labels:
lab.dev/verison: 1
spec:
service:
retainFor: 300 # in seconds, default is 1 week
---
# =========================================================
# platform services
# =========================================================
# this that are setup before hand
apiVersion: lab.dev/v1
kind: Github
metadata:
name: github
namespace: lab
labels:
lab.dev/verison: 1
spec:
org: platform
visibility: internal
globalTeam: in-the-lab
credentials: github-account
archive: true
# github acc to call its api's with
# need one for Rancher, Vault, RabbitMq, Discord, etc
---
apiVersion: lab.dev/v1
kind: Discord
metadata:
name: discord
namespace: lab
labels:
lab.dev/verison: 1
spec:
guild: 123412432432
credentials: discord-account
---
apiVersion: lab.dev/v1
kind: Rancher
metadata:
name: rancher
namespace: lab
labels:
lab.dev/verison: 1
spec:
credentials: rancher-account
---
# =========================================================
# users
# =========================================================
apiVersion: lab.dev/v1
kind: user
metadata:
name: dbones
namespace: lab
labels:
lab.dev/verison: 1
spec:
github: d_bones
discord: 726638408860172328
# each user/login, we will need to keep some ids for different accounts (which they create)
# the scripts will create rancher, databases, vault, etc
---
# =========================================================
# zones clusters and shared services
# =========================================================
# /frontier
# cluster-aqua.yaml
# postgres-spike.yaml
# postgres-goku.yaml
# rabbitmq-asuna.yaml
apiVersion: lab.dev/v1
kind: zone
metadata:
name: frontier
namespace: lab
labels:
lab.dev/verison: 1
spec:
environment: production #development , or custom
---
# clusters represent pockets of compute, controlled by rancher
# the cluster will be stood up before this
# rancher local is the cluster-local, and does not need to be created.
apiVersion: lab.dev/v1
kind: cluster
metadata:
name: aqua
namespace: zone-frontier
labels:
lab.dev/verison: 1
---
apiVersion: lab.dev/v1
kind: postgres
metadata:
name: postgres-spike
namespace: zone-frontier
labels:
lab.dev/verison: 1
spec:
credentials: postgres-spike
---
apiVersion: lab.dev/v1
kind: rabbitmq
metadata:
name: rabbitmq-asuna
namespace: zone-frontier
labels:
lab.dev/verison: 1
spec:
credentials: rabbitmq-asuna
---
# =========================================================
# Tenencies
# =========================================================
apiVersion: lab.dev/v1
kind: tenancy
metadata:
name: galaxy
namespace: lab
labels:
lab.dev/verison: 1
lab.dev/owner: dbones
spec:
isPlatform: true # signals this is a platform team
clusterFilter: regex-of-allowed-clusters # default all
# setup Rancher Project, Github Team, Postgres Roles, Discord
# rabbit does not seem to care
---
apiVersion: lab.dev/v1
kind: member
metadata:
name: member-platform-dbones
namespace: tenency-platform
labels:
lab.dev/verison: 1
spec:
tenancy: platform
user: dbones
role: owner # member, owner, guest
# Github Team update, postgres roles, rabbitmq
---
# =========================================================
# services and libraries
# =========================================================
apiVersion: lab.dev/v1
kind: service
metadata:
name: billing
namespace: galaxy
labels:
lab.dev/verison: 1
spec:
zones:
- name: frontier
postgres: postgres-spike
rabbit: rabbitmq-asuna
- name: zone-apex
# entries here.
github: internal # public and private
# Github repo and add to Team, postgres roles/db, rabbitmq login
# note that state items should not delete their state directly
# we may be moving ownership (git, postgres, rabbit, vault etc should wait for x days)
---
apiVersion: lab.dev/v1
kind: library
metadata:
name: auditable
namespace: libraries
labels:
lab.dev/verison: 1
spec:
github: internal
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment