GithubHelp home page GithubHelp logo

isabella232 / try.spinnaker.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from spinnaker/try.spinnaker.io

0.0 0.0 0.0 201 KB

Spinnaker Playground ๐ŸŒŠ๐Ÿ„

Shell 58.36% HCL 36.62% Open Policy Agent 1.03% Mustache 3.99%

try.spinnaker.io's Introduction

try.spinnaker.io

try.spinnaker.io is a hosted playground version of Spinnaker aimed for new users to test out its UI and core features.

Features

  • IaC via Terraform to host try.spinnaker.io on AWS using an EKS cluster
  • Deployment of Spinnaker via Armory's OOS Spinnaker Operator
  • Kubernetes deployment via Spinnaker
  • AWS Load Balancer Controller to expose deployments
  • User authentication via Google OAuth 2.0
  • Private ECR registry
  • Block all public images via portieris
  • Script to deploy default pipelines
    • Auto resource cleanup
    • Deploy demo web app
    • Deploy using highlander strategy
  • Authz rules via a Spinnaker plugin, adds default role 'public' to all users
  • Metrics(wip)

Requirements

Configuration

Terraform

Edit the values region, route53_zone, and domain_name in terraform/variables.tf. Note: domain_name must be a subdomain of route53_zone, i.e. if route53_zone = spinnaker.io then domain_name = try.spinnaker.io.

Spinnaker Operator

Files are inside the spinnaker-kustomize-patches folder.

File Name Description
kustomization.yml Main kustomize file.
spinnakerservice.yml Contains configuration for Spinnaker.

Update spec.spinnakerConfig.config.version to the version of OOS Spinnaker you wish to deploy.

Update the value of https://try.gsoc.armory.io in spec.spinnakerConfig.config.*.apiSecurity.overrideBaseUrl to your DNS name.
security/patch-file-authz.yml Update users.username to the admin email you will login with Google OAuth in spec.spinnakerConfig.files.rolemappings.yml
security/patch-google.yml Update spec.spinnakerConfig.config.security.authn.client.clientId to your Google OAuth 2.0 Client ID.

Create a file called spinnaker-kustomize-patches/secrets/secrets.env and add your Secret ID to the file in in this format oauth-client-secret=fakepassword123
accounts/docker/patch-ecr.yml Update spec.spinnakerConfig.providers.dockerRegistry.accounts.address to the address of your ECR registry.

Deploy Infrastructure + Code

Run these commands in the terraform folder.

terraform init
terraform plan
terraform apply

Inject Default Pipelines

  • Install spin, a cli tool for Spinnnaker.
  • Copy the file scripts/oauth to ~/.spin/oauth
  • Modify Gate.Endpoint, ClientId, and ClientSecret
  • Run script via bash scripts/spin.sh

Teardown Infrastructure

When you are all done then run:

terraform destroy

You may need to go into AWS Web Console to delete dangling load balancers or VPC in the case that Terraform doesn't delete it.

Directory Structure

.
โ”œโ”€โ”€ scripts # Contains helper scripts
โ”‚ย ย  โ”œโ”€โ”€ ecr.sh # Mirrors latest verison of nginx to ECR
โ”‚ย ย  โ”œโ”€โ”€ install-pipelines.sh # Uses spin cli to install pipelines
โ”‚ย ย  โ”œโ”€โ”€ oauth # Sample outh config for spin, used for install-pipelines.sh
โ”‚ย ย  โ”œโ”€โ”€ pipelines # Directory containing pipelines to install
โ”‚ย ย  โ””โ”€โ”€ portieris.sh # Downloads latest portieris release
โ”œโ”€โ”€ spinnaker-kustomize-patches # Patches for Spinnaker Operator 
โ”‚ย ย  โ”œโ”€โ”€ accounts
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ docker
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ patch-ecr.yml # Add private ECR registry
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ kubernetes
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ patch-kube.yml # Add K8S cluster for Spinnaker to deploy to
โ”‚ย ย  โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ spin-sa.yml # K8S service account for Spinnaker 
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ s3
โ”‚ย ย  โ”‚ย ย      โ””โ”€โ”€ patch-s3.yml # Setup persistent storage for Spinnaker 
โ”‚ย ย  โ”œโ”€โ”€ deploy.sh # Deploy Spinnaker via Operator. You can redeploy via `SPIN_FLAVOR=oss ./deploy.sh`
โ”‚ย ย  โ”œโ”€โ”€ kustomization.yml -> recipes/kustomization-try.yml # Softlink to main kustomization file, contains various patches 
โ”‚ย ย  โ”œโ”€โ”€ plugins
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ patch-default-role-plugin.yml # Install github.com/ko28/defaultRolePlugin
โ”‚ย ย  โ”œโ”€โ”€ secrets
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ secrets.env # Local file to store oauth-client-secret
โ”‚ย ย  โ”œโ”€โ”€ security
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ patch-fiat-create-app-roles.yml # Define what roles can access specific apps
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ patch-file-authz.yml # Define fiat roles (admin) for specific users 
โ”‚ย ย  โ””โ”€โ”€ spinnakerservice.yml # Main spinnaker config file, define version and endpoint
โ””โ”€โ”€ terraform # IaC via Terraform
    โ”œโ”€โ”€ main.tf
    โ”œโ”€โ”€ outputs.tf
    โ”œโ”€โ”€ policy # Directory containing IAM and portieris policies 
    โ”œโ”€โ”€ variables.tf
    โ””โ”€โ”€ versions.tf

try.spinnaker.io's People

Contributors

ko28 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.