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

Commit1382890

Browse files
committed
Add info on how to push charts to managed repos etc
1 parent1f35310 commit1382890

File tree

1 file changed

+98
-32
lines changed

1 file changed

+98
-32
lines changed

‎_docs/new-helm/managed-helm-repository.md‎

Lines changed: 98 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,72 +9,138 @@ Codefresh provides fully managed, hosted Helm repositories for users.
99
A default managed repo is created automatically for every account.
1010
The managed repo is private by default, allowing access only via Codefresh or using a Codefresh API token.
1111

12-
>You may be familiar with the popular open source Helm repository implementation called 'Chart Museum' that Codefresh sponsors. Codefresh managed repositories are based on, and therefore compatible with Chart Museum and it's unique features. For more info on Chart Museum:[https://github.com/kubernetes-helm/chartmuseum](https://github.com/kubernetes-helm/chartmuseum).
12+
>You may be familiar with the popular open source Helm repository implementation called 'ChartMuseum' that Codefresh sponsors. Codefresh managed repositories are based on, and therefore compatible with ChartMuseum and it's unique features. For more info on ChartMuseum:[https://github.com/kubernetes-helm/chartmuseum](https://github.com/kubernetes-helm/chartmuseum).
13+
1314

1415
##Helm repository integration
1516

16-
Your managedhelm repo will appear under the Helm repositories integration section just like any other Helm repository you might have added. You can manage Helm repo connections under*Account settings -> Integrations -> Helm repositories*.
17+
Your managedHelm repo will appear under the Helm repositories integration section just like any other Helm repository you might have added. You can manage Helm repo connections under*Account settings -> Integrations -> Helm repositories*.
1718

1819
Note that you cannot delete the out-of-the-box managed repo that is created for you.
1920

2021
##Chart Repository URL
2122

22-
You can find your managed repository URL in the Helm integration section. The URL will take the form of:`https://h.cfcr.io/<accountname>/<reponame>`, where the default repo is called`default`.
23-
This URL serve the`index.yaml` that Helm cli expects, and also supports the Chart Museum extended API, so you can push and delete charts as well.
23+
You can find your managed repository URL in the Helm integration section. The URL will take the form of
2424

25-
##Codefresh Helm dashboards
25+
`h.cfcr.io/<accountname>/<reponame>`
2626

27-
The Codefresh Helm Charts and Helm Releases dashboards are automatically configured to wotk with yourdefaultmangedreposo you can easily install charts and manage releases. For more information see:[Install chart from Helm repository](https://codefresh.io/docs/docs/new-helm/add-helm-repository/#install-chart-from-your-helm-repository) and[Helm release management](https://codefresh.io/docs/docs/new-helm/helm-releases-management/) articles.
27+
where thedefault reponame is called`default`.
2828

29-
##Use Codefresh CLI for advanced management
29+
This URL serve the`index.yaml` that Helm cli expects, and also supports the ChartMuseum extended API, so you can push and delete charts as well.
3030

31-
The Codefresh CLI can be used for advanced management of your managed repository. For more information on CLI support for Helm repos, see the 'Helm Repos' section in the CLI documentation:[https://codefresh-io.github.io/cli/helm-repos/](https://codefresh-io.github.io/cli/helm-repos/).
31+
32+
##Using your Repo
33+
34+
###Prerequisites
35+
- Codefresh CLI. Install with`npm install -g codefresh`. See[here](https://codefresh-io.github.io/cli) for more info
36+
- Helm CLI. Please see[install instructions](https://docs.helm.sh/using_helm/#installing-helm)
37+
38+
###Setup
39+
Codefresh managed Helm repositories provide several features in addition to acting as a native Helm repository.
40+
41+
These additional features require using the ChartMuseum[helm-push](https://github.com/chartmuseum/helm-push) plugin. You can install it with:
42+
43+
```
44+
helm plugin install https://github.com/chartmuseum/helm-push
45+
```
46+
47+
This gives use the ability to push charts directly from Helm CLI, as well as the ability to use token-based authentication.
48+
49+
To authenticate to Codefresh via CLI, you can run
50+
51+
```
52+
codefresh auth create-context --api-key=<token>
53+
```
54+
55+
where`<token>` is a valid API Key obtained from the UI. For more instructions on how to obtain an API key, please see[here](https://codefresh-io.github.io/cli/getting-started/#authenticate).
56+
57+
Alternatively, you can set the`HELM_REPO_ACCESS_TOKEN` environment variable used by helm-push, which will take precedence over the authentication info set via CLI above:
58+
59+
```
60+
export HELM_REPO_ACCESS_TOKEN=<token>
61+
```
62+
63+
64+
###Adding your repo as a local Helm repository
65+
Run the following command to add your repo as a local Helm repository:
66+
67+
```
68+
helm repo add codefresh cm://h.cfcr.io/<accountname>/<reponame>
69+
```
70+
71+
From here you can download charts using commands such as`helm install` etc.
72+
73+
Notice the`cm://` protocol, which is used by the helm-push plugin to enable token-based authencation.
74+
75+
###Pushing a chart to your repo
76+
Start with a directory containing a valid`Chart.yaml` file, such as`mychart/`.
77+
78+
To upload your chart to your managed repo, run the following command:
79+
80+
```
81+
helm push mychart/ codefresh
82+
```
83+
84+
If you wish to override the version defined in`Chart.yaml`, you can supply the`--version` flag:
85+
86+
```
87+
helm push mychart/ --version="1.1.0" codefresh
88+
```
89+
90+
In order to discover and download your newly added chart, update you local repositories:
91+
92+
```
93+
helm repo update
94+
helm search codefresh/
95+
```
96+
97+
###Deleting a chart from your repo
98+
In the occasion that you must delete a chart version from your repo, you can use the ChartMuseum REST API:
99+
100+
```
101+
curl -X DELETE -v -H "Authorization: Bearer <token>" \
102+
https://h.cfcr.io/api/<accountname>/<reponame>/charts/mychart/1.1.0
103+
```
32104

33105
##Repo access level
34106

35-
The managed Helm repository supports two modes of access level: Private and Public.
36-
By default it is created as private which means read/write access is protected by Codefresh authentication.
37-
You can switch the access level to Public which will make the repository accessibe to anonymouse users only*for read operations*. write operations always require authentication even when in public access mode.
107+
The managed Helm repository supports two modes of access level: Private and Public.
108+
109+
By default it is created as private which means read/write access is protected by Codefresh authentication.
110+
111+
You can switch the access level to Public which will make the repository accessibe to anonymous users only*for read operations*. Write operations always require authentication even when in Public mode.
38112

39113
###Setting access level
40114

41115
Use the Codefresh CLI to toggle access level on a managed repo:
42116

43-
```bash
44-
codefresh patch helm-repo mycfrepo -public
117+
```
118+
codefresh patch helm-repo <reponame> --public=true # Make Public
119+
codefresh patch helm-repo <reponame> --public=false # Make Private
45120
```
46121

47122
For more info see the relevant section in the Codefresh CLI documentation:[https://codefresh-io.github.io/cli/helm-repos/update-helm-repo/](https://codefresh-io.github.io/cli/helm-repos/update-helm-repo/).
48123

49-
##Working with Helm CLI
124+
###Note on Public
50125

51-
###Add a Public repo toHelm
126+
If your repo is configured tobe publicly accessible, you are not required to authenticate against Codefresh or install the helm-push plugin as described above (for read operations).
52127

53-
If your repo is settopublic access mode, you can use it just like any other HTTP Helm repository, so you can do:
128+
You do not needtouse the special`cm://` protocol for adding your repo. You can add it using`https://`:
54129

55-
```bash
56-
helm repo addmycfrepo https://h.cfcr.io/<accountname>/<reponame>
130+
```
131+
helm repo addcodefresh https://h.cfcr.io/<accountname>/<reponame>
57132
```
58133

59-
###Using with Helm CLI
60-
61-
If your repo is set to private access mode (by default it is), then the Helm client needs to authenticate with Codefresh.
62-
In order to authenticate, you can use Chart Museum's 'Helm Push' plugin. This is a Helm CLI plugin that adds support for authentication, and chart manipulation on top of the Helm standard CLI.
63-
64-
We highly recomment that you familiarize yourself with the Helm Push plugin, at:[https://github.com/chartmuseum/helm-push](https://github.com/chartmuseum/helm-push).
134+
This URL can then be shared with others you wish to have access to your Helm charts.
65135

66-
###Add a Private repo to helm
136+
##Use Codefresh CLI for advanced management
67137

68-
Before you continue, make sure you have the repo URL (see[here](#Chart Repository URL)forinstructions), and a Codefresh API toke (see[here](https://codefresh-io.github.io/cli/getting-started/#authenticate) for instructions).
138+
The Codefresh CLI can be used for advanced management of your managed repository. For more information on CLI supportforHelm repos, see the 'Helm Repos' section in the CLI documentation:[https://codefresh-io.github.io/cli/helm-repos/](https://codefresh-io.github.io/cli/helm-repos/).
69139

70-
Use the HelmPush plugin to add a private repo:
140+
##Codefresh Helmdashboards
71141

72-
```bash
73-
export HELM_REPO_ACCESS_TOKEN="<Codefresh-API-token>"
74-
helm repo add chartmuseum cm://my.chart.repo.com
75-
```
142+
The Codefresh Helm Charts and Helm Releases dashboards are automatically configured to wotk with your default manged repo so you can easily install charts and manage releases. For more information see:[Install chart from Helm repository](https://codefresh.io/docs/docs/new-helm/add-helm-repository/#install-chart-from-your-helm-repository) and[Helm release management](https://codefresh.io/docs/docs/new-helm/helm-releases-management/) articles.
76143

77-
Notice the protocol is`cm://` instead of`https://` this indicates the custom authentication scheme supported by Chart Museum Helm Push plugin.
78144

79145
##Using in a Codefresh pipeline
80146

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp