Michal Ptacek | 5a269d2 | 2019-01-28 13:03:16 +0000 | [diff] [blame] | 1 | --- kubernetes/common/dgbuilder/templates/deployment.yaml 2019-01-28 13:01:35.017243076 +0100 |
| 2 | +++ kubernetes/common/dgbuilder/templates/deployment.yaml 2019-01-28 13:19:04.238712534 +0100 |
| 3 | @@ -49,8 +49,14 @@ |
| 4 | - name: {{ include "common.name" . }} |
| 5 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 6 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 7 | - command: ["/bin/bash"] |
| 8 | - args: ["-c", "cd /opt/onap/ccsdk/dgbuilder/ && ./start.sh sdnc1.0 && wait"] |
| 9 | + command: |
| 10 | + - /bin/bash |
| 11 | + - -c |
| 12 | + - > |
| 13 | + HOSTS_FILE_RECORD >> /etc/hosts; |
| 14 | + NPM_REGISTRY_RECORD; |
| 15 | + cd /opt/onap/ccsdk/dgbuilder/; |
| 16 | + ./start.sh sdnc1.0 && wait |
| 17 | ports: |
| 18 | - containerPort: {{ .Values.service.internalPort }} |
| 19 | readinessProbe: |
| 20 | --- kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml 2019-01-28 13:01:35.087243698 +0100 |
| 21 | +++ kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml 2019-01-28 13:29:24.881069646 +0100 |
| 22 | @@ -49,8 +49,13 @@ |
| 23 | name: {{ include "common.name" . }}-readiness |
| 24 | containers: |
| 25 | - name: {{ include "common.name" . }} |
| 26 | - command: ["/bin/bash"] |
| 27 | - args: ["-c", "cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh"] |
| 28 | + command: |
| 29 | + - /bin/bash |
| 30 | + - -c |
| 31 | + - > |
| 32 | + HOSTS_FILE_RECORD >> /etc/hosts; |
| 33 | + NPM_REGISTRY_RECORD; |
| 34 | + cd /opt/onap/sdnc/admportal/shell && ./start_portal.sh |
| 35 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 36 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 37 | ports: |
Michal Ptacek | 8056725 | 2019-01-29 17:17:12 +0000 | [diff] [blame] | 38 | --- kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml 2019-01-24 09:55:30.000000000 +0100 |
| 39 | +++ kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/deployment.yaml 2019-01-29 18:07:59.057804519 +0100 |
| 40 | @@ -70,6 +70,8 @@ |
| 41 | - mountPath: /etc/localtime |
| 42 | name: localtime |
| 43 | readOnly: true |
| 44 | + - mountPath: /etc/pki/ca-trust/source/anchors |
| 45 | + name: root-ca |
| 46 | securityContext: |
| 47 | privileged: True |
| 48 | lifecycle: |
| 49 | @@ -82,6 +84,8 @@ |
| 50 | set -ex |
| 51 | mkdir -p /var/run/secrets/kubernetes.io/ |
| 52 | ln -s /secret /var/run/secrets/kubernetes.io/serviceaccount |
| 53 | + echo -e '\nREQUESTS_CA_BUNDLE="/etc/ssl/certs/ca-bundle.crt"' >> /etc/sysconfig/cloudify-restservice |
| 54 | + update-ca-trust extract |
| 55 | volumes: |
| 56 | - name: {{ include "common.fullname" . }}-config |
| 57 | configMap: |
| 58 | @@ -95,5 +99,8 @@ |
| 59 | - name: localtime |
| 60 | hostPath: |
| 61 | path: /etc/localtime |
| 62 | + - name: root-ca |
| 63 | + hostPath: |
| 64 | + path: /etc/pki/ca-trust/source/anchors |
| 65 | imagePullSecrets: |
| 66 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Michal Ptacek | 997057f | 2019-02-01 08:37:05 +0000 | [diff] [blame^] | 67 | --- kubernetes/policy/charts/brmsgw/templates/deployment.yaml 2019-01-24 09:55:33.000000000 +0100 |
| 68 | +++ kubernetes/policy/charts/brmsgw/templates/deployment.yaml 2019-01-31 13:01:49.911044498 +0100 |
| 69 | @@ -46,6 +46,7 @@ |
| 70 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 72 | name: {{ include "common.name" . }}-readiness |
| 73 | +{{ include "common.update-system-ca-store-ubuntu" . | indent 6 }} |
| 74 | containers: |
| 75 | - command: |
| 76 | - /bin/bash |
| 77 | @@ -69,6 +70,8 @@ |
| 78 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 80 | volumeMounts: |
| 81 | +{{ include "common.cacert-mount-ubuntu" . | indent 8 }} |
| 82 | +{{ include "common.system-ca-store-mount-ubuntu" . | indent 8 }} |
| 83 | - mountPath: /etc/localtime |
| 84 | name: localtime |
| 85 | readOnly: true |
| 86 | @@ -95,6 +98,8 @@ |
| 87 | {{ toYaml .Values.affinity | indent 10 }} |
| 88 | {{- end }} |
| 89 | volumes: |
| 90 | +{{ include "common.cacert-volume" . | indent 8 }} |
| 91 | +{{ include "common.system-ca-store-volume" . | indent 8 }} |
| 92 | - name: localtime |
| 93 | hostPath: |
| 94 | path: /etc/localtime |
| 95 | --- kubernetes/policy/charts/drools/templates/statefulset.yaml 2019-01-24 09:55:33.000000000 +0100 |
| 96 | +++ kubernetes/policy/charts/drools/templates/statefulset.yaml 2019-01-31 13:04:00.848634430 +0100 |
| 97 | @@ -52,6 +52,8 @@ |
| 98 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 99 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 100 | name: {{ include "common.name" . }}-readiness |
| 101 | +{{ include "common.update-system-ca-store-ubuntu" . | indent 6 }} |
| 102 | +{{ include "policy.update-policy-keystore" . | indent 6 }} |
| 103 | containers: |
| 104 | - name: {{ include "common.name" . }} |
| 105 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 106 | @@ -79,6 +81,9 @@ |
| 107 | - name: REPLICAS |
| 108 | value: "{{ .Values.replicaCount }}" |
| 109 | volumeMounts: |
| 110 | +{{ include "common.cacert-mount-ubuntu" . | indent 10 }} |
| 111 | +{{ include "common.system-ca-store-mount-ubuntu" . | indent 10 }} |
| 112 | +{{ include "policy.keystore-mount" . | indent 10 }} |
| 113 | - mountPath: /etc/localtime |
| 114 | name: localtime |
| 115 | readOnly: true |
| 116 | @@ -137,6 +142,9 @@ |
| 117 | {{ toYaml .Values.affinity | indent 10 }} |
| 118 | {{- end }} |
| 119 | volumes: |
| 120 | +{{ include "common.cacert-volume" . | indent 8 }} |
| 121 | +{{ include "common.system-ca-store-volume" . | indent 8 }} |
| 122 | +{{ include "policy.keystore-storage-volume" . | indent 8 }} |
| 123 | - name: localtime |
| 124 | hostPath: |
| 125 | path: /etc/localtime |
| 126 | --- kubernetes/policy/charts/pdp/templates/statefulset.yaml 2019-01-24 09:55:33.000000000 +0100 |
| 127 | +++ kubernetes/policy/charts/pdp/templates/statefulset.yaml 2019-01-31 13:07:16.161006088 +0100 |
| 128 | @@ -50,6 +50,7 @@ |
| 129 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 130 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 131 | name: {{ include "common.name" . }}-readiness |
| 132 | +{{ include "common.update-system-ca-store-ubuntu" . | indent 6 }} |
| 133 | containers: |
| 134 | - command: |
| 135 | - /bin/bash |
| 136 | @@ -75,6 +76,8 @@ |
| 137 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 138 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 139 | volumeMounts: |
| 140 | +{{ include "common.cacert-mount-ubuntu" . | indent 8 }} |
| 141 | +{{ include "common.system-ca-store-mount-ubuntu" . | indent 8 }} |
| 142 | - mountPath: /etc/localtime |
| 143 | name: localtime |
| 144 | readOnly: true |
| 145 | @@ -114,6 +117,8 @@ |
| 146 | - mountPath: /usr/share/filebeat/data |
| 147 | name: policy-data-filebeat |
| 148 | volumes: |
| 149 | +{{ include "common.cacert-volume" . | indent 6 }} |
| 150 | +{{ include "common.system-ca-store-volume" . | indent 6 }} |
| 151 | - name: localtime |
| 152 | hostPath: |
| 153 | path: /etc/localtime |
| 154 | --- kubernetes/common/common/templates/_cacert.tpl 2019-01-31 13:09:54.170924801 +0100 |
| 155 | +++ kubernetes/common/common/templates/_cacert.tpl 2019-01-31 13:10:54.650659206 +0100 |
| 156 | @@ -0,0 +1,80 @@ |
| 157 | +# COPYRIGHT NOTICE STARTS HERE |
| 158 | +# |
| 159 | +# Copyright 2018 © Samsung Electronics Co., Ltd. |
| 160 | +# |
| 161 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 162 | +# you may not use this file except in compliance with the License. |
| 163 | +# You may obtain a copy of the License at |
| 164 | +# |
| 165 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 166 | +# |
| 167 | +# Unless required by applicable law or agreed to in writing, software |
| 168 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 169 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 170 | +# See the License for the specific language governing permissions and |
| 171 | +# limitations under the License. |
| 172 | +# |
| 173 | +# COPYRIGHT NOTICE ENDS HERE |
| 174 | + |
| 175 | +#This template adds volume for access to ca certificate. |
| 176 | +#Template is ignored when cacert not set. |
| 177 | +{{- define "common.cacert-volume" }} |
| 178 | +{{- if .Values.global.cacert }} |
| 179 | +- name: cacert |
| 180 | + configMap: |
| 181 | + name: {{ include "common.namespace" . }}-root-ca-cert |
| 182 | +{{- end }} |
| 183 | +{{- end }} |
| 184 | + |
| 185 | +#This template mounts the CA certificate in an ubuntu compatible way. |
| 186 | +#It is mounted to /usr/local/share/ca-certificates/cacert.crt. |
| 187 | +#Template is ignored if cacert not set. |
| 188 | +{{- define "common.cacert-mount-ubuntu" }} |
| 189 | +{{- if .Values.global.cacert }} |
| 190 | +- mountPath: "/usr/local/share/ca-certificates/cacert.crt" |
| 191 | + name: cacert |
| 192 | + subPath: certificate |
| 193 | +{{- end }} |
| 194 | +{{- end }} |
| 195 | + |
| 196 | +#This template creates an empty volume used to store system certificates (includes java keystore). |
| 197 | +{{- define "common.system-ca-store-volume" }} |
| 198 | +{{- if .Values.global.cacert }} |
| 199 | +- name: system-ca-store |
| 200 | + emptyDir: |
| 201 | +{{- end }} |
| 202 | +{{- end }} |
| 203 | + |
| 204 | +#This template mounts system ca store volume to /etc/ssl/certs (ubuntu specific). |
| 205 | +#Template is ignored in case cacert is not given. |
| 206 | +{{- define "common.system-ca-store-mount-ubuntu" }} |
| 207 | +{{- if .Values.global.cacert }} |
| 208 | +- mountPath: "/etc/ssl/certs" |
| 209 | + name: system-ca-store |
| 210 | +{{- end }} |
| 211 | +{{- end }} |
| 212 | + |
| 213 | +#This template is a template for an init container. |
| 214 | +#This init container can be declared to update system's ca store for ubuntu containers. |
| 215 | +#It runs as root using the same image as the main one. |
| 216 | +#It expects /etc/ssl/certs to be mounted as a volume. |
| 217 | +#It has to be shared with the main container. |
| 218 | +#This template is ignored if cacert is not given as helm value. |
| 219 | +{{- define "common.update-system-ca-store-ubuntu" }} |
| 220 | +{{- if .Values.global.cacert }} |
| 221 | +- command: |
| 222 | + - "/bin/bash" |
| 223 | + - "-c" |
| 224 | + - | |
| 225 | + mkdir -p /etc/ssl/certs/java |
| 226 | + update-ca-certificates |
| 227 | + name: update-system-ca-store |
| 228 | + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 229 | + image: {{ include "common.repository" . }}/{{ .Values.image }} |
| 230 | + securityContext: |
| 231 | + runAsUser: 0 |
| 232 | + volumeMounts: |
| 233 | +{{ include "common.cacert-mount-ubuntu" . | indent 2 }} |
| 234 | +{{ include "common.system-ca-store-mount-ubuntu" . | indent 2 }} |
| 235 | +{{- end }} |
| 236 | +{{- end }} |
| 237 | --- kubernetes/onap/templates/configmap.yaml 2019-01-31 13:09:54.170924801 +0100 |
| 238 | +++ kubernetes/onap/templates/configmap.yaml 2019-01-31 13:11:24.628023219 +0100 |
| 239 | @@ -0,0 +1,33 @@ |
| 240 | +# COPYRIGHT NOTICE STARTS HERE |
| 241 | +# |
| 242 | +# Copyright 2018 © Samsung Electronics Co., Ltd. |
| 243 | +# |
| 244 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 245 | +# you may not use this file except in compliance with the License. |
| 246 | +# You may obtain a copy of the License at |
| 247 | +# |
| 248 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 249 | +# |
| 250 | +# Unless required by applicable law or agreed to in writing, software |
| 251 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 252 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 253 | +# See the License for the specific language governing permissions and |
| 254 | +# limitations under the License. |
| 255 | +# |
| 256 | +# COPYRIGHT NOTICE ENDS HERE |
| 257 | + |
| 258 | +{{ if .Values.global.cacert -}} |
| 259 | +apiVersion: v1 |
| 260 | +kind: ConfigMap |
| 261 | +metadata: |
| 262 | + name: {{ include "common.namespace" . }}-root-ca-cert |
| 263 | + namespace: {{ include "common.namespace" . }} |
| 264 | + labels: |
| 265 | + app: {{ include "common.name" . }} |
| 266 | + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 267 | + release: {{ .Release.Name }} |
| 268 | + heritage: {{ .Release.Service }} |
| 269 | +data: |
| 270 | + certificate: | |
| 271 | +{{ .Values.global.cacert | indent 4 }} |
| 272 | +{{- end }} |
| 273 | --- kubernetes/policy/charts/policy-common/templates/_keystore.tpl 2019-01-31 13:09:54.170924801 +0100 |
| 274 | +++ kubernetes/policy/charts/policy-common/templates/_keystore.tpl 2019-01-31 13:11:49.122320657 +0100 |
| 275 | @@ -0,0 +1,61 @@ |
| 276 | +# COPYRIGHT NOTICE STARTS HERE |
| 277 | +# |
| 278 | +# Copyright 2018 © Samsung Electronics Co., Ltd. |
| 279 | +# |
| 280 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 281 | +# you may not use this file except in compliance with the License. |
| 282 | +# You may obtain a copy of the License at |
| 283 | +# |
| 284 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 285 | +# |
| 286 | +# Unless required by applicable law or agreed to in writing, software |
| 287 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 288 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 289 | +# See the License for the specific language governing permissions and |
| 290 | +# limitations under the License. |
| 291 | +# |
| 292 | +# COPYRIGHT NOTICE ENDS HERE |
| 293 | + |
| 294 | +#This template creates a volume for storing policy-keystore with imported ca. |
| 295 | +#It is ignored if cacert was not given. |
| 296 | +{{- define "policy.keystore-storage-volume" }} |
| 297 | +{{- if .Values.global.cacert }} |
| 298 | +- name: keystore-storage |
| 299 | + emptyDir: |
| 300 | +{{- end }} |
| 301 | +{{- end }} |
| 302 | + |
| 303 | +#This template mounts policy-keystore in appropriate place for policy components to take it. |
| 304 | +#It is ignored if cacert is not given. |
| 305 | +{{- define "policy.keystore-mount" }} |
| 306 | +{{- if .Values.global.cacert }} |
| 307 | +- mountPath: "/tmp/policy-install/config/policy-keystore" |
| 308 | + name: keystore-storage |
| 309 | + subPath: policy-keystore |
| 310 | +{{- end }} |
| 311 | +{{- end }} |
| 312 | + |
| 313 | +#This will extract a policy keystore and then import |
| 314 | +#the root cacert of offline nexus into it. |
| 315 | +#This template expects a volume named keystore-storage where policy-keystore will be put. |
| 316 | +#It also expects volume named cacert where the file "certificate" will contain the cert to import. |
| 317 | +#Template is ignored if ca certificate not given. |
| 318 | +{{- define "policy.update-policy-keystore" }} |
| 319 | +{{- if .Values.global.cacert }} |
| 320 | +- command: |
| 321 | + - "/bin/bash" |
| 322 | + - "-c" |
| 323 | + - | |
| 324 | + set -e |
| 325 | + tar -xzf base-*.tar.gz etc/ssl/policy-keystore |
| 326 | + cp etc/ssl/policy-keystore keystore-storage/ |
| 327 | + keytool -import -keystore keystore-storage/policy-keystore -storepass "Pol1cy_0nap" -noprompt -file /usr/local/share/ca-certificates/cacert.crt |
| 328 | + name: update-policy-keystore |
| 329 | + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 330 | + image: {{ include "common.repository" . }}/{{ .Values.image }} |
| 331 | + volumeMounts: |
| 332 | + - mountPath: "/tmp/policy-install/keystore-storage" |
| 333 | + name: keystore-storage |
| 334 | +{{ include "common.cacert-mount-ubuntu" . | indent 2 }} |
| 335 | +{{- end }} |
| 336 | +{{- end }} |