Helm/Yourls: Difference between revisions
Jump to navigation
Jump to search
| Line 552: | Line 552: | ||
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 style='margin:3px 0' lang='php'> | |||
echo;\ | |||
cat <<'PHP' | kubectl -n yourls exec -i svc/yourls -c yourls -- php /dev/stdin | |||
<?php | |||
$timestamp = time(); | |||
$signature = md5( $timestamp . '1002a612b4' ); | |||
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&action=\n"; | |||
PHP | |||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
Revision as of 17:03, 26 December 2025
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 -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:
port: 80
type: ClusterIP
httpsTargetPort: http
yourls:
scheme: http
domain: go.shahed.biz.ops
existingSecret: yourls
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
<?php
$timestamp = time();
$signature = md5( $timestamp . '1002a612b4' );
echo "https://go.shahed.biz.ops/yourls-api.php?signature={$signature}&action=\n";
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 | ||
|---|---|---|