Skip to content

Commit

Permalink
Add commands to update chart (#16)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Jun 15, 2020
1 parent 59872d2 commit 5b4e797
Show file tree
Hide file tree
Showing 16 changed files with 682 additions and 641 deletions.
24 changes: 23 additions & 1 deletion Makefile
Expand Up @@ -230,7 +230,7 @@ gen-values-schema:
@yq d /tmp/voyager-values.openapiv3_schema.yaml description > charts/voyager/values.openapiv3_schema.yaml

.PHONY: gen-chart-doc
gen-chart-doc: gen-chart-doc-voyager
gen-chart-doc: $(shell find $$(pwd)/charts -maxdepth 1 -mindepth 1 -type d -printf 'gen-chart-doc-%f ')

gen-chart-doc-%:
@echo "Generate $* chart docs"
Expand All @@ -250,6 +250,28 @@ manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema gen-char
.PHONY: gen
gen: clientset gen-crd-protos manifests openapi

CHART_VERSION ?=
APP_VERSION ?= $(CHART_VERSION)
HAPROXY_VERSION ?=

.PHONY: update-charts
update-charts: $(shell find $$(pwd)/charts -maxdepth 1 -mindepth 1 -type d -printf 'chart-%f ')

chart-%:
@$(MAKE) chart-contents-$* gen-chart-doc-$* --no-print-directory

chart-contents-%:
@if [ ! -z "$(CHART_VERSION)" ]; then \
yq w -i ./charts/$*/Chart.yaml version $(CHART_VERSION); \
fi
@if [ ! -z "$(APP_VERSION)" ]; then \
yq w -i ./charts/$*/Chart.yaml appVersion $(APP_VERSION); \
yq w -i ./charts/$*/values.yaml operator.tag $(APP_VERSION); \
fi
@if [ ! -z "$(HAPROXY_VERSION)" ]; then \
yq w -i ./charts/$*/values.yaml haproxy.tag $(HAPROXY_VERSION); \
fi

fmt: $(BUILD_DIRS)
@docker run \
-i \
Expand Down
8 changes: 4 additions & 4 deletions api/crds/bindata.go

Large diffs are not rendered by default.

328 changes: 164 additions & 164 deletions api/crds/installer.voyagermesh.com_voyageroperators.v1.yaml

Large diffs are not rendered by default.

316 changes: 158 additions & 158 deletions api/crds/installer.voyagermesh.com_voyageroperators.yaml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions api/openapi-spec/swagger.json
Expand Up @@ -1277,11 +1277,11 @@
]
},
"dev.voyagermesh.installer.apis.installer.v1alpha1.VoyagerOperatorSpec": {
"description": "VoyagerOperatorSpec is the schema for Voyager Operator values file",
"description": "VoyagerOperatorSpec is the schema for Operator Operator values file",
"type": "object",
"required": [
"replicaCount",
"voyager",
"operator",
"haproxy",
"cleaner",
"imagePullPolicy",
Expand Down Expand Up @@ -1350,6 +1350,9 @@
"type": "string"
}
},
"operator": {
"$ref": "#/definitions/dev.voyagermesh.installer.apis.installer.v1alpha1.ContianerRef"
},
"persistence": {
"$ref": "#/definitions/dev.voyagermesh.installer.apis.installer.v1alpha1.CloudConfig"
},
Expand Down Expand Up @@ -1382,9 +1385,6 @@
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
}
},
"voyager": {
"$ref": "#/definitions/dev.voyagermesh.installer.apis.installer.v1alpha1.ContianerRef"
}
}
},
Expand Down
226 changes: 113 additions & 113 deletions apis/installer/v1alpha1/generated.pb.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions apis/installer/v1alpha1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions apis/installer/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions apis/installer/v1alpha1/voyager_operator_types.go
Expand Up @@ -42,14 +42,14 @@ type VoyagerOperator struct {
Spec VoyagerOperatorSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}

// VoyagerOperatorSpec is the schema for Voyager Operator values file
// VoyagerOperatorSpec is the schema for Operator Operator values file
type VoyagerOperatorSpec struct {
//+optional
NameOverride string `json:"nameOverride" protobuf:"bytes,1,opt,name=nameOverride"`
//+optional
FullnameOverride string `json:"fullnameOverride" protobuf:"bytes,2,opt,name=fullnameOverride"`
ReplicaCount int32 `json:"replicaCount" protobuf:"varint,3,opt,name=replicaCount"`
Voyager ContianerRef `json:"voyager" protobuf:"bytes,4,opt,name=voyager"`
Operator ContianerRef `json:"operator" protobuf:"bytes,4,opt,name=operator"`
Haproxy ImageRef `json:"haproxy" protobuf:"bytes,5,opt,name=haproxy"`
Cleaner ImageRef `json:"cleaner" protobuf:"bytes,6,opt,name=cleaner"`
ImagePullPolicy string `json:"imagePullPolicy" protobuf:"bytes,7,opt,name=imagePullPolicy"`
Expand Down
2 changes: 1 addition & 1 deletion apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions charts/voyager/Chart.yaml
Expand Up @@ -6,7 +6,7 @@ appVersion: v13.0.0-beta.1
home: https://voyagermesh.com/
icon: https://cdn.appscode.com/images/products/voyager/icons/android-icon-192x192.png
sources:
- https://github.com/voyagermesh/voyager
- https://github.com/voyagermesh/voyager
maintainers:
- name: appscode
email: support@appscode.com
- name: appscode
email: support@appscode.com
10 changes: 5 additions & 5 deletions charts/voyager/README.md
Expand Up @@ -49,11 +49,11 @@ The following table lists the configurable parameters of the `voyager` chart and
| nameOverride | Overrides name template | `""` |
| fullnameOverride | Overrides fullname template | `""` |
| replicaCount | Number of operator replicas to create (only 1 is supported) | `1` |
| voyager.registry | Docker registry used to pull Voyager operator image | `appscode` |
| voyager.repository | Voyager operator container image | `voyager` |
| voyager.tag | Voyager operator container image tag | `v13.0.0-beta.1` |
| voyager.resources | Compute Resources required by the operator container | `{}` |
| voyager.securityContext | Security options the operator container should run with | `{}` |
| operator.registry | Docker registry used to pull Voyager operator image | `appscode` |
| operator.repository | Voyager operator container image | `voyager` |
| operator.tag | Voyager operator container image tag | `v13.0.0-beta.1` |
| operator.resources | Compute Resources required by the operator container | `{}` |
| operator.securityContext | Security options the operator container should run with | `{}` |
| haproxy.registry | Docker registry used to pull HAProxy image | `appscode` |
| haproxy.repository | HAProxy container image | `haproxy` |
| haproxy.tag | HAProxy container image tag | `1.9.15-v13.0.0-beta.1-alpine` |
Expand Down
10 changes: 5 additions & 5 deletions charts/voyager/templates/deployment.yaml
Expand Up @@ -38,8 +38,8 @@ spec:
containers:
- name: voyager
securityContext:
{{- toYaml .Values.voyager.securityContext | nindent 10 }}
image: {{ .Values.voyager.registry }}/{{ .Values.voyager.repository }}:{{ .Values.voyager.tag }}
{{- toYaml .Values.operator.securityContext | nindent 10 }}
image: {{ .Values.operator.registry }}/{{ .Values.operator.repository }}:{{ .Values.operator.tag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- run
Expand All @@ -51,8 +51,8 @@ spec:
- --docker-registry={{ .Values.haproxy.registry }}
- --haproxy-image-tag={{ .Values.haproxy.tag }}
- --haproxy-image-repository={{ .Values.haproxy.repository }}
- --exporter-image-tag={{ .Values.voyager.tag }}
- --exporter-image-repository={{ .Values.voyager.repository }}
- --exporter-image-tag={{ .Values.operator.tag }}
- --exporter-image-repository={{ .Values.operator.repository }}
- --secure-port=8443
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
Expand Down Expand Up @@ -94,7 +94,7 @@ spec:
initialDelaySeconds: 5
{{- end }}
resources:
{{- toYaml .Values.voyager.resources | nindent 10 }}
{{- toYaml .Values.operator.resources | nindent 10 }}
volumeMounts:
- mountPath: /var/serving-cert
name: serving-cert
Expand Down

0 comments on commit 5b4e797

Please sign in to comment.