Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit40d33fa

Browse files
committed
new
1 parentcb7c4d9 commit40d33fa

File tree

1 file changed

+105
-61
lines changed

1 file changed

+105
-61
lines changed

‎_docs/kb/articles/upgrade-deprecated-docker-images.md‎

Lines changed: 105 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,27 @@ The latest `dind` versions output a deprecation warning in the build log each ti
3434
- Requires script execution and manual review
3535

3636
Example warning in logs:
37+
3738
```
3839
[DEPRECATION NOTICE] Docker Image Format v1 and Docker Image manifest version 2, schema 1 support is disabled by default...
3940
```
4041

4142
Use the following script to scan your build logs and extract deprecated images:
4243
👉[Find deprecated images used in previous builds](https://gist.github.com/francisco-cocozza/6046028184cc12b5ee4513bdcb4217c5)
4344

44-
>💡 For large-scale environments, see[Appendix I](#appendix-i-monitor-engine-metrics) fora metrics-based approach.
45+
>💡 For large-scale environments with thousands of builds, we offer a more scalable, metrics-based detection method. See[Appendix I](#appendix-i-monitor-engine-metrics) fordetails.
4546
4647
---
4748

4849
##Step 2: Upgrade Deprecated Docker Images
4950

50-
Once you've identified deprecated images, re-push them using a modern Docker client to convert the manifest format.
51+
Once you’ve identified deprecated images using engine metrics, the next step is to upgrade those images to a modern format (OCI or Docker manifest v2, schema 2). This is required to ensure compatibility with docker-27 and future releases.
52+
53+
###How It Works
54+
55+
Re-pushing an image using a modern Docker client will automatically convert its manifest to a supported version.
5156

52-
###Sample Codefresh Pipeline
57+
###Sample Codefresh Pipeline to Upgrade an Image
5358

5459
```yaml
5560
version:"1.0"
@@ -64,76 +69,69 @@ steps:
6469
image_name:<target-image-name>
6570
```
6671
67-
**Example:**
6872
```yaml
69-
push:
70-
title:"Re-pushing deprecated image"
71-
type:push
72-
candidate:docker/whalesay:latest
73-
registry:docker
74-
tag:new-manifest
75-
image_name:codefresh/whalesay
73+
# Example:
74+
# push:
75+
# title: "Re-pushing deprecated image"
76+
# type: push
77+
# candidate: docker/whalesay:latest
78+
# registry: docker
79+
# tag: new-manifest
80+
# image_name: codefresh/whalesay
7681
```
7782

78-
Thispipeline steppulls theoriginal image and re-pushes it with acompatible manifest.
83+
This pulls thedeprecated image and re-pushes itunder a new name/tagwith acompliant manifest format.
7984

80-
>🔁 Repeatthis for each deprecated image.
85+
>💡 You can repeatthisprocessfor each deprecated image discovered via metrics or logs.
8186
8287
---
8388

8489
##Appendix I: Monitor Engine Metrics
8590

86-
A scalable way to detectdeprecatedimage pulls usingPrometheus engine metrics.Requires Codefresh Runtime version`v7.5.0`orlater.
91+
This method enables scalable detection ofdeprecatedimages by usingreal-time engine metrics.Recommended for high-volumeorautomated environments.
8792

88-
###Metric Details
93+
###Monitor engine metrics
8994

90-
Metric name:`codefresh_engine_deprecated_images_pulled_total`
95+
Starting from Runtime v7.5.0, engine emits:
9196

92-
Labels include:
93-
-`account_name`
94-
-`pipeline_id`
95-
-`workflow`
96-
-`image_name`
97+
```
98+
codefresh_engine_deprecated_images_pulled_total{ account_name, pipeline_id, workflow, image_name }
99+
```
97100

98-
This metricincrementseach time a deprecated image is pulled.
101+
This metricis a counter increased by 1each timeDocker daemon pullsa deprecated image.
99102

100-
### How toEnable
103+
###How toenable
101104

102-
In yourHybrid RuntimeHelm values:
105+
Set the following values for theHybrid RuntimeChart:
103106

104107
```yaml
105108
runtime:
106109
engine:
107110
env:
108111
METRICS_PROMETHEUS_ENABLED:true
109-
podMonitor:
110-
main:
111-
enabled: true
112+
podMonitor:
113+
main:
114+
enabled:true
112115
```
113116
114-
To ensuremetric collection on shutdown, configure ascrapetimeout:
117+
To ensurethat the Prometheus operator willscrapethe latest metric values before the engine exits, set:
115118
116119
```yaml
117120
runtime:
118121
engine:
119122
env:
120-
METRICS_PROMETHEUS_SCRAPE_TIMEOUT: '120000'# 120s
123+
METRICS_PROMETHEUS_SCRAPE_TIMEOUT:'120000'# Timeout in ms
121124
```
122125
123-
### Monitoring Stack Setup
124-
125-
You can install the [kube-prometheus-stack Helm chart](https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack):
126+
### How to monitor
126127
127-
```bash
128-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
129-
helm repo update
130-
helm install kube-prom prometheus-community/kube-prometheus-stack --create-namespace --namespace kube-prom -f ./kube-prom-values.yaml
131-
```
128+
Installation of the monitoring stack is up to the customer and not covered by our support. The following is a basic setup example:
132129
133-
####Example Storage Class (AWS EBS)
130+
####kube-prom-storage-class.yaml
134131
135132
```yaml
136133
# kube-prom-storage-class.yaml
134+
137135
apiVersion:storage.k8s.io/v1
138136
kind:StorageClass
139137
metadata:
@@ -143,10 +141,11 @@ parameters:
143141
type:gp3
144142
```
145143
146-
####Example Helm Values
144+
####kube-prom-values.yaml
147145
148146
```yaml
149147
# kube-prom-values.yaml
148+
150149
prometheus:
151150
prometheusSpec:
152151
podMonitorSelectorNilUsesHelmValues:false
@@ -159,45 +158,90 @@ prometheus:
159158
resources:
160159
requests:
161160
storage:20Gi
162-
163161
grafana:
164162
persistence:
165163
storageClassName:kube-prom
166164
enabled:true
165+
datasources:
166+
datasources.yaml:
167+
apiVersion:1
168+
datasources:
169+
-name:Mimir API
170+
type:marcusolsson-json-datasource
171+
uid:Mimir-API
172+
access:proxy
173+
url:http://kube-prom-kube-prometheus-prometheus:9090/api/v1
174+
plugins:
175+
-marcusolsson-json-datasource
167176
```
168177
169-
> 📝 Please consult the [officialHelmdocs](https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack?modal=values&path=prometheus.prometheusSpec.storageSpec) for additional configuration.
178+
###Helminstallation
170179
171-
### Verifying Metrics in Grafana
180+
```bash
181+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
182+
helm repo update
183+
helm install kube-prom prometheus-community/kube-prometheus-stack --create-namespace --namespace kube-prom -f ./kube-prom-values.yaml
184+
```
185+
186+
###Grafana access and verification
187+
188+
```bash
189+
kubectl --namespace kube-prom get pods -l"release=kube-prom"
190+
191+
kubectl --namespace kube-prom get secrets kube-prom-grafana -o jsonpath="{.data.admin-password}"| base64 -d;echo
192+
193+
export POD_NAME=$(kubectl --namespace kube-prom get pod -l"app.kubernetes.io/name=grafana,app.kubernetes.io/instance=kube-prom" -oname)
194+
195+
kubectl --namespace kube-prom port-forward$POD_NAME 3000
196+
```
172197

173-
After a build completes:
174-
1. Log into Grafana (port-forward to localhost:3000 if needed).
175-
2. Navigate to **Explore → Metrics**.
176-
3. Search for `codefresh_engine_deprecated_images_pulled_total`.
198+
Open[http://localhost:3000](http://localhost:3000) and log in using the admin password retrieved above.
177199

178-
You should see metrics if deprecated images were pulled.
200+
###Verifying metrics
201+
202+
To ensure that engine metrics are collected correctly, run a build on the monitored Runtime. In Grafana:
203+
204+
- Go to**Explore → Metrics**
205+
- Search for`codefresh_`
206+
- Make sure the time range includes a running build
179207

180208
---
181209

182-
## Appendix II: Grafana Dashboard
210+
##Appendix II: Grafana dashboard
211+
212+
###How to use/understand metrics
213+
214+
The metric`codefresh_engine_deprecated_images_pulled_total` is a counter increased by 1 each time Docker daemon pulls a deprecated image. Labels`{account_name, pipeline_id, workflow, image_name}` allow grouping results.
183215

184-
You can visualize deprecated image pulls using a prebuilt Grafana dashboard:
216+
###Dashboard setup
185217

186-
1. Download the dashboard JSON from [this gist](https://gist.github.com/francisco-cocozza/6046028184cc12b5ee4513bdcb4217c5).
187-
2. In Grafana, go to **Dashboards → New → Import**.
188-
3. Upload the JSON and select `Mimir API` as the data source.
189-
4. Click **Import**.
218+
1. Download Dashboard JSON in APPENDIX II
219+
2. Log in to Grafana
220+
3. Go to**Dashboards → New → Import**
221+
4. Upload the JSON
222+
5. Select`Mimir API` as data source → Click**Import**
190223

191-
### DashboardView
224+
###Dashboardoverview
192225

193-
You’ll be able to:
194226
- Filter by account name
195-
-View time-based pull counts
196-
-Identify pipelines and image names involved
227+
- Adjust time range
228+
- View builds and deprecated image names
229+
- Clickable links to Admin Panel
197230

198-
---
231+
###Query Prometheus metric
232+
233+
You can query the metric directly:
234+
235+
```promql
236+
sum(
237+
rate(
238+
codefresh_engine_deprecated_images_pulled_total[$__rate_interval]
239+
)
240+
) by (account_name, pipeline_id, workflow, image_name)
241+
```
199242

200-
## Related Links
243+
Example deprecated images:
244+
-`docker.io/tutum/dnsutils:latest`
245+
-`docker.io/docker/whalesay:latest`
201246

202-
-[Upgrade Docker images pipeline example](https://gist.github.com/francisco-cocozza/6046028184cc12b5ee4513bdcb4217c5)
203-
-[kube-prometheus-stack on ArtifactHub](https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack)
247+
Pulled in Pipeline:`#67867cfe8307bd8f9b7b034e`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp