Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6dd7525

Browse files
authored
Proj one guides (#287)
* Add CI CD guides content* Update topics* Complete porting content to CI/CD guidesPorted content from Classic to ProjectOne for CI/CD guides, and updated home and nav yamls* Update docker registry and config maps in guides* Update ci cd guides* Updates* Update
1 parent34493d1 commit6dd7525

File tree

157 files changed

+21370
-7
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+21370
-7
lines changed

‎_data/home-content.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11

22

3+
4+
-title:CI/CD guides
5+
icon:images/home-icons/guides.png
6+
url:''
7+
links:
8+
-title:Building your app
9+
localurl:/docs/ci-cd-guides/packaging-compilation/
10+
-title:Building Docker images
11+
localurl:/docs/ci-cd-guides/building-docker-images/
12+
-title:Accessing a Docker registry from Kubernetes cluster
13+
localurl:/docs/ci-cd-guides/access-docker-registry-from-kubernetes/
14+
-title:Working with Docker registries
15+
localurl:/docs/ci-cd-guides/working-with-docker-registries/
16+
-title:Adding config maps to namespaces
17+
localurl:/docs/ci-cd-guides/add-config-maps-to-your-namespaces/
18+
-title:Pull Requests and branches
19+
localurl:/docs/ci-cd-guides/pull-request-branches/
20+
-title:Pipelines for microservices
21+
localurl:/docs/ci-cd-guides/microservices/
22+
-title:Deploying to predefined environments
23+
localurl:/docs/ci-cd-guides/environment-deployments/
24+
-title:Previewing dynamic environments
25+
localurl:/docs/ci-cd-guides/preview-environments/
26+
-title:Helm best practices
27+
localurl:/docs/ci-cd-guides/helm-best-practices/
28+
-title:Templating for Kubernetes
29+
localurl:/docs/ci-cd-guides/kubernetes-templating/
30+
-title:Progressive Delivery
31+
localurl:/docs/ci-cd-guides/progressive-delivery/
32+
33+
334
-title:Example catalog
435
icon:images/home-icons/tutorial.svg
536
url:''
@@ -154,5 +185,6 @@
154185

155186

156187

188+
157189

158190

‎_data/nav.yml‎

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11

22

3+
4+
-title:CI/CD Guides
5+
url:"/ci-cd-guides"
6+
pages:
7+
-title:Building your app
8+
url:"/packaging-compilation"
9+
-title:Building Docker images
10+
url:"/building-docker-images"
11+
-title:Accessing Docker registries from Kubernetes cluster
12+
url:"/access-docker-registry-from-kubernetes"
13+
-title:Working with Docker registries
14+
url:"/working-with-docker-registries"
15+
-title:Adding config maps to namespaces
16+
url:"/add-config-maps-to-your-namespaces"
17+
-title:Pull Requests and branches
18+
url:"/pull-request-branches"
19+
-title:Building microservices
20+
url:"/microservices"
21+
-title:Deploying to predefined environments
22+
url:"/environment-deployments"
23+
-title:Previewing dynamic environments
24+
url:"/preview-environments"
25+
-title:Progressive delivery
26+
url:"/progressive-delivery"
27+
-title:GitOps deployments
28+
url:"/gitops-deployments"
29+
-title:Helm best practices
30+
url:"/helm-best-practices"
31+
-title:Kubernetes templating
32+
url:"/kubernetes-templating"
33+
34+
335

436

537
-title:Example catalog
@@ -266,6 +298,7 @@
266298
url:"/csdp-cli"
267299

268300

301+
269302
-title:Installation
270303
url:"/installation"
271304
pages:
@@ -290,7 +323,6 @@
290323
-title:Add Git Sources to to GitOps Runtimes
291324
url:"/git-sources"
292325

293-
294326
-title:Administration
295327
url:"/administration"
296328
pages:
@@ -378,3 +410,4 @@
378410
url:"/sla"
379411

380412

413+
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
title:"Accessing Docker registry from Kubernetes cluster"
3+
description:"Allow Kubernetes to pull Docker images from your registry"
4+
group:ci-cd-guides
5+
toc:true
6+
---
7+
8+
Kubernetes deployments are based on a "pull" approach. When you deploy your application to a Kubernetes
9+
cluster, instead of uploading the application itself, as in traditional deployments, Kubernetes pulls the Docker images to its nodes on its own.
10+
11+
12+
{% include
13+
image.html
14+
lightbox="true"
15+
file="/images/getting-started/quick-start-k8s/overview.png"
16+
url="/images/getting-started/quick-start-k8s/overview.png"
17+
alt="Kubernetes deployments"
18+
caption="Kubernetes deployments"
19+
max-width="80%"
20+
%}
21+
22+
If your Docker images are in a public repository such as Docker Hub, Kubernetes can pull them right away. In most cases however your images are in a private Docker registry and Kubernetes must be given explicit access to it.
23+
24+
Use[Docker registry secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/){:target="\_blank"} to give Kubernetes access to private Docker registries. When there is a deployment, each Kubernetes pod can pull Docker images directly from the target registry.
25+
26+
##Giving access to a Docker Registry via the UI
27+
28+
Codefresh allows you to easily create and pull secrets for your cluster.
29+
30+
1. In the Codefresh UI, set up an integration with your[Docker registry in Codefresh]({{site.baseurl}}/docs/integrations/docker-registries/).
31+
Codefresh can work with any compliant Docker registry either in the cloud or behind the firewall.
32+
33+
1. To view the Kubernetes dashboard, from the Ops section in the sidebar, select[**Kubernetes Services**](https://g.codefresh.io/kubernetes/services/){:target="\_blank"}.
34+
1. Click**Add Service**.
35+
1. Do the following:
36+
* Select your**Cluster** and**Namespace** from the respective lists.
37+
* From the**Image Pull Secret** dropdown with all the pull secrets for the selected namespace, select**Create Registry Pull secret**.
38+
* From the list of all the connected Docker registries in Codefresh, select the registry you want.
39+
Codefresh automatically creates a secret for you.
40+
41+
{% include
42+
image.html
43+
lightbox="true"
44+
file="/images/guides/kubernetes/create-secret.png"
45+
url="/images/guides/kubernetes/create-secret.png"
46+
alt="Create Pull Secret"
47+
caption="Create Pull Secret"
48+
max-width="80%"
49+
%}
50+
51+
52+
>The secret is created as soon as you select your Docker registry from the dropdown. There is no need to actually deploy anything from this screen for the changes to take effect.
53+
54+
{% include
55+
image.html
56+
lightbox="true"
57+
file="/images/guides/kubernetes/secret-dropdown.png"
58+
url="/images/guides/kubernetes/secret-dropdown.png"
59+
alt="Docker Registry Access"
60+
caption="Docker Registry Access"
61+
max-width="80%"
62+
%}
63+
64+
From now on, the cluster in this namespace can deploy Docker images from the selected registry.
65+
To apply the changed secret, you don't really need to finish the deployment. Feel free to
66+
close the screen and go to another Codefresh page.
67+
68+
>Codefresh automatically uses the secret you defined in all deployments that are performed via the UI by dynamically creating the correct manifests for you behind the scenes.
69+
If you wish to use your own manifests, you need to include the secret yourself, as explained in the next section.
70+
71+
72+
##Giving access to a Docker Registry with kubectl
73+
74+
You can also use the`kubectl` command directly to give access to a Docker registry.
75+
As this method is not specific to Codefresh, read the[official kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/){:target="\_blank"}.
76+
77+
78+
###Creating the Docker registry secret
79+
80+
The credentials depend upon the[type of registry]({{site.baseurl}}/docs/integrations/docker-registries/) you use.
81+
82+
- The Docker server to use is a domain such`gcr.io`,`azurecr.io`
83+
- The username is your account username.
84+
- The password is a specific Docker registry password or any other kind of token. You need to check the documentation of your registry provider for the exact details.
85+
86+
>Be sure to create the secret in the namespace in which your application will run.
87+
Pull secrets are specific to a namespace. If you want to deploy to multiple namespaces, you need to create a secret for each one of them.
88+
89+
This is an example of creating a pull secret to the Azure registry. You can use the same command for any other private registry.
90+
91+
`Shell`
92+
{% highlight sh %}
93+
{% raw %}
94+
95+
export DOCKER_REGISTRY_SERVER=mysampleregistry.azurecr.io
96+
export DOCKER_USER=myregistryname
97+
export DOCKER_PASSWORD=myregistrytoken
98+
export DOCKER_EMAIL=YOUR_EMAIL
99+
100+
kubectl create secret docker-registry cfcr\
101+
--docker-server=$DOCKER_REGISTRY_SERVER\
102+
--docker-username=$DOCKER_USER\
103+
--docker-password=$DOCKER_PASSWORD\
104+
--docker-email=$DOCKER_EMAIL
105+
{% endraw %}
106+
{% endhighlight %}
107+
108+
###Using the Docker registry secret
109+
110+
To use the secret you just created, you need to include it, either in:
111+
112+
* Your[pod manifests](https://kubernetes.io/docs/concepts/containers/#specifying-imagepullsecrets-on-a-pod){:target="\_blank"}
113+
* The[service account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#add-imagepullsecrets-to-a-service-account){:target="\_blank"}
114+
115+
For Docker registry secret usage, we recommend following the official Kubernetes documentation.
116+
117+
##Giving access to a Docker Registry via the Codefresh CLI
118+
119+
The Codefresh CLI can also create pull secrets in an automated manner.
120+
121+
See[Image pull Secret](https://codefresh-io.github.io/cli/more/image-pull-secret/){:target="\_blank"}.
122+
123+
##Related articles
124+
[Deploy to Kubernetes - quick start]({{site.baseurl}}/docs/getting-started/deployment-to-kubernetes-quick-start-guide/)
125+
[Managing your cluster]({{site.baseurl}}/docs/deployments/kubernetes/manage-kubernetes/)
126+
127+
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
title:"Adding config maps to namespaces"
3+
description:"Manage Kubernetes Config Maps with Codefresh"
4+
group:ci-cd-guides
5+
toc:true
6+
---
7+
Many applications require configuration with files, environment variables, and command line arguments. It makes applications portable and easily manageable. While this makes for easy configuration, it can become very hard to support tons of config files for different environments and hundreds of microservices.
8+
9+
Kubernetes provides an elegant and very convenient way for application configuration, using*configuration maps*. You can find more details about config maps at[https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/){:target="_blank"}.
10+
11+
You can manage all your cluster configuration using Codefresh.
12+
13+
##View existing config maps
14+
15+
1. In the Codefresh UI, from the Ops section in the sidebar, select[**Kubernetes Services**](https://g.codefresh.io/kubernetes/services/){:target="\_blank"}.
16+
1. Switch to list view.
17+
18+
{% include
19+
image.html
20+
lightbox="true"
21+
file="/images/guides/config-maps/change-view.png"
22+
url="/images/guides/config-maps/change-view.png"
23+
alt="Change View"
24+
caption="Change View"
25+
max-width="50%"
26+
%}
27+
28+
{:start="3"}
29+
1. Select a namespace and hover over it.
30+
1. Click the**Settings** icon which appears at the end of the row.
31+
A list of all config maps within this namespace are displayed, including date of creation and number of configuration variables inside these maps.
32+
33+
34+
35+
##Add a new config map
36+
37+
1. From the list of config maps, click**Create a New Config Map**.
38+
39+
{% include image.html
40+
lightbox="true"
41+
file="/images/guides/config-maps/manage-maps-namespace.png"
42+
url="/images/guides/config-maps/manage-maps-namespace.png"
43+
alt="Create a new config map in namespace"
44+
caption="Create a new config map in namespace"
45+
max-width="40%"
46+
%}
47+
48+
{:start="2"}
49+
1. In the Add a New Config Map form, enter a**Name**, add variables, as described in[Managing variables in your config maps](#managing-variables-in-config-maps), and then click**Create**.
50+
51+
{% include image.html
52+
lightbox="true"
53+
file="/images/guides/config-maps/new-config-map-settings.png"
54+
url="/images/guides/config-maps/new-config-map-settings.png"
55+
alt="Define settings for new config map"
56+
caption="Define settings for new config map"
57+
max-width="40%"
58+
%}
59+
60+
###Managing variables in config maps
61+
There are three options to add variables to config maps:
62+
1. Add a single variable at a time
63+
1. Add multiple variables by copying and pasting from text or file
64+
1. Import a set of variables from an existing config map
65+
66+
67+
####Add a single variable to config map
68+
69+
This is the easiest way to add a variable to the config map. This method is very useful to quickly create a small configmap with 1-2 variables:
70+
1. Enter Key name and the Key value
71+
1. Click**Add Variable**.
72+
73+
{% include image.html
74+
lightbox="true"
75+
file="/images/guides/config-maps/add-new-single-variable.png"
76+
url="/images/guides/config-maps/add-new-single-variable.png"
77+
alt="Add single variable at a time to config map"
78+
caption="Add single variable at a time to config map"
79+
max-width="40%"
80+
%}
81+
82+
83+
####Import variables from text/file
84+
If you already have configuration variables in a`*.property` file, you can easily import it to your configmap.
85+
86+
**Import from text**:
87+
88+
89+
1. Click**Import from text**.
90+
1. Copy text from file and paste it within the text area in the required format.
91+
1. Click**Apply**.
92+
93+
{% include image.html
94+
lightbox="true"
95+
file="/images/guides/config-maps/import-variables-from-text.png"
96+
url="/images/guides/config-maps/import-variables-from-text.png."
97+
alt="Add multiple variables from text or file to config map"
98+
caption="Add multiple variables from text or file to config map"
99+
max-width="40%"
100+
%}
101+
102+
**Import from file**:
103+
104+
1. Click**Import from file**.
105+
1. Select the file from your computer, and click**Open**.
106+
107+
108+
####Copy variables from existing config map
109+
110+
You can easily copy the variables from an existing config map file, and use it in other namespaces.
111+
112+
1. Click**Copy from Existing Config Map**.
113+
1. Select the**Cluster** and**Namespace** from which to copy the configmap.
114+
1. Select the configmap from the list, and click**Select**.
115+
116+
{% include image.html
117+
lightbox="true"
118+
file="/images/guides/config-maps/select-cluster-namespace.png"
119+
url="/images/guides/config-maps/select-cluster-namespace.png"
120+
alt="Copy variables from existing config map"
121+
caption="Copy variables from existing config map"
122+
max-width="40%"
123+
%}
124+
125+
###Edit/remove variables in config maps
126+
You can easily edit or remove variables in your config maps.
127+
128+
1. Select the config map with the variables to modify or remove.
129+
1. Click the**Edit** (pencil) icon.
130+
1. Add new variables, as described in[Managing variables in your config maps](#managing-variables-in-config-maps).
131+
132+
{% include image.html
133+
lightbox="true"
134+
file="/images/guides/config-maps/edit-remove-config-map-variables.png"
135+
url="/images/guides/config-maps/edit-remove-config-map-variables.png"
136+
alt="Edit/remove variables in config maps"
137+
caption="Edit/remove variables in config maps"
138+
max-width="40%"
139+
%}
140+
141+
To remove a config map, click on "remove" icon in the selected row. After your confirmation, the configmap will be removed.
142+
143+
##Related articles
144+
[Connect to your Kubernetes cluster]({{site.baseurl}}/docs/integrations/add-kubernetes-cluster/)
145+
[Manage your Kubernetes cluster]({{site.baseurl}}/docs/deployments/kubernetes/manage-kubernetes/)
146+
[Deploy to Kubernetes - quick start]({{site.baseurl}}/docs/getting-started/deployment-to-kubernetes-quick-start-guide/)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp