Open11

ローカル環境にKubernetes を構築する

135yshr135yshr

Docker はインストールしておくこと

Kind = Kubernetes IN Docker

brew install kind
135yshr135yshr

helm ディレクトリの作成

mkdir -p deployments/helm
cd deployments/helm
135yshr135yshr

初期プロジェクト作成

helm create example-project
.
├── Chart.yaml
├── charts
├── templates
│   ├── NOTES.txt
│   ├── _helpers.tpl
│   ├── deployment.yaml
│   ├── hpa.yaml
│   ├── ingress.yaml
│   ├── service.yaml
│   ├── serviceaccount.yaml
│   └── tests
│       └── test-connection.yaml
└── values.yaml
135yshr135yshr
helm plugin install https://github.com/jkroepke/helm-secrets --version v4.4.2
135yshr135yshr

helm で api <-> db の構成作る。
ただし、stable だとバージョンが5系なので、 https://github.com/mysql/mysql-operator 使う

helm repo add mysql-operator https://mysql.github.io/mysql-operator/
helm repo update
135yshr135yshr

requirements.yaml を作る。 (嘘: v3からは、 Charts.yamlに含める)
バージョンに指定するのは、 chart version

dependencies:
  - name: mysql-operator
    version: 2.0.10
    repository: "@mysql-operator"
135yshr135yshr

バージョンの確認はこうやる

helm search repo mysql
NAME                              	CHART VERSION	APP VERSION  	DESCRIPTION
mysql-operator/mysql-innodbcluster	2.0.10       	8.0.33       	MySQL InnoDB Cluster Helm Chart for deploying M...
mysql-operator/mysql-operator     	2.0.10       	8.0.33-2.0.10	MySQL Operator Helm Chart for deploying MySQL I...
stable/mysql                      	1.6.9        	5.7.30       	DEPRECATED - Fast, reliable, scalable, and easy...
stable/mysqldump                  	2.6.2        	2.4.1        	DEPRECATED! - A Helm chart to help backup MySQL...
stable/prometheus-mysql-exporter  	0.7.1        	v0.11.0      	DEPRECATED A Helm chart for prometheus mysql ex...
stable/percona                    	1.2.3        	5.7.26       	DEPRECATED - free, fully compatible, enhanced, ...
stable/percona-xtradb-cluster     	1.0.8        	5.7.19       	DEPRECATED - free, fully compatible, enhanced, ...
stable/phpmyadmin                 	4.3.5        	5.0.1        	DEPRECATED phpMyAdmin is an mysql administratio...
stable/gcloud-sqlproxy            	0.6.1        	1.11         	DEPRECATED Google Cloud SQL Proxy
stable/mariadb                    	7.3.14       	10.3.22      	DEPRECATED Fast, reliable, scalable, and easy t...