add the old snippet md files
This commit is contained in:
parent
fc0dd204c7
commit
bcf8313a4b
110 changed files with 3048 additions and 0 deletions
31
old_snippets/k8s-reg-secret.en.md
Normal file
31
old_snippets/k8s-reg-secret.en.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
title: "creating k8s registry secrets"
|
||||
date: 2020-03-29T20:43:14+02:00
|
||||
draft: false
|
||||
snippet_types: ["kubernetes"]
|
||||
---
|
||||
|
||||
Hosting side projects in kubernetes and using gitlab container registry? This
|
||||
is the command I run to create the needed secret for the cluster to pull the
|
||||
image:
|
||||
|
||||
```shell
|
||||
$ kubectl create secret docker-registry cool-project-gitlab \
|
||||
--docker-server=registry.gitlab.com \
|
||||
--docker-username=gitlab+deploy-token-666666 \
|
||||
--docker-password=xxxxxxxxxxxxxxxxxxxx \
|
||||
--docker-email=xxxxxxxxx@xmail.com
|
||||
```
|
||||
|
||||
Then in the deployment.yml use the gitlab registry image and newly created image
|
||||
secret:
|
||||
|
||||
```yaml
|
||||
containers:
|
||||
image: registry.gitlab.com/btbtravis/cool-project:0.0.1
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: cool-project-api
|
||||
imagePullSecrets:
|
||||
- name: cool-projects-gitlab
|
||||
```
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue