Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helm Chart Service (helm serve) (#42)
- Loading branch information
Showing
170 changed files
with
224 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Override for Makefile | ||
[{Makefile, makefile, GNUmakefile}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[Makefile.*] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ Session.vim | |
**/requirements.lock | ||
|
||
**/**/.values.yaml | ||
|
||
build-harness |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM alpine | ||
|
||
ADD rootfs / | ||
|
||
ADD ./ /charts | ||
|
||
WORKDIR /charts | ||
|
||
ENV CURRENT_REPO_URL= | ||
|
||
RUN set -ex \ | ||
&& apk update \ | ||
&& apk add --no-cache \ | ||
curl \ | ||
git \ | ||
make \ | ||
bash \ | ||
&& make init \ | ||
&& make helm:install \ | ||
&& make helm:repo:add-remote \ | ||
&& make helm:repo:build REPO_NAME=incubator \ | ||
&& make helm:repo:build REPO_NAME=stable ; | ||
|
||
EXPOSE 8879 | ||
|
||
ENTRYPOINT ["sh", "-c"] | ||
|
||
CMD ["/init.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,14 @@ | ||
ifneq ($(TRAVIS_PULL_REQUEST_BRANCH),) | ||
BRANCH=pr-$(TRAVIS_PULL_REQUEST_BRANCH) | ||
else ifneq ($(TRAVIS_BRANCH),) | ||
BRANCH=$(TRAVIS_BRANCH) | ||
else ifneq ($(TRAVIS_TAG),) | ||
BRANCH=$(TRAVIS_TAG) | ||
else | ||
BRANCH=$(shell git rev-parse --abbrev-ref HEAD) | ||
endif | ||
SHELL = /bin/bash | ||
export BUILD_HARNESS_PATH ?= $(shell until [ -d "build-harness" ] || [ "`pwd`" == '/' ]; do cd ..; done; pwd)/build-harness | ||
-include $(BUILD_HARNESS_PATH)/Makefile | ||
|
||
ifeq ($(BRANCH),master) | ||
export REPO_URL ?= https://charts.cloudposse.com | ||
else | ||
export REPO_URL ?= https://charts.dev.cloudposse.com/$(BRANCH) | ||
endif | ||
|
||
all: package index | ||
|
||
.PHONY : fix-perms | ||
## Fix filesystem permissions | ||
fix-perms: | ||
@find . -type f -name '*.yaml' -exec chmod 644 {} \; | ||
@find . -type f -name '*.txt' -exec chmod 644 {} \; | ||
@find . -type f -name '*.tpl' -exec chmod 644 {} \; | ||
@find . -type f -name '*.md' -exec chmod 644 {} \; | ||
@find . -type f -name '*.tgz' -exec chmod 644 {} \; | ||
|
||
.PHONY : info | ||
## Show information about each repo | ||
info: | ||
@make -C stable $@ | ||
@make -C incubator $@ | ||
|
||
.PHONY : package | ||
## Generate packages of all charts | ||
package: | ||
@make -C stable $@ | ||
@make -C incubator $@ | ||
|
||
.PHONY : index | ||
## Index all packages | ||
index: | ||
@make -C stable $@ | ||
@make -C incubator $@ | ||
.PHONY : init | ||
## Init build-harness | ||
init: | ||
@curl --retry 5 --retry-delay 1 https://raw.githubusercontent.com/cloudposse/build-harness/master/bin/install.sh | bash | ||
|
||
.PHONY : clean | ||
## Clean up | ||
## Clean build-harness | ||
clean: | ||
@make -C stable $@ | ||
@make -C incubator $@ | ||
@rm -rf $(BUILD_HARNESS_PATH) | ||
|
||
.PHONY : lint | ||
## Lint | ||
lint: | ||
@make -C stable/library $@ | ||
@make -C incubator/library $@ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
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.
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.
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.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: v1 | ||
description: A Helm chart that implements the `helm serve` repository server for Helm on Kubernetes | ||
name: helm-serve | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
1. Get the application URL by running these commands: | ||
{{- if contains "NodePort" .Values.service.type }} | ||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) | ||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") | ||
echo http://$NODE_IP:$NODE_PORT/login | ||
{{- else if contains "LoadBalancer" .Values.service.type }} | ||
NOTE: It may take a few minutes for the LoadBalancer IP to be available. | ||
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' | ||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') | ||
echo http://$SERVICE_IP:{{ .Values.service.externalPort }} | ||
{{- else if contains "ClusterIP" .Values.service.type }} | ||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") | ||
echo "Visit http://127.0.0.1:8080 to use your application" | ||
kubectl port-forward $POD_NAME 8080:{{ .Values.service.externalPort }} | ||
{{- end }} | ||
|
||
To install helm charts run | ||
|
||
helm repo add {{ template "fullname" . }}-incubator {{ template "server_url" . }}/incubator | ||
helm repo add {{ template "fullname" . }}-stable {{ template "server_url" . }}/stable | ||
|
||
helm install {{ template "fullname" . }}-incubator/{CHART NAME} | ||
|
||
WARNING: Be sure that {{ template "server_url" . }} resolves correctly from place you want to install helm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 24 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "fullname" -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 24 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
*/}} | ||
{{- define "server_url" -}} | ||
{{- if empty .Values.url -}} | ||
{{- if .Values.service.externalPort | quote | eq "443" }} | ||
https://{{ template "fullname" . }}.{{ .Release.Namespace }} | ||
{{- else -}} | ||
http://{{ template "fullname" . }}.{{ .Release.Namespace }}:{{ .Values.service.externalPort }} | ||
{{- end -}} | ||
{{- else -}} | ||
{{ .Values.url }} | ||
{{- end -}} | ||
{{- end -}} |
Oops, something went wrong.