Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Create a new install guide #479

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,21 @@ DOCKER_HELM_CMD := docker run \
-w /go/src/$(BASE_PACKAGE_NAME) \
$(HELM_IMAGE)

LINT_CHART_CMD := helm lint contrib/k8s/charts/open-service-broker-azure \
LINT_OSBA_CHART_CMD := helm lint contrib/k8s/charts/open-service-broker-azure \
--set azure.tenantId=foo \
--set azure.subscriptionId=foo \
--set azure.clientId=foo \
--set azure.clientSecret=foo

LINT_SVC_CAT_ETC_CHART_CMD := helm lint contrib/k8s/charts/svc-cat-etcd

.PHONY: lint-chart
lint-chart:
ifdef SKIP_DOCKER
$(LINT_CHART_CMD)
$(LINT_OSBA_CHART_CMD) $(LINT_SVC_CAT_ETC_CHART_CMD)

else
$(DOCKER_HELM_CMD) $(LINT_CHART_CMD)
$(DOCKER_HELM_CMD) $(LINT_OSBA_CHART_CMD) $(LINT_SVC_CAT_ETC_CHART_CMD)
endif

PUBLISH_RC_CHART_CMD := bash -c ' \
Expand All @@ -357,6 +360,11 @@ PUBLISH_RC_CHART_CMD := bash -c ' \
-c azure-rc \
--file open-service-broker-azure-0.0.1-$(GIT_VERSION).tgz \
--name open-service-broker-azure-0.0.1-$(GIT_VERSION).tgz \
&& helm package ../svc-cat-etcd \
&& az storage blob upload \
-c azure-rc \
--file svc-cat-etcd-0.0.1-$(GIT_VERSION).tgz \
--name svc-cat-etcd-0.0.1-$(GIT_VERSION).tgz \
&& az storage container lease acquire -c azure-rc --lease-duration 60 \
&& helm repo index --url https://kubernetescharts.blob.core.windows.net/azure-rc . \
&& az storage blob upload \
Expand All @@ -373,12 +381,18 @@ PUBLISH_RELEASE_CHART_CMD := bash -c ' \
&& sed -i "s/^version:.*/version: $${SIMPLE_REL_VERSION}/g" ../open-service-broker-azure/Chart.yaml \
&& sed -i "s/^appVersion:.*/appVersion: $${SIMPLE_REL_VERSION}/g" ../open-service-broker-azure/Chart.yaml \
&& sed -i "s/^ tag:.*/ tag: $(REL_VERSION)/g" ../open-service-broker-azure/values.yaml \
&& sed -i "s/^version:.*/version: $${SIMPLE_REL_VERSION}/g" ../svc-cat-etcd/Chart.yaml \
&& helm dep build ../open-service-broker-azure \
&& helm package ../open-service-broker-azure \
&& az storage blob upload \
-c azure \
--file open-service-broker-azure-$${SIMPLE_REL_VERSION}.tgz \
--name open-service-broker-azure-$${SIMPLE_REL_VERSION}.tgz \
&& helm package ../svc-cat-etcd \
&& az storage blob upload \
-c azure \
--file svc-cat-etcd-$${SIMPLE_REL_VERSION}.tgz \
--name svc-cat-etcd-$${SIMPLE_REL_VERSION}.tgz \
&& az storage container lease acquire -c azure --lease-duration 60 \
&& az storage blob download \
-c azure \
Expand Down
21 changes: 21 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart for Creating an etcd Cluster For Service Catalog
name: svc-cat-etcd
version: 0.1.0
5 changes: 5 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
An etcd cluster will be created named {{ .Values.cluster.name }}. This may take some time to complete. You can check the status of this with:

$ kubectl get pods

To use the new cluster, connect to the client service at "http://{{ .Values.cluster.name}}-client:2379". Please not, this is a Cluster IP service, so it will only be exposed within the cluster.
16 changes: 16 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 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 63 | trimSuffix "-" -}}
{{- end -}}
12 changes: 12 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/templates/abs-credentials.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
stringData:
storage-account: {{ .Values.azure.storage.account }}
storage-key: {{ .Values.azure.storage.key}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}-backup-config
data:
backup_cr.yaml: |
apiVersion: "etcd.database.coreos.com/v1beta2"
kind: "EtcdBackup"
metadata:
generateName: {{ .Values.cluster.name}}-backup-
spec:
etcdEndpoints: ["http://{{ .Values.cluster.name}}-client:2379"]
storageType: ABS
abs:
path: {{ .Values.azure.storage.container}}/{{ .Values.cluster.name }}-backup.<NOW>
absSecret: {{ template "fullname" . }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: etcd-backup
spec:
schedule: "{{ .Values.backup.schedule }}"
jobTemplate:
spec:
template:
spec:
containers:
- name: etcd-backup
image: lachlanevenson/k8s-kubectl
command:
- /bin/sh
- "-ec"
- |
sed -e "s|<NOW>|$(date '+%Y-%m-%d_%H:%M:%S')|g" /var/etcd_backup/backup_cr.yaml | kubectl create -f -
volumeMounts:
- name: backup-config
mountPath: /var/etcd_backup
restartPolicy: OnFailure
volumes:
- name: backup-config
configMap:
name: {{ template "fullname" . }}-backup-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: "etcd.database.coreos.com/v1beta2"
kind: "EtcdCluster"
metadata:
name: "{{ .Values.cluster.name}}"
spec:
size: 3
11 changes: 11 additions & 0 deletions contrib/k8s/charts/svc-cat-etcd/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cluster:
name: svc-cat-etcd
backup:
schedule: "*/30 * * * *"
azure:
storage:
# Required Field
account:
# Required Field
key:
container: etcd-backups
17 changes: 17 additions & 0 deletions contrib/k8s/etcd-operator/etcd-operator-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rbac:
create: false

# etcdOperator
etcdOperator:
image:
tag: v0.9.2

# backup spec
backupOperator:
image:
tag: v0.9.2

# restore spec
restoreOperator:
image:
tag: v0.9.2
11 changes: 11 additions & 0 deletions contrib/k8s/etcd-operator/restore-operation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: etcd.database.coreos.com/v1beta2
kind: EtcdRestore
metadata:
name: svc-cat-etcd-restore
spec:
etcdCluster:
name: svc-cat-etcd
backupStorageType: ABS
abs:
path: <BACKUP-FILE>
absSecret: abs-credentials
Loading