[英]Unable to pull jar file from JFrog Artifactory repo when running Spark job on K8's
[英]kubernetes k8 unable to pull latest image
您好,我在 kube.netes 工作。 下面是我用於部署的 k8。
apiVersion: apps/v1
kind: Deployment
metadata: #Dictionary
name: webapp
spec: # Dictionary
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
# maxUnavailable will set up how many pods we can add at a time
maxUnavailable: 50%
# maxSurge define how many pods can be unavailable during the rolling update
maxSurge: 1
selector:
matchLabels:
app: webapp
instance: app
template:
metadata: # Dictionary
name: webapplication
labels: # Dictionary
app: webapp # Key value paids
instance: app
annotations:
vault.security.banzaicloud.io/vault-role: al-dev
spec:
serviceAccountName: default
terminationGracePeriodSeconds: 30
containers: # List
- name: al-webapp-container
image: ghcr.io/my-org/al.web:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
resources:
requests:
memory: "1Gi"
cpu: "900m"
limits:
memory: "1Gi"
cpu: "1000m"
imagePullSecrets:
- name: githubpackagesecret
每當我將它部署到 kube.netes 中時,它都不會從 github 包中選擇最新的圖像。 我應該怎么做才能拉取最新圖像並使用最新圖像更新當前運行的 pod? 有人可以幫我解決這個問題。 任何幫助,將不勝感激。 謝謝
如果您使用相同的最新標簽進行部署,則有可能無法像相同的imageTag那樣獲得更新。
需要重新啟動 Pod,這樣它每次都會下載新圖像,如果仍然相同,則表明緩存圖像的構建存在問題。
您現在可以做什么來嘗試
kubectl rollout restart deploy <deployment-name> -n <namespace>
這將重啟 Pod,它將為所有 POD 獲取新圖像並檢查最新代碼是否正在運行。
因為你有 imagePullPolicy: Always 設置它應該總是拉圖像。 您可以在 pod 啟動時對 pod 執行 kubectl describe 以便我們可以播種日志嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.