GithubHelp home page GithubHelp logo

chungers / infrakit.gcp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from docker-archive/infrakit.gcp

0.0 2.0 0.0 8.9 MB

Infrakit plugins for Google Cloud Platform.

License: Apache License 2.0

Makefile 3.94% Shell 5.46% Go 90.60%

infrakit.gcp's Introduction

InfraKit.GCP

CircleCI

InfraKit plugins for creating and managing resources in Google Cloud Platform.

Instance plugin

An InfraKit instance plugin which creates Google Compute Engine instances.

Building

To build the instance plugin, run make binaries. The plugin binary will be located at ./build/infrakit-instance-gcp.

Running

${PATH_TO_INFRAKIT}/infrakit-flavor-vanilla
${PATH_TO_INFRAKIT}/infrakit-group-default
./build/infrakit-instance-gcp --project=[GCP_PROJECT] --zone=[GCP_ZONE]

${PATH_TO_INFRAKIT}/infrakit group commit gcp-example-1.json

Project and zone selection

Google Cloud project and zone can be passed on the command line with --project and --zone. In case a value is not provided, the plugin will fallback to:

  • Querying the Metadata server when running on GCE
  • CLOUDSDK_CORE_PROJECT and CLOUDSDK_CORE_ZONE environment variables

Pets versus Cattle

Groups defined with an Allocation/Size will create 'cattle' instances that are fully disposable. When an instance is deleted, a completely new one will be recreated. this new instance will have a different name and a different disk.

Groups defined with an Allocation/LogicalIDs will create 'pet' instances. When an instance is deleted, a new one will be created, with the same name. It will also try to reuse the disk named after the instance if it was not deleted too.

Example configuration

{
  "ID": "gcp-example-1",
  "Properties": {
    "Allocation": {
      "Size": 1
    },
    "Instance": {
      "Plugin": "instance-gcp",
      "Properties": {
        "NamePrefix": "test",
        "Description": "Test of GCP infrakit",
        "Network": "default",
        "Tags": ["tag1", "tag2"],
        "MachineType": "n1-standard-1",
        "Disks":[{
            "Boot": true,
            "SizeGb": 60,
            "Image": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20161205",
            "Type": "pd-standard"
        }],
        "Scopes": [
          "https://www.googleapis.com/auth/cloudruntimeconfig",
          "https://www.googleapis.com/auth/logging.write"
        ]
      }
    },
    "Flavor": {
      "Plugin": "flavor-vanilla",
      "Properties": {
        "Init": [
          "sh -c \"echo 'Hello, World!' > /hello\""
        ]
      }
    }
  }
}

Group plugin

An InfraKit group plugin which wraps Google Compute Engine's managed instance groups.

Building

To build the group plugin, run make binaries. The plugin binary will be located at ./build/infrakit-group-gcp.

Running

${PATH_TO_INFRAKIT}/infrakit-flavor-vanilla
./build/infrakit-instance-gcp --project=[GCP_PROJECT] --zone=[GCP_ZONE] --name=group

${PATH_TO_INFRAKIT}/infrakit group commit gcp-example-2.json

Project and zone selection

Works the same as the instance plugin.

Pets versus Cattle

This plugin supports only pets via Allocation/Size. It doesn't support Allocation/LogicalIDs. This plugin doesn't need an instance plugin since instances are managed directly by GCP.

Example configuration

{
  "ID": "gcp-example-2",
  "Properties": {
    "Allocation": {
      "Size": 2
    },
    "Instance": {
      "Properties": {
        "Description": "Test of GCP infrakit",
        "Network": "default",
        "Tags": ["tag1", "tag2"],
        "MachineType": "n1-standard-1",
        "Disks":[{
            "Boot": true,
            "SizeGb": 60,
            "Image": "https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-1404-trusty-v20161205",
            "Type": "pd-standard",
            "AutoDelete": false,
            "ReuseExisting": true
        }],
        "Scopes": [
          "https://www.googleapis.com/auth/cloudruntimeconfig",
          "https://www.googleapis.com/auth/logging.write"
        ]
      }
    },
    "Flavor": {
      "Plugin": "flavor-vanilla",
      "Properties": {
        "Init": [
          "sh -c \"echo 'Hello, World!' > /hello\""
        ]
      }
    }
  }
}

Reporting security issues

The maintainers take security seriously. If you discover a security issue, please bring it to their attention right away!

Please DO NOT file a public issue, instead send your report privately to [email protected].

Security reports are greatly appreciated and we will publicly thank you for it. We also like to send gifts—if you're into Docker schwag, make sure to let us know. We currently do not offer a paid security bounty program, but are not ruling it out in the future.

Copyright and license

Copyright © 2016 Docker, Inc. All rights reserved, except as follows. Code is released under the Apache 2.0 license. The README.md file, and files in the "docs" folder are licensed under the Creative Commons Attribution 4.0 International License under the terms and conditions set forth in the file "LICENSE.docs". You may obtain a duplicate copy of the same license, titled CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/.

infrakit.gcp's People

Contributors

dgageot avatar rn avatar

Watchers

David Chung avatar  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.