add correct execution of provision-cli, start work on helm charts
This commit is contained in:
@@ -6,7 +6,7 @@ Only tested on Ubuntu-24.04 wsl
|
|||||||
```bash
|
```bash
|
||||||
# Option 1: Using CLI tool (recommended)
|
# Option 1: Using CLI tool (recommended)
|
||||||
./cli/build.sh # build CLI tool in project
|
./cli/build.sh # build CLI tool in project
|
||||||
provision-cli provision # Run interactive provisioning in project root
|
./provision-cli provision # Run interactive provisioning in project root
|
||||||
|
|
||||||
# Option 2: Using scripts directly
|
# Option 2: Using scripts directly
|
||||||
./scripts/provision-kubernetes.sh # Create Kubernetes cluster
|
./scripts/provision-kubernetes.sh # Create Kubernetes cluster
|
||||||
@@ -40,7 +40,7 @@ The CLI tool provides a user-friendly interface for managing your environments:
|
|||||||
|
|
||||||
# The installer adds the binary to project root
|
# The installer adds the binary to project root
|
||||||
# Run the tool
|
# Run the tool
|
||||||
provision-cli provision
|
./provision-cli provision
|
||||||
```
|
```
|
||||||
|
|
||||||
[CLI Documentation](./cli/README.md) - Detailed CLI usage and development
|
[CLI Documentation](./cli/README.md) - Detailed CLI usage and development
|
||||||
|
|||||||
@@ -6,15 +6,15 @@ all:
|
|||||||
control_plane:
|
control_plane:
|
||||||
hosts:
|
hosts:
|
||||||
controlplane:
|
controlplane:
|
||||||
ansible_host: 10.57.249.249
|
ansible_host: 10.57.249.3
|
||||||
workers:
|
workers:
|
||||||
hosts:
|
hosts:
|
||||||
node01:
|
node01:
|
||||||
ansible_host: 10.57.249.112
|
|
||||||
node02:
|
|
||||||
ansible_host: 10.57.249.123
|
|
||||||
node03:
|
|
||||||
ansible_host: 10.57.249.58
|
ansible_host: 10.57.249.58
|
||||||
|
node02:
|
||||||
|
ansible_host: 10.57.249.184
|
||||||
|
node03:
|
||||||
|
ansible_host: 10.57.249.34
|
||||||
vars:
|
vars:
|
||||||
ansible_user: ubuntu
|
ansible_user: ubuntu
|
||||||
ansible_become: yes
|
ansible_become: yes
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Kubernetes Applications
|
||||||
|
|
||||||
|
This directory contains Helm charts for deploying applications to your Kubernetes cluster.
|
||||||
|
|
||||||
|
## Available Applications
|
||||||
|
|
||||||
|
- **rqlite**: Distributed SQLite database (3 replicas by default)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
1. Ensure you have Helm installed:
|
||||||
|
```bash
|
||||||
|
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# helm/rqlite/Chart.yaml
|
||||||
|
apiVersion: v2
|
||||||
|
name: rqlite
|
||||||
|
description: A Helm chart for deploying rqlite on Kubernetes
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "8.36.11"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# helm/rqlite/Chart.yaml
|
||||||
|
apiVersion: v2
|
||||||
|
name: rqlite
|
||||||
|
description: A Helm chart for deploying rqlite on Kubernetes
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "8.36.11"
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# helm/rqlite/templates/service.yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 4001
|
||||||
|
targetPort: http
|
||||||
|
- name: raft
|
||||||
|
port: 4002
|
||||||
|
targetPort: raft
|
||||||
|
clusterIP: None # Headless service for StatefulSet
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# helm/rqlite/templates/statefulset.yaml
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
serviceName: {{ .Release.Name }}
|
||||||
|
replicas: {{ .Values.replicas }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: rqlite
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
ports:
|
||||||
|
- containerPort: 4001
|
||||||
|
name: http
|
||||||
|
- containerPort: 4002
|
||||||
|
name: raft
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /rqlite/data
|
||||||
|
env:
|
||||||
|
- name: POD_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- >
|
||||||
|
if [ "${POD_NAME}" = "{{ .Release.Name }}-0" ]; then
|
||||||
|
exec rqlited -node-id ${POD_NAME} -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 /rqlite/data;
|
||||||
|
else
|
||||||
|
exec rqlited -node-id ${POD_NAME} -http-addr 0.0.0.0:4001 -raft-addr 0.0.0.0:4002 -join {{ .Release.Name }}-0.{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local:4002 /rqlite/data;
|
||||||
|
fi
|
||||||
|
{{- if not .Values.persistence.enabled }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.persistence.enabled }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes: [ "ReadWriteOnce" ]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# helm/rqlite/values.yaml
|
||||||
|
replicas: 3
|
||||||
|
image:
|
||||||
|
repository: rqlite/rqlite
|
||||||
|
tag: "8.36.11"
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
size: 1Gi
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
Reference in New Issue
Block a user