From 0c93505d81bb509f1e991a9cc2e111beed01f0df Mon Sep 17 00:00:00 2001 From: Kelvin Date: Fri, 17 Jul 2020 09:45:00 +0200 Subject: [PATCH] [stable/hlf-peer] Add docker config.json secret for private registry (#23206) Signed-off-by: Kelvin Moutet --- stable/hlf-peer/Chart.yaml | 2 +- stable/hlf-peer/README.md | 2 ++ stable/hlf-peer/templates/deployment.yaml | 12 ++++++++++++ stable/hlf-peer/templates/secret.yaml | 9 +++++++++ stable/hlf-peer/values.yaml | 5 +++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 stable/hlf-peer/templates/secret.yaml diff --git a/stable/hlf-peer/Chart.yaml b/stable/hlf-peer/Chart.yaml index 759580992b9a..032c609043e6 100644 --- a/stable/hlf-peer/Chart.yaml +++ b/stable/hlf-peer/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Hyperledger Fabric Peer chart (these charts are created by AID:Tech and are currently not directly associated with the Hyperledger project) name: hlf-peer -version: 1.4.0 +version: 1.5.0 appVersion: 1.4.3 keywords: - blockchain diff --git a/stable/hlf-peer/README.md b/stable/hlf-peer/README.md index 4119a30c78ea..627a7b5324c6 100644 --- a/stable/hlf-peer/README.md +++ b/stable/hlf-peer/README.md @@ -97,6 +97,8 @@ The following table lists the configurable parameters of the Hyperledger Fabric | `ingress.hosts` | Ingress hostnames | `[]` | | `ingress.tls` | Ingress TLS configuration | `[]` | | `dockerSocketPath` | Docker Socket path | `/var/run/docker.sock` | +| `dockerConfig` | Docker Config file base 64 encoded | `null` | +| `dockerConfigMountPath` | Docker Config file mount path | `/root/.docker` | | `peer.databaseType` | Database type to use (`goleveldb` or `CouchDB`) | `goleveldb` | | `peer.couchdbInstance` | CouchDB chart name to use `cdb-peer1` | `cdb-peer1` | | `peer.mspID` | ID of MSP the Peer belongs to | `Org1MSP` | diff --git a/stable/hlf-peer/templates/deployment.yaml b/stable/hlf-peer/templates/deployment.yaml index a350117a63e2..edbafc5cc9bf 100644 --- a/stable/hlf-peer/templates/deployment.yaml +++ b/stable/hlf-peer/templates/deployment.yaml @@ -30,6 +30,14 @@ spec: - name: dockersocket hostPath: path: {{ .Values.dockerSocketPath }} + {{- if .Values.dockerConfig }} + - name: docker-config + secret: + secretName: {{ include "hlf-peer.fullname" . }}-dockerconfigjson + items: + - key: .dockerconfigjson + path: config.json + {{- end }} {{- if .Values.secrets.peer.cert }} - name: id-cert secret: @@ -163,6 +171,10 @@ spec: name: data - mountPath: /host/var/run/docker.sock name: dockersocket + {{- if .Values.dockerConfig }} + - name: docker-config + mountPath: {{ .Values.dockerConfigMountPath }} + {{ end }} {{- if .Values.secrets.peer.cert }} - mountPath: /var/hyperledger/msp/signcerts name: id-cert diff --git a/stable/hlf-peer/templates/secret.yaml b/stable/hlf-peer/templates/secret.yaml new file mode 100644 index 000000000000..43e325de1c1b --- /dev/null +++ b/stable/hlf-peer/templates/secret.yaml @@ -0,0 +1,9 @@ +{{- if .Values.dockerConfig }} +apiVersion: v1 +kind: Secret +type: kubernetes.io/dockerconfigjson +metadata: + name: {{ include "hlf-peer.fullname" . }}-dockerconfigjson +data: + .dockerconfigjson: {{ .Values.dockerConfig }} +{{ end }} diff --git a/stable/hlf-peer/values.yaml b/stable/hlf-peer/values.yaml index 5dbf32af6025..7f0653ce99dd 100644 --- a/stable/hlf-peer/values.yaml +++ b/stable/hlf-peer/values.yaml @@ -13,7 +13,12 @@ service: portRequest: 7051 portEvent: 7053 +# Path of the docker socket on the host dockerSocketPath: /var/run/docker.sock +# Docker config to be used to pull the images (base64'd) +dockerConfig: null +# Docker config mount path +dockerConfigMountPath: /root/.docker ingress: enabled: false