Skip to content

Commit a7dfa3c

Browse files
authored
Update Yorkie Helm Charts (#513)
* Revise misconfigured nameOverride in yorkie-monitoring helm chart & update README.md * Revise & update misconfigured helm charts and README.md * Revise yorkie-cluster helm chart installation method to use istio operator with istioctl * Add Loki logging system in yorkie-monitoring Helm chart * Update helm chart uninstallation methods
1 parent 4539bfe commit a7dfa3c

18 files changed

+141
-140
lines changed

build/charts/yorkie-argocd/README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ helm upgrade [RELEASE_NAME] yorkie-team/yorkie-argocd -n argocd \
5656
--set externalGateway.alb.certArn={YOUR_CERTIFICATE_ARN}
5757

5858
# Open ArgoCD Web UI
59-
curl https://{YOUR_DOMAIN_NAME}/argocd
59+
curl https://{YOUR_API_DOMAIN_NAME}/argocd
6060
```
6161

6262
Or, set configuration values in `values.yaml` file before installing the chart.
@@ -76,9 +76,7 @@ _See [`helm uninstall`](https://helm.sh/docs/helm/helm_uninstall/) for command d
7676
CRDs created by this chart are not removed by default and should be manually cleaned up:
7777

7878
```bash
79-
kubectl delete crd applications.argoproj.io
80-
kubectl delete crd applicationsets.argoproj.io
81-
kubectl delete crd appprojects.argoproj.io
79+
kubectl get crd -oname | grep --color=never 'argoproj.io' | xargs kubectl delete
8280
```
8381

8482
## Upgrading Chart
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
apiVersion: argoproj.io/v1alpha1
22
kind: Application
33
metadata:
4-
name: {{ .Values.yorkie.name }}-app
4+
name: yorkie-cluster
55
namespace: argocd
66
spec:
77
project: {{ .Values.argocd.project }}
8-
source:
9-
repoURL: {{ .Values.argocd.source.repoURL }}
10-
# Set branch to watch revision (in production, main)
11-
targetRevision: {{ .Values.argocd.source.targetRevision }}
12-
path: {{ .Values.argocd.source.yorkieAppPath }}
8+
sources:
9+
- repoURL: {{ .Values.argocd.source.helmChartRepoURL }}
10+
chart: yorkie-cluster
11+
targetRevision: {{ .Values.argocd.source.helmChartTargetRevision }}
12+
helm:
13+
valueFiles:
14+
- $gitops/{{ .Values.argocd.source.clusterValuesPath }}
15+
- repoURL: {{ .Values.argocd.source.gitOpsRepoURL }}
16+
targetRevision: {{ .Values.argocd.source.gitOpsRepoTargetRevision }}
17+
ref: gitops
1318
destination:
1419
server: {{ .Values.argocd.destination.server }}
15-
namespace: {{ .Values.argocd.destination.namespace }}
20+
namespace: {{ .Values.argocd.destination.yorkieNamespace }}
1621
---
1722
apiVersion: argoproj.io/v1alpha1
1823
kind: Application
1924
metadata:
20-
name: {{ .Values.argocd.name }}-monitoring
25+
name: yorkie-monitoring
2126
namespace: argocd
2227
spec:
2328
project: {{ .Values.argocd.project }}
24-
source:
25-
repoURL: {{ .Values.argocd.source.repoURL }}
26-
# Set branch to watch revision (in production, main)
27-
targetRevision: {{ .Values.argocd.source.targetRevision }}
28-
path: {{ .Values.argocd.source.monitoringPath }}
29+
sources:
30+
- repoURL: {{ .Values.argocd.source.helmChartRepoURL }}
31+
chart: yorkie-monitoring
32+
targetRevision: {{ .Values.argocd.source.helmChartTargetRevision }}
33+
helm:
34+
valueFiles:
35+
- $gitops/{{ .Values.argocd.source.monitoringValuesPath }}
36+
- repoURL: {{ .Values.argocd.source.gitOpsRepoURL }}
37+
targetRevision: {{ .Values.argocd.source.gitOpsRepoTargetRevision }}
38+
ref: gitops
2939
destination:
3040
server: {{ .Values.argocd.destination.server }}
31-
namespace: {{ .Values.argocd.destination.namespace }}
41+
namespace: {{ .Values.argocd.destination.monitoringNamespace }}

build/charts/yorkie-argocd/templates/install.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1360,9 +1360,9 @@ spec:
13601360
- /usr/local/bin/argocd-server
13611361
- --insecure
13621362
- --basehref
1363-
- {{ .Values.externalGateway.alb.argoCDPath }}
1363+
- {{ .Values.externalGateway.argoCDPath }}
13641364
- --rootpath
1365-
- {{ .Values.externalGateway.alb.argoCDPath }}
1365+
- {{ .Values.externalGateway.argoCDPath }}
13661366
env:
13671367
- name: ARGOCD_SERVER_INSECURE
13681368
valueFrom:
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
{{ if .Values.argocd.enabled }}
1+
{{ if .Values.argocd.source.gitOpsRepoIsPrivate }}
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
name: {{ .Values.yorkie.name }}-repo
5+
name: gitops-repo
66
namespace: argocd
77
labels:
88
argocd.argoproj.io/secret-type: repository
99
stringData:
10-
url: {{ .Values.argocd.source.repoURL }}
11-
username: {{ .Values.argocd.source.username }}
12-
password: {{ .Values.argocd.source.password }}
10+
url: {{ .Values.argocd.source.gitOpsRepoURL }}
11+
username: {{ .Values.argocd.source.gitOpsRepoUsername }}
12+
password: {{ .Values.argocd.source.gitOpsRepoPassword }}
1313
{{ end }}

build/charts/yorkie-argocd/values.yaml

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Configuration for name of yorkie app
2-
yorkie:
3-
name: yorkie
4-
namespace: yorkie
5-
profilingPort: 11102
6-
71
# Configuration for argocd CD
82
argocd:
93
enabled: true
@@ -13,18 +7,27 @@ argocd:
137
project: default
148

159
source:
16-
repoURL: https://github.com/yorkie-team/yorkie.git
17-
targetRevision: main
18-
19-
yorkieAppPath: build/charts/yorkie-cluster
20-
monitoringPath: build/charts/yorkie-monitoring
10+
# Set helm chart repository url
11+
helmChartRepoURL: https://yorkie-team.github.io/yorkie/helm-charts
12+
helmChartTargetRevision: 0.3.3
13+
14+
# Set to GitOps repostiroy to reference helm chart custom values
15+
gitOpsRepoURL: https://github.com/yorkie-team/devops.git
16+
gitOpsRepoTargetRevision: manifest-update
17+
18+
# Set to path of each helm chart custom values from GitOps repository
19+
clusterValuesPath: k8s/cluster/values.yaml
20+
monitoringValuesPath: k8s/monitoring/values.yaml
21+
22+
# Set usename & password if GitOps repository is private
23+
gitOpsRepoIsPrivate: true
24+
gitOpsRepoUsername: yorkie
25+
gitOpsRepoPassword: ghp_123412341234
2126

22-
# Set usename & password for private repository
23-
username: yorkie
24-
password: ghp_123412341234
2527
destination:
2628
server: https://kubernetes.default.svc
27-
namespace: default
29+
yorkieNamespace: istio-system
30+
monitoringNamespace: monitoring
2831

2932
# Configuration for external gateway (eg: AWS ALB)
3033
externalGateway:

build/charts/yorkie-cluster/.helmignore

+3
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
.idea/
2222
*.tmproj
2323
.vscode/
24+
25+
# Istio Operator
26+
istio-operator.yaml

build/charts/yorkie-cluster/Chart.lock

-12
This file was deleted.

build/charts/yorkie-cluster/Chart.yaml

-11
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,3 @@ keywords:
2020
- cluster
2121
- kubernetes
2222
- istio
23-
24-
dependencies:
25-
- name: base
26-
version: 1.17.2
27-
repository: https://istio-release.storage.googleapis.com/charts
28-
- name: istiod
29-
version: 1.17.2
30-
repository: https://istio-release.storage.googleapis.com/charts
31-
- name: gateway
32-
version: 1.17.2
33-
repository: https://istio-release.storage.googleapis.com/charts

build/charts/yorkie-cluster/README.md

+16-34
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ Installs the yorkie-cluster, which provides cluster mode for Yorkie server to ha
55
## Prerequisites
66

77
- Kubernetes 1.24+
8+
- Istioctl 1.17+
89
- Helm 3+
910

11+
## Install Istio with Istio Operator
12+
13+
Before installing the chart, you need to install Istio with [Istio Operator](https://istio.io/latest/docs/setup/install/operator/) using [istioctl](https://istio.io/latest/docs/setup/getting-started/#download).
14+
15+
```bash
16+
istioctl install -f <(curl -s https://raw.githubusercontent.com/yorkie-team/yorkie/main/build/charts/yorkie-cluster/istio-operator.yaml)
17+
```
18+
1019
## Get Helm Repository Info
1120

1221
```bash
@@ -21,9 +30,6 @@ _See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentati
2130
```bash
2231
# Install yorkie cluster helm chart
2332
helm install [RELEASE_NAME] yorkie-team/yorkie-cluster -n istio-system --create-namespace
24-
25-
# Redeploy istio ingress gateway with auto injecton
26-
kubectl rollout restart deployment istio-ingressgateway -n istio-system
2733
```
2834

2935
_See [configuration](#configuration) below for custom installation_
@@ -40,34 +46,22 @@ For other environments like AWS, follow the steps below:
4046
If you are using AWS EKS and want to expose Yorkie Cluster using AWS ALB, follow the steps below:
4147

4248
```bash
43-
# Change istio-ingressgateway service type to NodePort, externalGateway.alb.enabled to true, and certArn to your AWS certificate ARN issued in AWS Certificate Manager
49+
# Enable ALB, and change domain name and certificate arn for ALB
4450
helm upgrade [RELEASE_NAME] yorkie-team/yorkie-cluster -n istio-system \
4551
--set externalGateway.ingressClassName=alb \
46-
--set externalGateway.apiHost={YOUR_DOMAIN_NAME} \
52+
--set externalGateway.apiHost={YOUR_API_DOMAIN_NAME} \
4753
--set externalGateway.adminHost={YOUR_ADMIN_DOMAIN_NAME} \
4854
--set externalGateway.alb.enabled=true \
4955
--set externalGateway.alb.certArn={YOUR_CERTIFICATE_ARN}
5056

5157
# Test Yorkie API
52-
const client = new yorkie.Client('{YOUR_DOMAIN_NAME}');
58+
const client = new yorkie.Client('{YOUR_API_DOMAIN_NAME}');
5359
```
5460

5561
Or, set configuration values in `values.yaml` file before installing the chart.
5662

5763
_See [configuration](#configuration) below._
5864

59-
## Dependencies
60-
61-
By default this chart installs additional, dependent charts:
62-
63-
- [base](https://github.com/istio/istio/tree/master/manifests/charts/base)
64-
- [istiod](https://github.com/istio/istio/tree/master/manifests/charts/istio-control/istio-discovery)
65-
- [gateway](https://github.com/istio/istio/tree/master/manifests/charts/gateway)
66-
67-
To disable dependencies during installation, see [multiple releases](#multiple-releases) below.
68-
69-
_See [`helm dependency`](https://helm.sh/docs/helm/helm_dependency/) for command documentation._
70-
7165
## Uninstall Helm Chart
7266

7367
```bash
@@ -78,26 +72,14 @@ This removes all the Kubernetes components associated with the chart and deletes
7872

7973
_See [`helm uninstall`](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
8074

81-
CRDs created by this chart are not removed by default and should be manually cleaned up:
75+
Also, you need to uninstall istio with [istioctl](https://istio.io/latest/docs/setup/getting-started/#download).
8276

8377
```bash
84-
kubectl delete crd authorizationpolicies.security.istio.io
85-
kubectl delete crd destinationrules.networking.istio.io
86-
kubectl delete crd envoyfilters.networking.istio.io
87-
kubectl delete crd gateways.networking.istio.io
88-
kubectl delete crd istiooperators.install.istio.io
89-
kubectl delete crd peerauthentications.security.istio.io
90-
kubectl delete crd proxyconfigs.networking.istio.io
91-
kubectl delete crd requestauthentications.security.istio.io
92-
kubectl delete crd serviceentries.networking.istio.io
93-
kubectl delete crd sidecars.networking.istio.io
94-
kubectl delete crd telemetries.telemetry.istio.io
95-
kubectl delete crd virtualservices.networking.istio.io
96-
kubectl delete crd wasmplugins.extensions.istio.io
97-
kubectl delete crd workloadentries.networking.istio.io
98-
kubectl delete crd workloadgroups.networking.istio.io
78+
istioctl uninstall --purge
9979
```
10080

81+
This will remove all the istio components including CRDs.
82+
10183
## Upgrading Chart
10284

10385
```bash

build/charts/yorkie-cluster/charts/mongodb/templates/statefulset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
name: {{ .Values.name }}-storage
4040
spec:
4141
accessModes: ["ReadWriteOnce"]
42-
storageClassName: standard
42+
storageClassName: {{ .Values.storageClassName }}
4343
resources:
4444
requests:
4545
storage: {{ .Values.storageSize }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: install.istio.io/v1alpha1
2+
kind: IstioOperator
3+
metadata:
4+
name: istio-operator
5+
namespace: istio-system
6+
spec:
7+
profile: default
8+
meshConfig:
9+
accessLogFile: /dev/stdout
10+
enableTracing: true
11+
components:
12+
ingressGateways:
13+
- name: istio-ingressgateway
14+
enabled: true
15+
k8s:
16+
service:
17+
type: NodePort
18+
pilot:
19+
enabled: true

build/charts/yorkie-cluster/templates/ingress.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
pathType: Prefix
2525
backend:
2626
service:
27-
name: {{ .Values.gateway.name }}
27+
name: istio-ingressgateway
2828
port:
2929
number: 80
3030
---
@@ -53,6 +53,6 @@ spec:
5353
pathType: Prefix
5454
backend:
5555
service:
56-
name: {{ .Values.gateway.name }}
56+
name: istio-ingressgateway
5757
port:
5858
number: 80

build/charts/yorkie-cluster/values.yaml

+3-15
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ mongodb:
3030
namespace: *namespace
3131
name: *mongoUrl
3232
port: *mongoPort
33+
34+
storageClassName: standard
3335
storageSize: 1Gi
34-
36+
3537
# Configuration for istio ingress gateway
3638
ingressGateway:
3739
consistentHash:
@@ -53,20 +55,6 @@ ingressGateway:
5355

5456
resources: {}
5557

56-
# Configuration for istio gateway dependency
57-
gateway:
58-
name: istio-ingressgateway
59-
60-
service:
61-
# Set ingress gateway service type to NodePort to connect with external ingress
62-
type: NodePort
63-
# Set Health check by ALB
64-
anntoations:
65-
alb.ingress.kubernetes.io/healthcheck-path: /healthz/ready
66-
# Use this command to set health check port for ALB
67-
# kubectl get service istio-ingressgateway -n istio-system -o jsonpath='{.spec.ports[?(@.name=="status-port")].nodePort}'
68-
alb.ingress.kubernetes.io/healthcheck-port: "32665"
69-
7058
# Configuration for external gateway (eg: AWS ALB)
7159
externalGateway:
7260
ingressClassName: nginx

build/charts/yorkie-monitoring/Chart.lock

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ dependencies:
22
- name: kube-prometheus-stack
33
repository: https://prometheus-community.github.io/helm-charts
44
version: 45.9.0
5-
digest: sha256:19843f905bf082495e2419839df5947f2f050913f294bd5e695cebd5667ce9f9
6-
generated: "2023-04-10T17:13:39.677952+09:00"
5+
- name: loki-stack
6+
repository: https://grafana.github.io/helm-charts
7+
version: 2.9.9
8+
digest: sha256:37fcfcbafeab8059805bb45003572313145d105b83c0099cd294dec86c7841d3
9+
generated: "2023-04-15T20:01:56.982397+09:00"

build/charts/yorkie-monitoring/Chart.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ dependencies:
2727
- name: kube-prometheus-stack
2828
version: 45.9.0
2929
repository: https://prometheus-community.github.io/helm-charts
30+
- name: loki-stack
31+
version: 2.9.9
32+
repository: https://grafana.github.io/helm-charts

0 commit comments

Comments
 (0)