Helm/Yourls: Difference between revisions
Jump to navigation
Jump to search
| (One intermediate revision by the same user not shown) | |||
| Line 222: | Line 222: | ||
|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' style='width:100%;margin:6px 0 3px 0' | {|class='wikitable mw-collapsible' style='width:100%;margin:6px 0 3px 0' | ||
| Line 776: | Line 814: | ||
* [https://yourls.org/docs/guide/advanced/passwordless-api Yourls » API » Passwordless] | * [https://yourls.org/docs/guide/advanced/passwordless-api Yourls » API » Passwordless] | ||
* [https://yourls.org/docs/guide/advanced/api Yourls » API] | * [https://yourls.org/docs/guide/advanced/api Yourls » API] | ||
* [[Yourls]] | |||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
Latest revision as of 07:46, 26 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 | ||
|---|---|---|