Helm/Yourls: Difference between revisions
Jump to navigation
Jump to search
| (16 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{|class='wikitable | {|class='wikitable' | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
helm repo add yourls https://charts.yourls.org | helm repo add yourls https://charts.yourls.org | ||
helm repo update && helm repo list | helm repo update && helm repo list | ||
| Line 9: | Line 9: | ||
==Data== | ==Data== | ||
{|class='wikitable | {|class='wikitable' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Data | Data | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Data » HostPath | Data » HostPath | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | # ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | ||
cat <<'EXE'| sudo bash | cat <<'EXE'| sudo bash | ||
mkdir -p /var/minikube/pvc/yourls/data-mariadb-0/ | mkdir -p /var/minikube/pvc/yourls/data-mariadb-0/ | ||
chown -R 1001:1001 /var/minikube/pvc/yourls/ | chown -R 1001:1001 /var/minikube/pvc/yourls/ | ||
sh -c 'ls -alh /var/minikube/pvc/yourls/' | |||
EXE | EXE | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 32: | Line 32: | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Data » MariaDB | Data » MariaDB | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
MariaDB » Create | MariaDB » Create | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | # ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | ||
echo -n 'Password: ';read -s | echo -n 'Password: ';read -s YOURLS_PASSWORD;export YOURLS_PASSWORD;echo | ||
echo "${YOURLS_PASSWORD}" | |||
# Password: sadaqah! | # Password: sadaqah! | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 59: | Line 60: | ||
cat << DDL | sudo -i -u root mariadb | cat << DDL | sudo -i -u root mariadb | ||
CREATE DATABASE IF NOT EXISTS shahed_tool_yourls; | CREATE DATABASE IF NOT EXISTS shahed_tool_yourls; | ||
CREATE USER IF NOT EXISTS shahed_tool_yourls@'%' IDENTIFIED BY '${ | CREATE USER IF NOT EXISTS shahed_tool_yourls@'%' IDENTIFIED BY '${YOURLS_PASSWORD}'; | ||
GRANT ALL PRIVILEGES ON shahed_tool_yourls.* TO shahed_tool_yourls@'%'; | GRANT ALL PRIVILEGES ON shahed_tool_yourls.* TO shahed_tool_yourls@'%'; | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
| Line 65: | Line 66: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
MariaDB » Debug | MariaDB » Debug | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
echo -n 'Password: ';read -s MYSQL_PWD;export MYSQL_PWD;echo | echo -n 'Password: ';read -s MYSQL_PWD;export MYSQL_PWD;echo | ||
# Password: sadaqah! | # Password: sadaqah! | ||
| Line 82: | Line 83: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
MariaDB » Backup | MariaDB » Backup | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | # ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | ||
cd ~/Downloads | # cd ~/Downloads | ||
function quarter() { | function quarter() { | ||
local month this_quarter | local month this_quarter | ||
month=$(date +%m) | local month=$(date +%m) | ||
case $month in | case ${month} in | ||
01|02|03) this_quarter="$(date +'%Y-01-01')" ;; | 01|02|03) this_quarter="$(date +'%Y-01-01')" ;; | ||
04|05|06) this_quarter="$(date +'%Y-04-01')" ;; | 04|05|06) this_quarter="$(date +'%Y-04-01')" ;; | ||
| Line 108: | Line 109: | ||
# Password: sadaqah! | # Password: sadaqah! | ||
BKP_DATE_N_TIME="$(date +'%Y-%m-%dT%H%M')";\ | |||
mariadb-dump -P3306 -h10.20.13.1 -u shahed_tool_yourls shahed_tool_yourls | gzip > shahed_tool_yourls.${ | mariadb-dump -P3306 -h10.20.13.1 -u shahed_tool_yourls shahed_tool_yourls | gzip > shahed_tool_yourls.data.${BKP_DATE_N_TIME}.sql.gz | ||
gunzip -c shahed_tool_yourls.data.${BKP_DATE_N_TIME}.sql.gz | more | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
MariaDB » Restore | MariaDB » Restore | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | # ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | ||
mc cp s3_minio_shahed_shahed_biz_admin/shahed-bkp/tool/yourls/daily/2025-M12/2025-12-21/shahed_tool_yourls.2025-12-21T2345.sql.gz ${HOME}/Downloads/ | # mc cp s3_minio_shahed_shahed_biz_admin/shahed-bkp/tool/yourls/daily/2025-M12/2025-12-21/shahed_tool_yourls.data.2025-12-21T2345.sql.gz ${HOME}/Downloads/ | ||
echo -n 'password: ';read -s MYSQL_PWD;export MYSQL_PWD; echo | echo -n 'password: ';read -s MYSQL_PWD;export MYSQL_PWD; echo | ||
| Line 125: | Line 127: | ||
mariadb -P3306 -h10.20.13.1 -u shahed_tool_yourls -D shahed_tool_yourls | mariadb -P3306 -h10.20.13.1 -u shahed_tool_yourls -D shahed_tool_yourls | ||
gunzip -c ${HOME}/Downloads/shahed_tool_yourls.2025-12-21T2345.sql.gz | mariadb -P3306 -h10.20.13.1 -u shahed_tool_yourls -D shahed_tool_yourls | gunzip -c shahed_tool_yourls.data.2025-12-21T2345.sql.gz | mariadb -P3306 -h10.20.13.1 -u shahed_tool_yourls -D shahed_tool_yourls | ||
# gunzip -c ${HOME}/Downloads/shahed_tool_yourls.data.2025-12-21T2345.sql.gz | mariadb -P3306 -h10.20.13.1 -u shahed_tool_yourls -D shahed_tool_yourls | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
MariaDB » Destroy | MariaDB » Destroy | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='sql'> | ||
ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | # ssh -qt shahed@shahed-ab.local.or.tunnel.ip bash | ||
cat <<'DDL'| sudo -i -u root mariadb | cat <<'DDL'| sudo -i -u root mariadb | ||
\! echo " " | \! echo " " | ||
| Line 148: | Line 151: | ||
==Config== | ==Config== | ||
{|class='wikitable | {|class='wikitable' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Config | Config | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Config » Context | Config » Context | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
export KUBECONFIG=${HOME}/.kube/shahed-ab-kubeconfig.yaml | export KUBECONFIG=${HOME}/.kube/shahed-ab-kubeconfig.yaml | ||
kubectl config get-contexts | kubectl config get-contexts | ||
| Line 165: | Line 168: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl config view -o=yaml|yq '.contexts[0].name' | kubectl config view -o=yaml|yq '.contexts[0].name' | ||
kubectl create ns yourls || true | kubectl create ns yourls || true | ||
| Line 171: | Line 174: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Config » Yourls | Config » Yourls | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Yourls » Certificate | Yourls » Certificate | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls apply -f - | kubectl -n yourls apply -f - | ||
| Line 222: | Line 225: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight lang='bash'> | |||
cat <<'CRT' | \ | |||
sudo tee /usr/local/share/ca-certificates/Shahed_ECC_Root_CA_2025.crt >/dev/null | |||
-----BEGIN CERTIFICATE----- | |||
MIICVzCCAf0CFGUKRHOSLD3pqFU50HJvLeqYUPq6MAoGCCqGSM49BAMCMIGtMQsw | |||
CQYDVQQGEwJCRDEOMAwGA1UECAwFRGhha2ExEzARBgNVBAcMCk11bnNoaWdhbmox | |||
FTATBgNVBAoMDFNoYWhlZCwgSW5jLjEgMB4GA1UECwwXU2hhaGVkX0VDQ19Sb290 | |||
X0NBXzIwMjUxIDAeBgNVBAMMF1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MR4wHAYJ | |||
KoZIhvcNAQkBFg9pbmZvQHNoYWhlZC5iaXowHhcNMjUwODIzMDk1NzMxWhcNNDUw | |||
ODIzMDk1NzMxWjCBrTELMAkGA1UEBhMCQkQxDjAMBgNVBAgMBURoYWthMRMwEQYD | |||
VQQHDApNdW5zaGlnYW5qMRUwEwYDVQQKDAxTaGFoZWQsIEluYy4xIDAeBgNVBAsM | |||
F1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MSAwHgYDVQQDDBdTaGFoZWRfRUNDX1Jv | |||
b3RfQ0FfMjAyNTEeMBwGCSqGSIb3DQEJARYPaW5mb0BzaGFoZWQuYml6MFkwEwYH | |||
KoZIzj0CAQYIKoZIzj0DAQcDQgAEbuTaY9T08dgixHd9zvDCfuVODsZJDLcdpNB1 | |||
38haHzpnfsl0fvKVfJP1nYwrKwskBDTWPDYC03nIHJJxi9js+TAKBggqhkjOPQQD | |||
AgNIADBFAiBUPr4rlKCuAD6FnoyZd/XKD/PvbzafUd4ZnRPFvSw3gQIhAMI+5v7a | |||
ea5K8PaGppAIi/55yHqYlXLgaMB4ohu3OsGw | |||
-----END CERTIFICATE----- | |||
CRT | |||
sudo update-ca-certificates --fresh | |||
sudo update-ca-certificates | |||
</syntaxhighlight> | |||
'''Shahed_ECC_Root_CA_2025''' » Firefox » Settings » Certificates » View Certificates » Import | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n cert-manager rollout restart deployment cert-manager-webhook | |||
kubectl get ValidatingWebhookConfiguration cert-manager-webhook | |||
</syntaxhighlight> | |||
* [[Helm/Cert_Manager#Cert Manager » Webhook » Fixes|Skipped » Find More 👉 Webhook » Fixes]] | * [[Helm/Cert_Manager#Cert Manager » Webhook » Fixes|Skipped » Find More 👉 Webhook » Fixes]] | ||
<syntaxhighlight lang='bash'> | |||
kubectl -n yourls get Secret yourls-cert -o=yaml | |||
kubectl -n yourls get Certificate yourls-cert -o=yaml | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n yourls delete Secret yourls-cert -o=yaml | |||
kubectl -n yourls delete Certificate yourls-cert -o=yaml | |||
</syntaxhighlight> | |||
|} | |} | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Yourls » Secrect | Yourls » Secrect | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Secrect » MariaDB | Secrect » MariaDB | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << ENV | \ | cat << ENV | \ | ||
kubectl -n yourls \ | kubectl -n yourls \ | ||
| Line 249: | Line 290: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Secrect » Yourls | Secrect » Yourls | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
cat << ENV | \ | cat << ENV | \ | ||
kubectl -n yourls \ | kubectl -n yourls \ | ||
| Line 266: | Line 307: | ||
|} | |} | ||
|} | |} | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Yourls » Volume | Yourls » Volume | ||
|- | |- | ||
| | |valign='top' style='width:50%'| | ||
{|class='wikitable' | |||
|valign='top'| | |||
* [[K8s/Storage#Storage » Mount|Skipped » Find More 👉 Storage » Mount]] | * [[K8s/Storage#Storage » Mount|Skipped » Find More 👉 Storage » Mount]] | ||
---- | ---- | ||
| Line 276: | Line 319: | ||
---- | ---- | ||
* [[K8s/Storage#Storage » Persistent Volume|Skipped » Find More 👉 Storage » Persistent Volume]] | * [[K8s/Storage#Storage » Persistent Volume|Skipped » Find More 👉 Storage » Persistent Volume]] | ||
|} | |||
|valign='top' style='width:50%'| | |||
|- | |- | ||
|valign='top | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml' highlight='13-15'> | ||
cat <<'YML'| \ | cat <<'YML'| \ | ||
kubectl apply -f - | kubectl apply -f - | ||
| Line 300: | Line 344: | ||
YML | YML | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|valign='top | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml' highlight='8,9,16,17'> | ||
cat << YML | \ | cat << YML | \ | ||
kubectl apply -f - | kubectl apply -f - | ||
| Line 327: | Line 371: | ||
==Helm » Upgrade== | ==Helm » Upgrade== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Helm » Upgrade | Helm » Upgrade | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
helm show values yourls/yourls --version=8.5.6|less | helm show values yourls/yourls --version=8.5.6|less | ||
helm show values yourls/yourls --version=8.5.8|less | helm show values yourls/yourls --version=8.5.8|less | ||
| Line 338: | Line 382: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl create ns yourls || true | kubectl create ns yourls || true | ||
kubectl get ns|grep yourls | kubectl get ns|grep yourls | ||
| Line 344: | Line 388: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
helm -n=yourls upgrade -i yourls yourls/yourls --version=8.5.8 -f - | helm --history-max=5 -n=yourls \ | ||
upgrade -i yourls yourls/yourls --version=8.5.8 -f - | |||
--- | --- | ||
replicaCount: 1 | replicaCount: 1 | ||
| Line 359: | Line 404: | ||
service: | service: | ||
type: ClusterIP | type: ClusterIP | ||
yourls: | yourls: | ||
scheme: | scheme: https | ||
skipInstall: true | |||
existingSecret: yourls | |||
domain: go.shahed.biz.ops | domain: go.shahed.biz.ops | ||
ingress: | ingress: | ||
| Line 428: | Line 472: | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
telnet go.shahed.biz.ops 80 | telnet go.shahed.biz.ops 80 | ||
setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | ||
| Line 435: | Line 479: | ||
==Helm » Patch== | ==Helm » Patch== | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Helm » Patch | Helm » Patch | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin | kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin | ||
| Line 457: | Line 501: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin | kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin | ||
| Line 474: | Line 518: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | ||
setsid open https://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | setsid open https://go.shahed.biz.ops/admin/ >/dev/null 2>&1 & | ||
| Line 484: | Line 528: | ||
==Helm » Scale== | ==Helm » Scale== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' style='width:50%'| | !scope='col' style='text-align:left' style='width:50%'| | ||
Yourls » Stop | Yourls » Stop | ||
| Line 491: | Line 535: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | ||
| Line 501: | Line 545: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | ||
| Line 512: | Line 556: | ||
==Helm » Debug== | ==Helm » Debug== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Helm » Debug | Helm » Debug | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/resolv.conf | kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/resolv.conf | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/hosts | kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/hosts | ||
| Line 526: | Line 570: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- bash | kubectl -n yourls exec -it svc/yourls -c yourls -- bash | ||
:' | :' | ||
| Line 537: | Line 581: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$name = "Yourls"; echo "Hello, {$name}\n";' | kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$name = "Yourls"; echo "Hello, {$name}\n";' | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$time = time() ; echo "Time : {$time}\n";' | kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$time = time() ; echo "Time : {$time}\n";' | ||
| Line 549: | Line 593: | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$timestamp = time();$signature = md5( $timestamp . "1002a612b4" ); echo "Signature: {$signature}\n";' | kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$timestamp = time();$signature = md5( $timestamp . "1002a612b4" ); echo "Signature: {$signature}\n";' | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$signature = md5( time() . "1002a612b4" ); echo "Signature: {$signature}\n";' | kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$signature = md5( time() . "1002a612b4" ); echo "Signature: {$signature}\n";' | ||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='php'> | |||
echo; \ | |||
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -s | jq -r .shorturl | |||
<?php | |||
$timestamp = time(); | |||
$signature = md5( $timestamp . '1002a612b4' ); | |||
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}×tamp={$timestamp}&action=shorturl&format=json&url=https://google.com"; | |||
PHP | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='php'> | |||
echo; \ | |||
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -s | jq -r .shorturl | |||
<?php | |||
$timestamp = time(); | |||
$signature = hash( 'sha256' , $timestamp . '1002a612b4' ); | |||
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}×tamp={$timestamp}&hash=sha256&action=shorturl&format=json&url=https://google.com"; | |||
PHP | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
==Helm » Rollout== | ==Helm » Rollout== | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Yourls » Rollout | Yourls » Rollout | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls annotate deploy/yourls --overwrite \ | kubectl -n yourls annotate deploy/yourls --overwrite \ | ||
kubernetes.io/change-cause="CKI-1| Initial Deployment" | kubernetes.io/change-cause="CKI-1| Initial Deployment" | ||
| Line 567: | Line 633: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls rollout history deploy/yourls | kubectl -n yourls rollout history deploy/yourls | ||
kubectl -n yourls rollout pause deploy/yourls | kubectl -n yourls rollout pause deploy/yourls | ||
| Line 580: | Line 646: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | ||
| Line 600: | Line 666: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='yaml'> | ||
cat <<'YML' | \ | cat <<'YML' | \ | ||
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin | ||
| Line 620: | Line 686: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls annotate deploy/yourls --overwrite \ | kubectl -n yourls annotate deploy/yourls --overwrite \ | ||
kubernetes.io/change-cause="CKI-2| Resources Updated" | kubernetes.io/change-cause="CKI-2| Resources Updated" | ||
| Line 626: | Line 692: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls rollout resume deploy/yourls | kubectl -n yourls rollout resume deploy/yourls | ||
kubectl -n yourls rollout history deploy/yourls | kubectl -n yourls rollout history deploy/yourls | ||
| Line 632: | Line 698: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls rollout undo deploy/yourls --to-revision=1 | kubectl -n yourls rollout undo deploy/yourls --to-revision=1 | ||
kubectl -n yourls rollout history deploy/yourls | kubectl -n yourls rollout history deploy/yourls | ||
| Line 638: | Line 704: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls annotate deploy/yourls --overwrite \ | kubectl -n yourls annotate deploy/yourls --overwrite \ | ||
kubernetes.io/change-cause="CKI-3| Revert Back to CKI-1" | kubernetes.io/change-cause="CKI-3| Revert Back to CKI-1" | ||
| Line 644: | Line 710: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls get deploy yourls -o yaml \ | kubectl -n yourls get deploy yourls -o yaml \ | ||
| yq -P '.spec.template.spec.containers[]|select(.name == "yourls")|.resources' | | yq -P '.spec.template.spec.containers[]|select(.name == "yourls")|.resources' | ||
| Line 650: | Line 716: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls get deploy yourls \ | kubectl -n yourls get deploy yourls \ | ||
-o jsonpath='{.spec.template.spec.containers[?(@.name=="yourls")].resources}' | yq -P | -o jsonpath='{.spec.template.spec.containers[?(@.name=="yourls")].resources}' | yq -P | ||
| Line 657: | Line 723: | ||
==Helm » Uninstall== | ==Helm » Uninstall== | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left'| | !scope='col' style='text-align:left'| | ||
Helm » Uninstall | Helm » Uninstall | ||
|- | |- | ||
|valign='top'| | |valign='top'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl delete ns yourls | kubectl delete ns yourls | ||
helm -n yourls status yourls | helm -n yourls status yourls | ||
| Line 674: | Line 740: | ||
==Playground== | ==Playground== | ||
{|class='wikitable mw-collapsible mw-collapsed | {|class='wikitable mw-collapsible mw-collapsed' | ||
!scope='col' style='text-align:left' colspan='2'| | !scope='col' style='text-align:left' colspan='2'| | ||
Playground | Playground | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
helm -n yourls install yourls yourls/yourls --version=8.5.6 | helm -n yourls install yourls yourls/yourls --version=8.5.6 | ||
helm -n yourls upgrade -i yourls yourls/yourls --version=8.5.8 | helm -n yourls upgrade -i yourls yourls/yourls --version=8.5.8 | ||
| Line 686: | Line 752: | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-replication-password"'|base64 -d && echo | kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-replication-password"'|base64 -d && echo | ||
kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-root-password"' |base64 -d && echo | kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-root-password"' |base64 -d && echo | ||
| Line 700: | Line 766: | ||
|- | |- | ||
|valign='top' colspan='2'| | |valign='top' colspan='2'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten | kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten | ||
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten | kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten | ||
| Line 708: | Line 774: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls delete all --all | kubectl -n yourls delete all --all | ||
kubectl -n yourls delete ing --all | kubectl -n yourls delete ing --all | ||
| Line 715: | Line 781: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl delete pv yourls-data-mariadb-0 | kubectl delete pv yourls-data-mariadb-0 | ||
kubectl -n yourls delete svc --all | kubectl -n yourls delete svc --all | ||
| Line 723: | Line 789: | ||
|- | |- | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls rollout history deploy yourls | kubectl -n yourls rollout history deploy yourls | ||
kubectl -n yourls rollout restart deploy yourls | kubectl -n yourls rollout restart deploy yourls | ||
| Line 730: | Line 796: | ||
|valign='top' style='width:50%'| | |valign='top' style='width:50%'| | ||
<syntaxhighlight | <syntaxhighlight lang='bash'> | ||
kubectl -n yourls exec -it svc/yourls -c yourls -- ash | kubectl -n yourls exec -it svc/yourls -c yourls -- ash | ||
kubectl -n yourls logs -f svc/yourls -c yourls | kubectl -n yourls logs -f svc/yourls -c yourls | ||
| Line 738: | Line 804: | ||
==References== | ==References== | ||
{|class='wikitable mw-collapsible | {|class='wikitable mw-collapsible' | ||
!scope='col' style='text-align:left' colspan='3'| | !scope='col' style='text-align:left' colspan='3'| | ||
References | References | ||
| Line 752: | Line 818: | ||
|valign='top' style='width:34%'| | |valign='top' style='width:34%'| | ||
* [https://yourls.org/docs/guide/advanced/passwordless-api Yourls » API » Passwordless] | |||
* [https://yourls.org/docs/guide/advanced/api Yourls » API] | |||
* [[Yourls]] | |||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
Latest revision as of 12:39, 27 January 2026
helm repo add yourls https://charts.yourls.org
helm repo update && helm repo list
kubectl config get-contexts
|
Data
|
Data | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
Config
|
Config | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||
Helm » Upgrade
|
Helm » Upgrade | |
|---|---|
helm show values yourls/yourls --version=8.5.6|less
helm show values yourls/yourls --version=8.5.8|less
|
kubectl create ns yourls || true
kubectl get ns|grep yourls
|
cat <<'YML' | \
helm --history-max=5 -n=yourls \
upgrade -i yourls yourls/yourls --version=8.5.8 -f -
---
replicaCount: 1
nameOverride: ops
fullnameOverride: yourls
revisionHistoryLimit: 5
image:
tag: 1.10.2
registry: ghcr.io
repository: yourls/yourls
service:
type: ClusterIP
yourls:
scheme: https
skipInstall: true
existingSecret: yourls
domain: go.shahed.biz.ops
ingress:
enabled: true
ingressClassName: nginx
pathType: ImplementationSpecific
annotations:
kubernetes.io/tls-acme: "false"
kubernetes.io/ingress.class: nginx
hostname: go.shahed.biz.ops
path: /
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
mariadb:
enabled: false
architecture: standalone
image:
registry: docker.io
repository: bitnamilegacy/mariadb
tag: 10.11.9
auth:
database: shahed_tool_yourls
username: shahed_tool_yourls
existingSecret: yourls-mariadb
primary:
persistence:
size: 1Gi
enabled: true
accessModes:
- ReadWriteOnce
storageClass: hostpath
existingClaim: data-mariadb-0
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
externalDatabase:
port: 3306
host: 192.168.49.1
user: shahed_tool_yourls
database: shahed_tool_yourls
existingSecret: yourls-mariadb
YML
|
|
telnet go.shahed.biz.ops 80
setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 &
| |
Helm » Patch
|
Helm » Patch | |
|---|---|
cat <<'YML' | \
kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin
---
metadata:
annotations:
cert-manager.io/cluster-issuer: shahed-ecc-sub-ca-2025-k8s
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- hosts:
- go.shahed.biz.ops
secretName: yourls-cert
YML
|
cat <<'YML' | \
kubectl -n yourls patch ingress/yourls --patch-file=/dev/stdin
---
metadata:
annotations:
cert-manager.io/cluster-issuer: null
nginx.ingress.kubernetes.io/ssl-redirect: null
spec:
tls: null
YML
|
setsid open http://go.shahed.biz.ops/admin/ >/dev/null 2>&1 &
setsid open https://go.shahed.biz.ops/admin/ >/dev/null 2>&1 &
|
|
Helm » Scale
|
Yourls » Stop |
Yourls » Start |
|---|---|
cat <<'YML' | \
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin
---
spec:
replicas: 0
YML
|
cat <<'YML' | \
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin
---
spec:
replicas: 1
YML
|
Helm » Debug
|
Helm » Debug |
|---|
kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/resolv.conf
kubectl -n yourls exec -it svc/yourls -c yourls -- cat /etc/hosts
kubectl -n yourls exec -it svc/yourls -c yourls -- bash
kubectl -n yourls logs -f svc/yourls -c yourls
kubectl -n yourls logs -f svc/yourls
|
kubectl -n yourls exec -it svc/yourls -c yourls -- bash
:'
export MYSQL_PWD=$(cat /opt/bitnami/mariadb/secrets/mariadb-password)
mariadb -D shahed_tool_yourls -u shahed_tool_yourls
show databases;
show tables;
'
|
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$name = "Yourls"; echo "Hello, {$name}\n";'
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$time = time() ; echo "Time : {$time}\n";'
kubectl -n yourls exec -it svc/yourls -c yourls -- php -a
:'
php > echo time();
1766766506
php >
'
|
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$timestamp = time();$signature = md5( $timestamp . "1002a612b4" ); echo "Signature: {$signature}\n";'
kubectl -n yourls exec -it svc/yourls -c yourls -- php -r '$signature = md5( time() . "1002a612b4" ); echo "Signature: {$signature}\n";'
|
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -s | jq -r .shorturl
<?php
$timestamp = time();
$signature = md5( $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}×tamp={$timestamp}&action=shorturl&format=json&url=https://google.com";
PHP
|
echo; \
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | xargs curl -s | jq -r .shorturl
<?php
$timestamp = time();
$signature = hash( 'sha256' , $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}×tamp={$timestamp}&hash=sha256&action=shorturl&format=json&url=https://google.com";
PHP
|
Helm » Rollout
|
Yourls » Rollout | |
|---|---|
kubectl -n yourls annotate deploy/yourls --overwrite \
kubernetes.io/change-cause="CKI-1| Initial Deployment"
|
kubectl -n yourls rollout history deploy/yourls
kubectl -n yourls rollout pause deploy/yourls
|
|
Yourls » Rollout |
Yourls » Revert |
cat <<'YML' | \
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin
---
spec:
template:
spec:
containers:
- name: yourls
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
YML
|
cat <<'YML' | \
kubectl -n yourls patch deploy/yourls --patch-file=/dev/stdin
---
spec:
template:
spec:
containers:
- name: yourls
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
YML
|
kubectl -n yourls annotate deploy/yourls --overwrite \
kubernetes.io/change-cause="CKI-2| Resources Updated"
|
kubectl -n yourls rollout resume deploy/yourls
kubectl -n yourls rollout history deploy/yourls
|
kubectl -n yourls rollout undo deploy/yourls --to-revision=1
kubectl -n yourls rollout history deploy/yourls
|
kubectl -n yourls annotate deploy/yourls --overwrite \
kubernetes.io/change-cause="CKI-3| Revert Back to CKI-1"
|
kubectl -n yourls get deploy yourls -o yaml \
| yq -P '.spec.template.spec.containers[]|select(.name == "yourls")|.resources'
|
kubectl -n yourls get deploy yourls \
-o jsonpath='{.spec.template.spec.containers[?(@.name=="yourls")].resources}' | yq -P
|
Helm » Uninstall
|
Helm » Uninstall |
|---|
kubectl delete ns yourls
helm -n yourls status yourls
helm -n yourls get all yourls
helm -n yourls uninstall yourls
kubectl -n yourls delete pvc --all
kubectl delete pv yourls-data-mariadb-0
|
Playground
|
Playground | |
|---|---|
helm -n yourls install yourls yourls/yourls --version=8.5.6
helm -n yourls upgrade -i yourls yourls/yourls --version=8.5.8
helm show values yourls/yourls --version=8.5.8|less
| |
kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-replication-password"'|base64 -d && echo
kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-root-password"' |base64 -d && echo
kubectl -n yourls get secret yourls-mariadb -o json|jq -r '.data."mariadb-password"' |base64 -d && echo
kubectl -n yourls get secret yourls -o json|jq -r '.data.username'|base64 -d && echo
kubectl -n yourls get secret yourls -o json|jq -r '.data.password'|base64 -d && echo
kubectl -n yourls exec -it svc/yourls -c yourls -- bash
kubectl -n yourls logs -f svc/yourls -c yourls
kubectl -n yourls logs -f svc/yourls
| |
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten
| |
kubectl -n yourls delete all --all
kubectl -n yourls delete ing --all
kubectl -n yourls delete sts --all
|
kubectl delete pv yourls-data-mariadb-0
kubectl -n yourls delete svc --all
kubectl -n yourls delete pvc --all
|
kubectl -n yourls rollout history deploy yourls
kubectl -n yourls rollout restart deploy yourls
kubectl -n yourls rollout status deploy yourls
|
kubectl -n yourls exec -it svc/yourls -c yourls -- ash
kubectl -n yourls logs -f svc/yourls -c yourls
kubectl -n yourls logs -f svc/yourls
|
References
|
References | ||
|---|---|---|