<commit_before># The Chart Repository Guide

## Prerequistes
* Go through the [Quickstart](quickstart.md) Guide
* Read through the [Charts](charts.md) document

## Create a chart repository
A _chart repository_ is an HTTP server that houses one or more packaged charts. When you're ready to share your charts, the preferred mechanism is a chart repository. You can contribute to the official helm chart repository or create your own. Here we'll talk about creating your own chart repository.

Because a chart repository can be any HTTP server that can serve YAML and tar files and can answer GET requests, you have a plethora of options when it comes down to hosting your own chart repository. For example, you can use a Google Cloud Storage (GCS) bucket, Amazon S3 bucket, Github Pages, or even create your own web server.

### The chart repository structure
A chart repository consists of packaged charts and a special file called `index.yaml` which contains an index of all of the charts in the repository. A chart repository has a flat structure. Given a repository URL, you should be able to download a chart via a GET request to `URL/chartname-version.tgz`.

For example, if a repository lives at the URL: `https://helm-charts.com`, the `alpine-0.1.0` chart would live at `https://helm-charts.com/alpine-0.1.0.tgz`. The index file would also live in the same chart repository at `https://helm-charts.com/index.yaml`.

#### The index file
The index file is a yaml file called `index.yaml`. It contains some metadata about the package as well as a dump of the Chart.yaml file of a packaged chart. A valid chart repository must have an index file. The index file contains information about each chart in the chart repository. The `helm repo index` command will generate an index file based on a given local directory that contains packaged charts.

This is an example of an index file:
```
apiVersion: v1
entries:
  nginx:
    - urls:
        - http://storage.googleapis.com/kubernetes-charts/nginx-0.1.0.tgz
      name: nginx
      description: string
      version: 0.1.0
      home: https://github.com/something
      digest: "sha256:1234567890abcdef"
      keywords:
        - popular
        - web server
        - proxy
    - urls:
        - http://storage.googleapis.com/kubernetes-charts/nginx-0.2.0.tgz
      name: nginx
      description: string
      version: 0.2.0
      home: https://github.com/something/else
      digest: "sha256:1234567890abcdef"
      keywords:
        - popular
        - web server
        - proxy
  alpine:
    - urls:
        - http://storage.googleapis.com/kubernetes-charts/alpine-1.0.0.tgz
        - http://storage2.googleapis.com/kubernetes-charts/alpine-1.0.0.tgz
      name: alpine
      description: string
      version: 1.0.0
      home: https://github.com/something
      keywords:
        - linux
        - alpine
        - small
        - sumtin
      digest: "sha256:1234567890abcdef"
```

We will go through detailed GCS and Github Pages examples here, but feel free to skip to the next section if you've already created a chart repository.

##### GCS bucket example

The first step will be to **create your GCS bucket**. We'll call ours `fantastic-charts`.

![Create a GCS Bucket](images/create-a-bucket.png)

Next, you'll want to make your bucket public, so you'll want to **edit the bucket permissions**.

![Edit Permissions](images/edit-permissions.png)

Insert this line item to **make your bucket public**:

![Make Bucket Public](images/make-bucket-public.png)

Congratulations, now you have an empty GCS bucket ready to serve charts!

##### Github Pages example
<commit_msg>docs(chart_repositories): document correct index example<commit_after># The Chart Repository Guide

## Prerequistes
* Go through the [Quickstart](quickstart.md) Guide
* Read through the [Charts](charts.md) document

## Create a chart repository
A _chart repository_ is an HTTP server that houses one or more packaged charts. When you're ready to share your charts, the preferred mechanism is a chart repository. You can contribute to the official helm chart repository or create your own. Here we'll talk about creating your own chart repository.

Because a chart repository can be any HTTP server that can serve YAML and tar files and can answer GET requests, you have a plethora of options when it comes down to hosting your own chart repository. For example, you can use a Google Cloud Storage (GCS) bucket, Amazon S3 bucket, Github Pages, or even create your own web server.

### The chart repository structure
A chart repository consists of packaged charts and a special file called `index.yaml` which contains an index of all of the charts in the repository. A chart repository has a flat structure. Given a repository URL, you should be able to download a chart via a GET request to `URL/chartname-version.tgz`.

For example, if a repository lives at the URL: `https://helm-charts.com`, the `alpine-0.1.0` chart would live at `https://helm-charts.com/alpine-0.1.0.tgz`. The index file would also live in the same chart repository at `https://helm-charts.com/index.yaml`.

#### The index file
The index file is a yaml file called `index.yaml`. It contains some metadata about the package as well as a dump of the Chart.yaml file of a packaged chart. A valid chart repository must have an index file. The index file contains information about each chart in the chart repository. The `helm repo index` command will generate an index file based on a given local directory that contains packaged charts.

This is an example of an index file:

```
apiVersion: v1
entries:
  alpine:
  - created: 2016-10-06T16:23:20.499814565-06:00
    description: Deploy a basic Alpine Linux pod
    digest: 99c76e403d752c84ead610644d4b1c2f2b453a74b921f422b9dcb8a7c8b559cd
    home: https://k8s.io/helm
    name: alpine
    sources:
    - https://github.com/kubernetes/helm
    urls:
    - https://technosophos.github.io/tscharts/alpine-0.2.0.tgz
    version: 0.2.0
  - created: 2016-10-06T16:23:20.499543808-06:00
    description: Deploy a basic Alpine Linux pod
    digest: 515c58e5f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cd78727
    home: https://k8s.io/helm
    name: alpine
    sources:
    - https://github.com/kubernetes/helm
    urls:
    - https://technosophos.github.io/tscharts/alpine-0.1.0.tgz
    version: 0.1.0
  nginx:
  - created: 2016-10-06T16:23:20.499543808-06:00
    description: Create a basic nginx HTTP server
    digest: aaff4545f79d8b2913a10cb400ebb6fa9c77fe813287afbacf1a0b897cdffffff
    home: https://k8s.io/helm
    name: nginx
    sources:
    - https://github.com/kubernetes/charts
    urls:
    - https://technosophos.github.io/tscharts/nginx-1.1.0.tgz
    version: 1.1.0
generated: 2016-10-06T16:23:20.499029981-06:00
```

We will go through detailed GCS and Github Pages examples here, but feel free to skip to the next section if you've already created a chart repository.

##### GCS bucket example

The first step will be to **create your GCS bucket**. We'll call ours `fantastic-charts`.

![Create a GCS Bucket](images/create-a-bucket.png)

Next, you'll want to make your bucket public, so you'll want to **edit the bucket permissions**.

![Edit Permissions](images/edit-permissions.png)

Insert this line item to **make your bucket public**:

![Make Bucket Public](images/make-bucket-public.png)

Congratulations, now you have an empty GCS bucket ready to serve charts!

##### Github Pages example

{'fraction_non_alphanumeric': 0.08223948566836324, 'fraction_numerical': 0.042191267077417625, 'mean_word_length': 3.5669724770642204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5290592', 'n_tokens_mistral': 2385, 'n_tokens_neox': 2118, 'n_words': 907}