Skip to content

Instantly share code, notes, and snippets.

@flyotlin
Created August 5, 2022 14:48
Show Gist options
  • Save flyotlin/fbc86aea540b83d9b84615dc27333489 to your computer and use it in GitHub Desktop.
Save flyotlin/fbc86aea540b83d9b84615dc27333489 to your computer and use it in GitHub Desktop.
k8s deployment with image on private registry
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
# image 在 private registry 的位置以及 tag
image: registry.gitlab.com/flyotlin/my-app/my-app:latest
resources:
limits:
memory: "128Mi"
cpu: "500m"
# 讓 private registry authenticate k8s
imagePullSecrets:
- name: regcred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment