Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

13.Helm #2965

Merged
merged 4 commits into from
Feb 24, 2025
Merged

13.Helm #2965

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions Andrew_Bulakh/13.Helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# 13.Helm

```
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
```

inventory.ini
```bash

[db]
192.168.56.101

[web]
192.168.56.104

[nfs]
192.168.56.101

[all:vars]
ansible_user=root

```
mariadb.yaml
```bash
---
- hosts: db
become: yes
vars:
app_packages:
- mariadb-server
- mariadb-client
- python3-pymysql
wordpress_db_user: "{{ wordpress_user_db | default('wordpress') }}"
wordpress_db_pass: "{{ wordpress_pass_db | default('strongpassword') }}"
wordpress_db_name: wordpress

drupal_db_user: "{{ drupal_user_db | default('drupal') }}"
drupal_db_pass: "{{ drupal_pass_db | default('strongpassword') }}"
drupal_db_name: drupal

mysql_root_password: "Vorobushek1"
tasks:
- name: Install MariaDB packages
apt:
name: "{{ app_packages }}"
state: present
update_cache: yes

- name: Configure bind-address
ini_file:
dest: /etc/mysql/mariadb.conf.d/50-server.cnf
section: mysqld
option: bind-address
value: "0.0.0.0"
register: restart_needed

- name: Restart MariaDB if needed
service:
name: mariadb
state: restarted
when: restart_needed.changed

- name: Ensure MariaDB is running
service:
name: mariadb
state: started
enabled: yes

- name: Create WordPress database
mysql_db:
name: "{{ wordpress_db_name }}"
state: present
login_user: root
login_password: "{{ mysql_root_password }}"
login_unix_socket: /var/run/mysqld/mysqld.sock

- name: Create WordPress database user
mysql_user:
name: "{{ wordpress_db_user }}"
password: "{{ wordpress_db_pass }}"
priv: "{{ wordpress_db_name }}.*:ALL"
host: '%'
login_user: root
login_password: "{{ mysql_root_password }}"
login_unix_socket: /var/run/mysqld/mysqld.sock

- name: Create Drupal database
mysql_db:
name: "{{ drupal_db_name }}"
state: present
login_user: root
login_password: "{{ mysql_root_password }}"
login_unix_socket: /var/run/mysqld/mysqld.sock

- name: Create Drupal database user
mysql_user:
name: "{{ drupal_db_user }}"
password: "{{ drupal_db_pass }}"
priv: "{{ drupal_db_name }}.*:ALL"
host: '%'
login_user: root
login_password: "{{ mysql_root_password }}"
login_unix_socket: /var/run/mysqld/mysqld.sock
```

```bash
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install ingress-nginx ingress-nginx/ingress-nginx
```
wp-values.yml
```bash
persistence:
enabled: true
size: 8Gi

mariadb:
enabled: false

externalDatabase:
host: 192.168.56.101
port: 3306
user: wordpress
password: strongpassword
database: wordpress

ingress:
enabled: true
hostname: wordpress.k8s-1.sa
ingressClassName: nginx

wordpressUsername: wordpress-user
wordpressPassword: password
```
```bash
helm install wordpress oci://registry-1.docker.io/bitnamicharts/wordpress -f wp-values.yml
```
drupal-values.yml
```bash
persistence:
enabled: true
size: 8Gi

mariadb:
enabled: false

externalDatabase:
host: 192.168.56.101
port: 3306
user: drupal
password: strongpassword
database: drupal

ingress:
enabled: true
hostname: drupal.k8s-1.sa
ingressClassName: nginx

drupalUsername: admin
drupalPassword: password
```
```bash
helm install drupal oci://registry-1.docker.io/bitnamicharts/drupal -f drupal-values.yml
```

Binary file added Andrew_Bulakh/13.Helm/drupal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Andrew_Bulakh/13.Helm/wordpress.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Andrew_Bulakh/14.k8sAppDep/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 14. Kubernetes application deployment

```bash
helm create jenkins-helm
helm package jenkins-helm/

git branch -M main
git remote add origin https://github.com/AndrewBulah/14.-KubernetesApplicationDeployment.git
git add jenkins-helm-0.1.0.tgz
git commit -m "helm"
git push -u origin main
```
[download](https://github.com/AndrewBulah/14.-KubernetesApplicationDeployment/raw/refs/heads/main/jenkins-helm-0.1.0.tgz)
Binary file added Andrew_Bulakh/14.k8sAppDep/jenkins.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.