Git Product home page Git Product logo

seagull-project's Introduction

Project seagull

Project seagullはRyuSAのおうちKubernetesを支えるGitOpsリポジトリです。このリポジトリを起点にArgoCDがクラスターにアプリケーションやミドルウェア、また仮想Kubernetesをデプロイしていきます。

全体像

.
├── cluster # Kubernetesディレクトリ
│   ├── in-cluster # Bootstrap
│   └── ...
│
├── manifests # 全マニフェストディレクトリ
│   └── in-cluster # クラスターごとのマニフェストディレクトリ
│       ├── applications # Bootstrap
│       │   ├── application.yaml
│       │   └── ...
│       ├── argocd
│       │   ├── crds
│       │   └── templates
│       └── ...
│
└── servers # 各サーバーの初期設定スクリプトなど
    └── ...

clusters

clusters配下にはin-clusterクラスターの上で動く仮想Kubernetesの構成情報をGitOpsできるようなマニフェストがセットアップされています。

.
├── cluster # Kubernetesディレクトリ
│   ├── root
│   │   ├── root.yaml # Bootstrap
│   │   └── dev-cluster.yaml
│   ├── dev-cluster
│   │   ├── namespace.yaml
│   │   ├── kubeconfig.yaml
│   │   └── templates

App of Apps Patternで実装してあり、Bootstrap用のcluster/root/root.yamlをArgoCDに喰わせることで各仮想Kubernetesが次々とデプロイされていきます。

接続のための設定はcluster/$CLUSTER_NAME/sealed-cluster.yamlに記述されており、このファイルはrootクラスターにデプロイされているSealedSecretによって暗号化されている状態になってます。

詳細 > 仮想Kubernetes管理

manifests

manifests配下にKubernetesへデプロイするアプリケーション/ミドルウェアの構成情報をGitOpsできるようなマニフェストがセットアップされています。

.
├── manifests
│   ├── dev-cluster
│   │   ├── applications
│   │   │   ├── application.yaml # Bootstrap for dev-cluster
│   │   │   └── speedtest.yaml
│   │   ├── speedtest
│   │   │   ├── templates
│   │   │   └── values
│   │   └── ...
│   │
│   └── in-cluster
│       ├── applications
│       │   ├── application.yaml # Bootstrap for in-cluster
│       │   ├── argocd.yaml
│       │   └── ...
│       ├── argocd
│       │   ├── crds
│       │   ├── templates
│       │   └── values
│       │
│       └── ...

App of Apps Patternで実装してあり、Bootstrap用のmanifests/$CLUSTER_NAME/applications/application.yamlをArgoCDに喰わせることで各Kubernetes上にアプリケーションが次々とデプロイされていきます。

詳細 > マニフェスト管理

初期構築

#############################################
### ArgoCDをデプロイ
#############################################
❯ kubectl apply -f manifests/in-cluster/argocd/namespace.yaml
❯ kubectl apply -f manifests/in-cluster/argocd/crds -f manifests/in-cluster/argocd/templates --recursive -n argocd

#############################################
### SealedSecretが要求するSecretを作成
#############################################

# 名前空間作成
❯ kubectl create namespace "sealed-secrets"

# Secret登録
❯ kubectl -n "sealed-secrets" create secret tls "sealed-secrets-key" --cert="manifests/in-cluster/sealed-secrets/ignore/sealed-secrets.crt" --key="manifests/in-cluster/sealed-secrets/ignore/sealed-secrets.key"
❯ kubectl -n "sealed-secrets" label secret "sealed-secrets-key" sealedsecrets.bitnami.com/sealed-secrets-key=active

#############################################
### Bootstrap Application
#############################################
❯ kubectl apply -f manifests/in-cluster/applications/application.yaml

#############################################
### Bootstrap Cluster
#############################################
❯ kubectl apply -f cluster/root/root.yaml

seagull-project's People

Contributors

ryusa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.