Skip to content

Commit

Permalink
Setup Helm chart repository
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Sheehy <ssheehy@firescope.com>
  • Loading branch information
Steven Sheehy authored and slim-bean committed Apr 3, 2019
1 parent 947428d commit 625bf19
Show file tree
Hide file tree
Showing 27 changed files with 43 additions and 14 deletions.
16 changes: 15 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ workflows:
filters:
branches:
only: master
- publish-helm:
requires:
- test
- build
- lint
filters:
branches:
only: master
- deploy:
requires:
- publish
Expand All @@ -33,7 +41,7 @@ workflows:
# https://circleci.com/blog/circleci-hacks-reuse-yaml-in-your-circleci-config-with-yaml/
defaults: &defaults
docker:
- image: grafana/loki-build-image:rename-49e21d5-WIP
- image: grafana/loki-build-image:0.1.0
working_directory: /go/src/github.com/grafana/loki

jobs:
Expand Down Expand Up @@ -132,6 +140,12 @@ jobs:
docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" &&
make push-latest
publish-helm:
<<: *defaults
steps:
- checkout
- run: make helm-publish

deploy:
<<: *defaults
steps:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.pkg
.cache
*.output
*.tgz
mixin/vendor/
cmd/loki/loki
cmd/promtail/promtail
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ push-latest:
fi \
done

helm:
helm init -c
helm lint production/helm/loki
helm package production/helm/loki

helm-publish: helm
git config user.email "$CIRCLE_USERNAME@users.noreply.github.com"
git config user.name "${CIRCLE_USERNAME}"
git checkout gh-pages || (git checkout --orphan gh-pages && git rm -rf . > /dev/null)
mkdir -p charts
mv loki-*.tgz charts/
helm repo index charts/
git add charts/
git commit -m "[skip ci] Publishing helm chart: ${CIRCLE_SHA1}"
git push origin gh-pages

clean:
$(SUDO) docker rmi $(IMAGE_NAMES) >/dev/null 2>&1 || true
rm -rf $(UPTODATE_FILES) $(EXES) .cache
Expand Down
5 changes: 5 additions & 0 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ RUN curl -L -o /tmp/docker-$DOCKER_VER.tgz https://download.docker.com/linux/sta
tar -xz -C /tmp -f /tmp/docker-$DOCKER_VER.tgz && \
mv /tmp/docker/* /usr/bin && \
rm /tmp/docker-$DOCKER_VER.tgz
ENV HELM_VER="v2.13.1"
RUN curl -L -o /tmp/helm-$HELM_VER.tgz http://storage.googleapis.com/kubernetes-helm/helm-${HELM_VER}-linux-amd64.tar.gz && \
tar -xz -C /tmp -f /tmp/helm-$HELM_VER.tgz && \
mv /tmp/linux-amd64/helm /usr/bin/helm && \
rm -rf /tmp/linux-amd64 /tmp/helm-$HELM_VER.tgz
RUN go get \
github.com/golang/protobuf/protoc-gen-go \
github.com/gogo/protobuf/protoc-gen-gogoslick \
Expand Down
2 changes: 1 addition & 1 deletion production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For instructions on how to query Loki, see [our usage docs](../docs/usage.md).

## Using Helm to deploy on Kubernetes

There is a [Helm chart](helm/) to deploy Loki and promtail to Kubernetes.
There is a [Helm chart](helm/loki) to deploy Loki and promtail to Kubernetes.

## Build and Run From Source

Expand Down
File renamed without changes.
17 changes: 6 additions & 11 deletions production/helm/README.md → production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# Deploy Loki to Kubernetes with Helm
# Loki Helm Chart

## Prerequisites

Make sure you have the helm configure on your cluster:
Make sure you have Helm [installed](https://helm.sh/docs/using_helm/#installing-helm) and
[deployed](https://helm.sh/docs/using_helm/#installing-tiller) to your cluster. Then add
Loki's chart repository to Helm:

```bash
$ helm init
```

Clone `grafana/loki` repository and navigate to `production helm` directory:

```bash
$ git clone https://github.com/grafana/loki.git
$ cd loki/production/helm
$ helm repo add loki https://grafana.github.io/loki/charts
```

## Deploy Loki and Promtail to your cluster

```bash
$ helm install . -n loki --namespace <YOUR-NAMESPACE>
$ helm upgrade --install loki loki/loki
```

## Deploy Grafana to your cluster
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 625bf19

Please sign in to comment.