Merge "Add Google Container Registry to KubernetesCluster"

This commit is contained in:
Jenkins 2015-12-03 16:24:23 +00:00 committed by Gerrit Code Review
commit 5fc51c6378
5 changed files with 31 additions and 1 deletions

View File

@ -53,6 +53,9 @@ Properties:
dockerMirror:
Contract: $.string()
gcloudKey:
Contract: $.string()
serviceEndpoints:
Contract:
- port: $.int().notNull().check($ > 0)

View File

@ -85,7 +85,8 @@ Methods:
ip => $.getIp(),
masterIp => $._cluster.masterNode.getIp(),
dockerRegistry => $._cluster.dockerRegistry,
dockerMirror => $._cluster.dockerMirror
dockerMirror => $._cluster.dockerMirror,
gcloudKey => $._cluster.gcloudKey
))
- $.instance.agent.call($template, $resources)
- $.setAttr(nodeConfigured, true)

View File

@ -20,12 +20,15 @@ Parameters:
masterIp: $masterIp
dockerRegistry: $dockerRegistry
dockerMirror: $dockerMirror
gcloudKey: $gcloudKey
Body: |
if args.dockerRegistry:
setupRegistry(args.dockerRegistry)
if args.dockerMirror:
setupMirror(args.dockerMirror)
if args.gcloudKey:
loginToGoogleRegistry("'{0}'".format(args.gcloudKey))
restartDocker()
setup('{0} {1} {2}'.format(args.name, args.ip, args.masterIp))
@ -64,6 +67,15 @@ Scripts:
captureStdout: true
captureStderr: true
loginToGoogleRegistry:
Type: Application
Version: 1.0.0
EntryPoint: loginToGoogleRegistry.sh
Files: []
Options:
captureStdout: true
captureStderr: true
restartDocker:
Type: Application
Version: 1.0.0

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker login -e unused@arg.com -u _json_key -p "$1" https://gcr.io

View File

@ -64,6 +64,7 @@ Application:
gatewayNodes: repeat($gatewayNode, $.appConfiguration.maxGatewayCount)
dockerRegistry: $.appConfiguration.dockerRegistry
dockerMirror: $.appConfiguration.dockerMirror
gcloudKey: $.appConfiguration.gcloudKey
Forms:
@ -175,6 +176,16 @@ Forms:
URL of Docker registry mirror to use.
Leave empty to not use one.
required: false
- name: gcloudKey
type: string
label: Google registry key
regexpValidator: '^{(\s*"(\\(["\\\/bfnrt]|u[a-fA-F0-9]{4})|[^"\\\0-\x1F\x7F]+)*"\s*:\s*"(\\(["\\\/bfnrt]|u[a-fA-F0-9]{4})|[^"\\\0-\x1F\x7F]+)*"\s*(,|\s*}$))*$'
errorMessages:
invalid: Text should be a valid JSON.
description: >-
Contents of JSON key file.
Used to authenticate to the Google Container Registry
required: false
- instanceConfiguration:
fields: