168 lines
		
	
	
	
		
			8.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			168 lines
		
	
	
	
		
			8.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <div class="credentials-dialog-element">
 | |
|   <div class="modal fade co-dialog wider">
 | |
|     <div class="modal-dialog">
 | |
|       <div class="modal-content">
 | |
|         <div class="modal-body" ng-show="credentials.loading">
 | |
|           <div class="cor-loader"></div>
 | |
|         </div>
 | |
|         <div class="co-tab-modal-body" ng-show="!credentials.loading">
 | |
|           <div class="co-tab-panel">
 | |
|             <!-- Tabs -->
 | |
|             <div class="cor-tabs" remember-cookie="quay.credentialsTab">
 | |
|               <span class="cor-tab" tab-active="true" tab-target="#cred-secret-{{ dialogID }}">
 | |
|                 <i class="fa" ng-class="entityIcon"></i> {{ secretTitle }}
 | |
|               </span>
 | |
| 
 | |
|               <span class="cor-tab" tab-target="#cred-kubernetes-{{ dialogID }}">
 | |
|                 <i class="fa kubernetes-icon icon"></i> Kubernetes Secret
 | |
|               </span>
 | |
| 
 | |
|               <span class="cor-tab" tab-target="#cred-rkt-{{ dialogID }}">
 | |
|                 <i class="fa rocket-icon icon"></i> rkt Configuration
 | |
|               </span>
 | |
| 
 | |
|               <span class="cor-tab" tab-target="#cred-docker-login-{{ dialogID }}">
 | |
|                 <i class="fa docker-icon icon"></i> Docker Login
 | |
|               </span>
 | |
| 
 | |
|               <span class="cor-tab" tab-target="#cred-docker-{{ dialogID }}">
 | |
|                 <i class="fa docker-icon icon"></i> Docker Configuration
 | |
|               </span>
 | |
| 
 | |
|               <span class="cor-tab" tab-target="#cred-mesos-{{ dialogID }}" quay-show="isDownloadSupported()">
 | |
|                 <i class="fa mesos-icon icon"></i> Mesos Credentials
 | |
|               </span>
 | |
|             </div>
 | |
| 
 | |
|             <!-- Tab contents -->
 | |
|             <div class="cor-tab-content">
 | |
|               <h3>
 | |
|                   Credentials for {{ credentials.username }}
 | |
|                   <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
 | |
|               </h3>
 | |
| 
 | |
|               <div id="cred-secret-{{ dialogID }}" class="tab-pane active">
 | |
|                 <label>{{ secretTitle }}:</label>
 | |
|                 <div class="copy-box" value="credentials.password"></div>
 | |
|                 <div class="help-text">
 | |
|                   Username is {{ credentials.username }} and password is the {{ secretTitle }}
 | |
|                 </div>
 | |
| 
 | |
|                 <div ng-transclude/>
 | |
|               </div>
 | |
| 
 | |
|               <div id="cred-kubernetes-{{ dialogID }}" class="tab-pane">
 | |
|                 <label>Step 1: Download secret</label>
 | |
|                 <div class="action-text">First, download the Kubernetes pull secret for the {{ entityTitle }}:</div>
 | |
|                 <ul class="action-bar">
 | |
|                   <li><a ng-click="downloadFile(getKubernetesFile(credentials))" ng-if="isDownloadSupported()"><i class="fa fa-download"></i> Download {{ getKubernetesFilename(credentials) }}</li></a>
 | |
|                   <li><a ng-click="viewFile(k8s)"><i class="fa fa-code"></i> View {{ getKubernetesFilename(credentials) }}</li></a>
 | |
|                 </ul>
 | |
| 
 | |
|                 <textarea class="form-control viewing-file" ng-if="k8s.viewingFile" readonly>{{ getKubernetesFile(credentials).contents }}</textarea>
 | |
| 
 | |
|                 <label>Step 2: Submit</label>
 | |
|                 <div class="action-text">Second, submit the secret to the cluster using this command:</div>
 | |
|                 <div class="copy-box" value="'kubectl create -f ' + getKubernetesFilename(credentials) + ' --namespace=NAMESPACEHERE'"></div>
 | |
| 
 | |
|                 <label>Step 3: Update Kubernetes configuration</label>
 | |
|                   <div class="action-text">
 | |
|                     Finally, <a href="http://kubernetes.io/docs/user-guide/images/#specifying-imagepullsecrets-on-a-pod" ng-safenewtab>add a reference to the secret to your Kuberenetes pod config</a> via an <code>imagePullSecrets</code> field. For example:
 | |
| 
 | |
|                     <pre>
 | |
| apiVersion: v1
 | |
| kind: Pod
 | |
| metadata:
 | |
|   name: somepod
 | |
|   namespace: all
 | |
| spec:
 | |
|   containers:
 | |
|     - name: web
 | |
|       image: {{ Config.SERVER_HOSTNAME }}/{{ getNamespace(credentials) }}/somerepo
 | |
|   <code style="font-weight: bold;">
 | |
|   imagePullSecrets:
 | |
|     - name: {{ getKubernetesSecretName(credentials) }}</code></pre>
 | |
|                   </div>
 | |
|               </div>
 | |
| 
 | |
|               <div id="cred-mesos-{{ dialogID }}" class="tab-pane">
 | |
|                 <label>Step 1: Download credentials bundle</label>
 | |
|                 <div class="action-text">First, download the Docker credentials file as a bundle:</div>
 | |
|                 <ul class="action-bar">
 | |
|                   <li><a ng-click="downloadFile(getMesosFile(credentials))" ng-if="isDownloadSupported()"><i class="fa fa-download"></i> Download {{ getMesosFilename(credentials) }}</li></a>
 | |
|                 </ul>
 | |
| 
 | |
|                 <label>Step 2: Copy credentials bundle</label>
 | |
|                 <div class="action-text">
 | |
|                   Second, copy the credentials bundle file <strong>{{ getMesosFilename(credentials) }}</strong>
 | |
|                   into a location accessible to Mesos:
 | |
|                 </div>
 | |
|                 <div class="copy-box" value="'cp ' + getMesosFilename(credentials) + ' /etc/'"></div>
 | |
| 
 | |
|                 <label>Step 3: Update Mesos configuration</label>
 | |
|                 <div class="action-text">
 | |
|                   Finally, <a href="https://mesosphere.github.io/marathon/docs/native-docker-private-registry.html" ng-safenewtab>add a reference to the bundle to your Mesos config</a> via a <code>uris</code> field. For example:
 | |
| 
 | |
|                   <pre>
 | |
| {
 | |
|   "id": "/some/name/or/id",
 | |
|   "cpus": 1,
 | |
|   "mem": 1024,
 | |
|   "instances": 1,
 | |
|   "container": {
 | |
|     "type": "DOCKER",
 | |
|     "docker": {
 | |
|       "image": "{{ Config.SERVER_HOSTNAME }}/{{ getNamespace(credentials) }}/somerepo",
 | |
|       "network": "HOST"
 | |
|     }
 | |
|   },
 | |
|   <code style="font-weight: bold;">
 | |
|   "uris":  [
 | |
|       "file:///etc/{{ getMesosFilename(credentials) }}"
 | |
|   ]</code>
 | |
| }</pre>
 | |
|                 </div>
 | |
|               </div>
 | |
| 
 | |
|               <div id="cred-rkt-{{ dialogID }}" class="tab-pane">
 | |
|                 <label>Step 1: Download credentials config</label>
 | |
|                 <div class="action-text">First, download the rkt credentials file for the {{ entityTitle }}:</div>
 | |
|                 <ul class="action-bar">
 | |
|                   <li><a ng-click="downloadFile(getRktFile(credentials))" ng-if="isDownloadSupported()"><i class="fa fa-download"></i> Download {{ getRktFilename(credentials) }}</li></a>
 | |
|                   <li><a ng-click="viewFile(rkt)"><i class="fa fa-code"></i> View {{ getRktFilename(credentials) }}</li></a>
 | |
|                 </ul>
 | |
| 
 | |
|                 <textarea class="form-control viewing-file" ng-if="rkt.viewingFile" readonly>{{ getRktFile(credentials).contents }}</textarea>
 | |
| 
 | |
|                 <label>Step 2: Write to disk</label>
 | |
|                 <div class="action-text">Second, place the file in the rkt configuration directory:</div>
 | |
|                 <div class="copy-box" value="'mv ' + getRktFilename(credentials) + ' /etc/rkt/auth.d/'"></div>
 | |
|               </div>
 | |
| 
 | |
|               <div id="cred-docker-login-{{ dialogID }}" class="tab-pane">
 | |
|                 <label>Run docker login</label>
 | |
|                 <div class="action-text">Enter the following command on the command line:</div>
 | |
|                 <div class="copy-box" value="getDockerLogin(credentials)"></div>
 | |
|               </div>
 | |
| 
 | |
|               <div id="cred-docker-{{ dialogID }}" class="tab-pane">
 | |
|                 <label>Step 1: Download credentials config</label>
 | |
|                 <div class="action-text">First, download the Docker credentials file for the {{ entityTitle }}:</div>
 | |
|                 <ul class="action-bar">
 | |
|                   <li><a ng-click="downloadFile(getDockerFile(credentials))" ng-if="isDownloadSupported()"><i class="fa fa-download"></i> Download {{ getDockerFilename(credentials) }}</li></a>
 | |
|                   <li><a ng-click="viewFile(docker)"><i class="fa fa-code"></i> View {{ getDockerFilename(credentials) }}</li></a>
 | |
|                 </ul>
 | |
| 
 | |
|                 <textarea class="form-control viewing-file" ng-if="docker.viewingFile" readonly>{{ getDockerFile(credentials).contents }}</textarea>
 | |
| 
 | |
|                 <label>Step 2: Write to disk</label>
 | |
|                 <div class="action-text">Second, place the file in the Docker configuration directory. <strong>Note:</strong> This will <strong>overwrite</strong> existing credentials:</div>
 | |
|                 <div class="copy-box" value="'mv ' + getDockerFilename(credentials) + ' ~/.docker/config.json'"></div>
 | |
|               </div>
 | |
|             </div>
 | |
|           </div>
 | |
|         </div><!-- /.co-tab-modal-body -->
 | |
|       </div><!-- /.modal-content -->
 | |
|     </div><!-- /.modal-dialog -->
 | |
|   </div><!-- /.modal -->
 | |
| </div>
 |