Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

docker tag nginx-jmehan:latest localhost:30500/nginx-jmehan:latest

docker push localhost:30500/nginx-jmehan:latest


Verify that it is in the registry

curl --user test:testpw localhost:30500/v2/_catalog


Code Block
{"repositories":["nginx-jmehan"]}



Configure a node that uses the new image

vi nginx-jmehan.yml


Code Block
titleExample: nginx pulled from registry
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: nginx-jmehan
spec:
  selector:
    matchLabels:
      app: nginx-jmehan
  replicas: 1 # tells deployment to run 2 pods matching the template
  template:
    metadata:
      labels:
        app: nginx-jmehan
    spec:
      containers:
      - name: nginx-jmehan
        image: localhost:30500/nginx-jmehan:latest
        ports:
        - containerPort: 80
      imagePullSecrets:
      - name: regcred
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-jmehan
spec:
  type: NodePort
  selector:
    app: nginx-jmehan
  ports:
    - port: 80
      nodePort: 31081
      name: nginx-jmehan

...