Last active
April 9, 2018 15:41
-
-
Save zofy29/0a9ccf51cf91d71302d43566b8b0413f to your computer and use it in GitHub Desktop.
Kubernetes pulls a private DockerHub image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run commands | |
kubectl create secret docker-registry registry_name \ | |
--docker-server=https://index.docker.io/v2/ \ | |
--docker-username=XXX \ | |
--docker-password=XXX \ | |
--docker-email=XXX | |
# Deployment.yaml | |
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: app_name | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: app_name | |
template: | |
metadata: | |
labels: | |
app: app_name | |
spec: | |
containers: | |
- image: user_name/image:1.0 | |
name: app_name | |
ports: | |
- containerPort: 80 | |
imagePullSecrets: | |
- name: registry_name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment