Skip to content

Commit dfadfe3

Browse files
Merge pull request #483 from snyk/feat/add-registries-conf-to-installation
[RUN-965] Feat/add registries conf to kubernetes-monitor installation
2 parents a3d0af6 + 84b69dc commit dfadfe3

File tree

6 files changed

+44
-1
lines changed

6 files changed

+44
-1
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
FROM golang:1.13.1-alpine3.10 AS skopeo-build
55

66
RUN apk --no-cache add git make gcc musl-dev ostree-dev go-md2man
7-
RUN git clone --depth 1 -b 'v0.1.39' https://github.com/containers/skopeo $GOPATH/src/github.com/containers/skopeo
7+
RUN git clone --depth 1 -b 'v0.2.0' https://github.com/containers/skopeo $GOPATH/src/github.com/containers/skopeo
88
RUN cd $GOPATH/src/github.com/containers/skopeo \
99
&& make binary-local-static DISABLE_CGO=1 \
1010
&& make install

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ kubectl create secret generic snyk-monitor -n snyk-monitor --from-file=./dockerc
6363
kubectl create configmap snyk-monitor-certs -n snyk-monitor --from-file=<path_to_certs_folder>
6464
```
6565

66+
5. If you are using an insecure registry or your registry is using unqualified images, you can provide a `registries.conf` file. See [the documentation](https://github.com/containers/image/blob/master/docs/containers-registries.conf.5.md) for information on the format and examples.
67+
68+
Create a file named `registries.conf`, see example adding an insecure registry:
69+
70+
```
71+
[[registry]]
72+
location = "internal-registry-for-example.net/bar"
73+
insecure = true
74+
```
75+
76+
Once you've created the file, you can use it to create the following ConfigMap:
77+
```shell
78+
kubectl create configmap snyk-monitor-registries-conf -n snyk-monitor --from-file=<path_to_registries_conf_file>
79+
```
80+
6681
## Installation from YAML files ##
6782

6883
The `kubernetes-monitor` can run in one of two modes: constrained to a single namespace, or with access to the whole cluster.

snyk-monitor-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ spec:
3232
mountPath: "/var/tmp"
3333
- name: ssl-certs
3434
mountPath: "/srv/app/certs"
35+
- name: registries-conf
36+
mountPath: "/srv/app/.config/containers"
3537
env:
3638
- name: SNYK_INTEGRATION_ID
3739
valueFrom:
@@ -107,4 +109,8 @@ spec:
107109
configMap:
108110
name: snyk-monitor-certs
109111
optional: true
112+
- name: registries-conf
113+
configMap:
114+
name: snyk-monitor-registries-conf
115+
optional: true
110116
serviceAccountName: snyk-monitor

snyk-monitor/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@ kubectl create secret generic snyk-monitor -n snyk-monitor --from-file=./dockerc
5555
kubectl create configmap snyk-monitor-certs -n snyk-monitor --from-file=<path_to_certs_folder>
5656
```
5757

58+
5. If you are using an insecure registry or your registry is using unqualified images, you can provide a `registries.conf` file. See [the documentation](https://github.com/containers/image/blob/master/docs/containers-registries.conf.5.md) for information on the format and examples.
59+
60+
Create a file named `registries.conf`, see example adding an insecure registry:
61+
62+
```
63+
[[registry]]
64+
location = "internal-registry-for-example.net/bar"
65+
insecure = true
66+
```
67+
68+
Once you've created the file, you can use it to create the following ConfigMap:
69+
```shell
70+
kubectl create configmap snyk-monitor-registries-conf -n snyk-monitor --from-file=<path_to_registries_conf_file>
71+
```
72+
5873
## Installation from Helm repo ##
5974

6075
Add Snyk's Helm repo:

snyk-monitor/templates/deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ spec:
3434
mountPath: "/var/tmp"
3535
- name: ssl-certs
3636
mountPath: "/srv/app/certs"
37+
- name: registries-conf
38+
mountPath: "/srv/app/.config/containers"
3739
env:
3840
- name: SNYK_INTEGRATION_ID
3941
valueFrom:
@@ -85,3 +87,7 @@ spec:
8587
configMap:
8688
name: {{ .Values.certsConfigMap }}
8789
optional: true
90+
- name: registries-conf
91+
configMap:
92+
name: {{ .Values.registriesConfConfigMap }}
93+
optional: true

snyk-monitor/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# The currently used keys within the secret are: "dockercfg.json", "integrationId".
77
monitorSecrets: snyk-monitor
88
certsConfigMap: snyk-monitor-certs
9+
registriesConfConfigMap: snyk-monitor-registries-conf
910

1011
# One of: Cluster, Namespaced
1112
# Cluster - creates a ClusterRole and ClusterRoleBinding with the ServiceAccount

0 commit comments

Comments
 (0)