AETHER-761 Add support of private image registry with auth enabled
Change-Id: I25e804570357c513bfd1822ab9d971c7ed1c5405
diff --git a/omec/omec-upf-cni/Chart.yaml b/omec/omec-upf-cni/Chart.yaml
index 1048b63..ae32d3b 100644
--- a/omec/omec-upf-cni/Chart.yaml
+++ b/omec/omec-upf-cni/Chart.yaml
@@ -9,4 +9,4 @@
name: omec-upf-cni
icon: https://guide.opencord.org/logos/cord.svg
-version: 0.1.0
+version: 0.1.1
diff --git a/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml b/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml
index b9bb1cb..0624fb2 100644
--- a/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml
+++ b/omec/omec-upf-cni/templates/daemonset-sriov-plugin.yaml
@@ -26,6 +26,10 @@
hostPID: true
nodeSelector:
beta.kubernetes.io/arch: amd64
+ {{- if .Values.images.credentials }}
+ imagePullSecrets:
+ - name: {{ .Release.Name }}.registry
+ {{- end }}
initContainers:
- name: init-sriov-plugin
image: {{ .Values.images.tags.omecCni }}
diff --git a/omec/omec-upf-cni/templates/secret-registry.yaml b/omec/omec-upf-cni/templates/secret-registry.yaml
new file mode 100644
index 0000000..1502049
--- /dev/null
+++ b/omec/omec-upf-cni/templates/secret-registry.yaml
@@ -0,0 +1,18 @@
+{{/*
+# Copyright 2020-present Open Networking Foundation
+
+# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
+*/}}
+
+{{- if .Values.images.credentials }}
+---
+kind: Secret
+apiVersion: v1
+metadata:
+ name: {{ .Release.Name }}.registry
+ labels:
+ release: {{ .Release.Name }}
+type: kubernetes.io/dockerconfigjson
+data:
+ .dockerconfigjson: {{ printf `{"auths":{%s:{"auth":"%s"}}}` (.Values.images.credentials.registry | quote) (printf "%s:%s" .Values.images.credentials.username .Values.images.credentials.password | b64enc) | b64enc | quote }}
+{{- end }}
diff --git a/omec/omec-upf-cni/values.yaml b/omec/omec-upf-cni/values.yaml
index f9e1094..2008555 100644
--- a/omec/omec-upf-cni/values.yaml
+++ b/omec/omec-upf-cni/values.yaml
@@ -7,6 +7,11 @@
omecCni: docker.io/omecproject/omec-cni:1.0.2
sriovPlugin: docker.io/nfvpe/sriov-device-plugin:v3.2
pullPolicy: IfNotPresent
+ credentials: {}
+ # If specified, use this credential to access the image
+ # registry:
+ # username:
+ # password:
config:
sriov: