Add custom docker registry to KubernetesCluster
Allow access to private docker registry using docker argument '--insecure-registry'. Add new field for docker private registry host ip or domain name. Partially implements: blueprint k8s-docker-enterprise-hub-support Change-Id: I725c0b6a2bdbfe6eb9e627266411286fe44bfae3
This commit is contained in:
parent
dabb1ee606
commit
5c5b44958d
|
@ -49,6 +49,9 @@ Properties:
|
|||
dockerRegistry:
|
||||
Contract: $.string()
|
||||
|
||||
dockerMirror:
|
||||
Contract: $.string()
|
||||
|
||||
serviceEndpoints:
|
||||
Contract:
|
||||
- port: $.int().notNull().check($ > 0)
|
||||
|
|
|
@ -84,7 +84,8 @@ Methods:
|
|||
name => $.instance.name,
|
||||
ip => $.getIp(),
|
||||
masterIp => $._cluster.masterNode.getIp(),
|
||||
dockerRegistry => $._cluster.dockerRegistry
|
||||
dockerRegistry => $._cluster.dockerRegistry,
|
||||
dockerMirror => $._cluster.dockerMirror
|
||||
))
|
||||
- $.instance.agent.call($template, $resources)
|
||||
- $.setAttr(nodeConfigured, true)
|
||||
|
|
|
@ -19,10 +19,14 @@ Parameters:
|
|||
ip: $ip
|
||||
masterIp: $masterIp
|
||||
dockerRegistry: $dockerRegistry
|
||||
dockerMirror: $dockerMirror
|
||||
|
||||
Body: |
|
||||
if args.dockerRegistry:
|
||||
setupRegistry(args.dockerRegistry)
|
||||
if args.dockerMirror:
|
||||
setupMirror(args.dockerMirror)
|
||||
restartDocker()
|
||||
setup('{0} {1} {2}'.format(args.name, args.ip, args.masterIp))
|
||||
|
||||
Scripts:
|
||||
|
@ -50,3 +54,20 @@ Scripts:
|
|||
Options:
|
||||
captureStdout: true
|
||||
captureStderr: true
|
||||
|
||||
setupMirror:
|
||||
Type: Application
|
||||
Version: 1.0.0
|
||||
EntryPoint: setupDockerMirror.sh
|
||||
Files: []
|
||||
Options:
|
||||
captureStdout: true
|
||||
captureStderr: true
|
||||
|
||||
restartDocker:
|
||||
Type: Application
|
||||
Version: 1.0.0
|
||||
EntryPoint: restartDocker.sh
|
||||
Options:
|
||||
captureStdout: false
|
||||
captureStderr: false
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
service docker restart
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/default/docker
|
||||
DOCKER_OPTS+=" --registry-mirror=$1"
|
||||
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
|
|
@ -1,7 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
source /etc/default/docker
|
||||
DOCKER_OPTS+=" --registry-mirror=$1"
|
||||
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
|
||||
|
||||
service docker restart
|
||||
DOCKER_OPTS+=" --insecure-registry $1"
|
||||
echo DOCKER_OPTS=\"$DOCKER_OPTS\" > /etc/default/docker
|
|
@ -63,6 +63,7 @@ Application:
|
|||
gatewayCount: $.appConfiguration.gatewayCount
|
||||
gatewayNodes: repeat($gatewayNode, $.appConfiguration.maxGatewayCount)
|
||||
dockerRegistry: $.appConfiguration.dockerRegistry
|
||||
dockerMirror: $.appConfiguration.dockerMirror
|
||||
|
||||
|
||||
Forms:
|
||||
|
@ -164,9 +165,16 @@ Forms:
|
|||
type: string
|
||||
label: Custom Docker registry URL
|
||||
description: >-
|
||||
URL of docker repository mirror to use.
|
||||
Host IP or domain name of custom Docker registry to use.
|
||||
Leave empty to use Docker default.
|
||||
required: false
|
||||
- name: dockerMirror
|
||||
type: string
|
||||
label: Docker registry mirror URL
|
||||
description: >-
|
||||
URL of Docker registry mirror to use.
|
||||
Leave empty to not use one.
|
||||
required: false
|
||||
|
||||
- instanceConfiguration:
|
||||
fields:
|
||||
|
|
Loading…
Reference in New Issue