blob: 59d60666ef067b001c12a8b95f292b6d97f4169b [file] [log] [blame]
jasmineWenc2cc5ff2018-06-22 18:16:24 +00001# Copyright © 2018 Amdocs, AT&T, Bell Canada
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: v1
16kind: ConfigMap
17metadata:
18 name: imagescanner-settings
19 namespace: {{ include "common.namespace" . }}
20data:
21{{ tpl (.Files.Glob "resources/config/imagescanner/*").AsConfig . | indent 2 }}
22---
23apiVersion: v1
24kind: Secret
25metadata:
26 name: slack-tokens
27 namespace: {{ include "common.namespace" . }}
28type: Opaque
29data:
30 notifications: ""
31---
32kind: Secret
33apiVersion: v1
34metadata:
35 name: imagescanner-ssh
36 namespace: {{ include "common.namespace" . }}
37type: Opaque
38data:
39 # FIXME the imagescanner really should have its own private key, but then we
40 # have to adjust the gitlab wrapper script to set two public keys as
41 # deploykeys.
42 id_ed25519: "LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0KYjNCbGJuTnphQzFyWlhrdGRqRUFBQUFBQkc1dmJtVUFBQUFFYm05dVpRQUFBQUFBQUFBQkFBQUFNd0FBQUF0emMyZ3RaVwpReU5UVXhPUUFBQUNDRDEwanpvNGlSZjF4bTYzSWxMSEpGeTVUK0FoUnVmenZLdmdpMEhwZ1RVQUFBQUpqV3dKZDkxc0NYCmZRQUFBQXR6YzJndFpXUXlOVFV4T1FBQUFDQ0QxMGp6bzRpUmYxeG02M0lsTEhKRnk1VCtBaFJ1Znp2S3ZnaTBIcGdUVUEKQUFBRUFXRktNV0xsNkZnRUJ1Zzk3MSthdE5ZQnQ4R2R1V3pDWWd0L2o5VHU0U2g0UFhTUE9qaUpGL1hHYnJjaVVzY2tYTApsUDRDRkc1L084cStDTFFlbUJOUUFBQUFFM0JoZFd4QVVHRjFiQ2R6SUUxaFl5QlFjbThCQWc9PQotLS0tLUVORCBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K"
43---
44kind: ConfigMap
45apiVersion: v1
46metadata:
47 name: site-certificate
48 namespace: {{ include "common.namespace" . }}
49data:
50 site.crt: |
51 -----BEGIN CERTIFICATE-----
52 MIIDEDCCAfgCCQDhahVKE9/eUjANBgkqhkiG9w0BAQsFADBKMRAwDgYDVQQKDAdF
53 eGFtcGxlMRAwDgYDVQQLDAdleGFtcGxlMSQwIgYDVQQDDBtkZXZlbG9wbWVudC52
54 dnAuZXhhbXBsZS5jb20wHhcNMTcxMjI0MTUzOTA3WhcNMTgxMjI0MTUzOTA3WjBK
55 MRAwDgYDVQQKDAdFeGFtcGxlMRAwDgYDVQQLDAdleGFtcGxlMSQwIgYDVQQDDBtk
56 ZXZlbG9wbWVudC52dnAuZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IB
57 DwAwggEKAoIBAQCkvNGXe+bdvL2kvrP2L3WABt2WCFoZ2Pn8Px0eEsRiJHVD0eWz
58 rgJYHFJu0C0cK9NYSKxVVI8LnKH7Ny5MFfM4Tqyr3UEOLs+fSwaAqM5tSyZU/tEK
59 ractA7bi9fDk2lkcs+LLuZMqGPZ37UZcZwsUQ0BONHP668LqkWqT9hNLIN4ejInr
60 32WA3Y7hPNd8Cj+AaLt1x2cXYzi9hrE5l3h9ofkOpXsgDzeIHlp4jJ6kXXQf8UM5
61 1viqa2CWXHBHEG+5eftLSaeE6LAlNt5IJ6LcWEZgNtXr2es4LJC3FjXrv0gc04Cp
62 U2OfizpbhT11cLGaeXOq1cUCXNIb4FcJApoXAgMBAAEwDQYJKoZIhvcNAQELBQAD
63 ggEBAFGPDG9iurAhUKbFkY97xLA443U01bdwi7eAT5T9qo/RzOwcbuKWXVm1k5HK
64 CQO81nlLqLQwhI1+uTTmR41epuJxyGIaDgUySB+8fLzyRSIFaxKD+UeVPgipDNZs
65 h0sKSKrO6MoWzMLUYvdZRw6VIc+UpSCqPY+FKUBUHZtMpSFLnhHjRvVkiP4VvFXj
66 b7jQzHughzeITygws42fKK/MK7wQ6byaMVRbPbQKPAXNxd/UrSPeX+RzKRWOZ6R8
67 Ulyp7dezXCP77UaTZTsxwlurPQIZNMshDxE/SbWt0Q1g28rj5KfAjoZs5Tg/gmQ8
68 LLKI/b1OvKohaANGZ6We5U+ceeU=
69 -----END CERTIFICATE-----
70 wrapper.sh: |
71 #!/bin/sh
72 # This script is meant to be used as a wrapper, so that it can be easily
73 # used with docker or kubernetes' container command specification.
74 #
75 # Kubernetes' volumeMount creates symlinks for configMapped files at the
76 # target directory.
77 # Alpine's update-ca-certificates ignores symlinks.
78 # So we must contrive to copy the contents of the mounted cert (a symlink)
79 # into place as a normal file.
80 dev_cert="${0%/*}/site.crt"
81 echo >&2 "$0: Checking for site CA certificate at $dev_cert..."
82 if [ -s "$dev_cert" ]; then
83 echo >&2 "$0: Updating container CA certificate bundle with site certificate..."
84 cp -L "$dev_cert" /usr/local/share/ca-certificates/
85 update-ca-certificates
86 else
87 echo >&2 "$0: No site CA certificate found."
88 fi
89 echo >&2 "$0: Launching command: $@"
90 exec "$@"
91