notes for jenkins-agent using ssh

This is my note for add jenkins-agent using ssh

  1. Create new node at jenkins dashboard and setting directory for root directory file for storing your deployment
  2. Choose Launch Agent via ssh
  3. Add host for remote agent
  4. Choose Jenkins credential > SSH Username with private key
  5. Add login vm username
  6. Add credential > copy your id ~/.ssh/id_rsa to private key
  7. Host key verification choose Non
  8. and dont forget to copy you id_rsa.pub to remote ~/.ssh/authorized_keys
  9. Dont forget install java because agent using java “sudo apt install openjdk-17-jdk”
  10. Thats it dont forget to see your log

The differences between on-premises, IaaS, PaaS, and FaaS

The terms “on-premises,” “IaaS” (Infrastructure as a Service), “PaaS” (Platform as a Service), and “FaaS” (Functions as a Service) refer to different deployment and service models in the realm of cloud computing and infrastructure management. Here’s an overview of the key differences between these concepts:

AspectOn-PremisesIaaSPaaSFaaS
LocationOn-premisesCloud Data CentersCloud Data CentersCloud Data Centers
Ownership and ControlFull controlLimited controlMinimal controlNo control (abstracted)
ResponsibilityFull ownershipInfrastructure managementApplication developmentFunction implementation
ScalabilityManual, hardware purchaseOn-demand virtual resourcesAutomatic, based on app demandAutomatic, event-driven
ExamplesTraditional data centersAWS, Azure, GCPHeroku, Google App EngineAWS Lambda, Azure Functions
Management ComplexityHighModerateLowVery Low
Infrastructure DetailsManaged in-houseManaged by IaaS providerAbstracted by PaaS providerFully abstracted by FaaS provider
Use CasesLegacy systems, data-sensitive workloadsScalable web apps, virtualized environmentsWeb and mobile app developmentEvent-driven, microservices
Deployment SpeedSlower due to hardware provisioningFaster virtual resource provisioningFast application deploymentInstant function deployment
Resource Cost FlexibilityLimited flexibilityFlexible based on resource usageResource cost bundled with platformGranular billing based on function execution
Maintenance EffortHigh (hardware and software)Moderate (virtual infrastructure)Low (focus on code)Minimal (purely code)

 

China’s Little Giant

Merics Report

Nice topic how china success to fosters their Little Giant Companies

The MERICS Report titled “Accelerator State: How China fosters ‘Little Giant’ companies” provides an in-depth analysis of China’s evolving industrial policy, focusing on the promotion and support of high-tech small and medium-sized enterprises (SMEs). Here’s a summarized overview:

  • Emergence of High-Tech SMEs: These companies are crucial in China’s industrial policy, specializing in niche markets and developing domestic alternatives to foreign inputs.
  • Shift in Policy Focus: Previously, Chinese policy focused on larger firms, but now there’s a significant push towards smaller, innovative companies.
  • Tiered-Cultivation System: A multi-level support system is in place to identify and fast-track the growth of specialized high-tech SMEs.
  • “Specialized SMEs” and “Little Giants”: These are government-certified high-tech SMEs that receive extensive support but face competition and re-evaluation every three years.
  • Increased Financing: The government is directing significant financial resources towards high-tech companies, increasing access to loans and equity markets.
  • Comprehensive Support System: This includes subsidies, R&D support, collaboration with universities, and a favorable intellectual property system.
  • Risks and Rewards: While the system has successfully fostered companies like Leaderdrive and Endovastec, there are concerns about misallocation of resources and the efficacy of officials in identifying promising firms.
  • Challenge for Foreign Companies: Foreign firms face increasing competition from these state-backed SMEs, both within China and globally.

Detailed Insights

  • Government Strategy: The report details the Chinese government’s strategy to cultivate a robust domestic high-tech sector, including financial incentives, market access, and R&D support.
  • Impact on Foreign Business: The growing competence and global reach of these SMEs pose a significant challenge to foreign companies in similar sectors.
  • Challenges and Criticisms: The system’s dependence on government selection and support raises questions about its long-term sustainability and effectiveness.
  • Global Implications: The rise of these SMEs is likely to have significant implications for global markets, especially in high-tech industries.

Conclusion

China’s focus on fostering high-tech SMEs through a comprehensive state-backed system marks a significant shift in its industrial policy. While this approach has successfully cultivated a number of promising companies, it also presents challenges, both internally in terms of resource allocation and externally in terms of global market dynamics.

Jenkins pipeline running docker

pipeline {
agent { label 'server_61' }

stages {
stage('Checkout') {
steps {
checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[url: '[email protected]:github.git/']])
}
}

stage('Down Docker') {
steps {
script {
sh 'docker-compose down'
}
}
}

stage('Remove Image') {
steps {
script {
// Check if the Docker image exists and remove it if it does
sh 'docker image ls dashboardpkt_app:latest | grep dashboardpkt_app && docker image rm dockrimg:latest || echo "Image not found, skipping removal"'
}
}
}

stage('Remove Volume') {
steps {
script {
// Check if the Docker volume exists and remove it if it does
sh 'docker volume ls | grep dashboardpkt_build-app && docker volume rm dockervolume || echo "Volume not found, skipping removal"'
}
}
}

stage('Build and Run Docker Compose') {
steps {
script {
sh 'docker-compose up --build -d'
}
}
}
}
}

Tambahan tips kalau jekins tidak bisa jalan karena masalah ssl error

jalankan command ini di vm jenkins

ssh-keyscan github.com >> ~/.ssh/known_hosts

Running github action runner run.sh as services in ubuntu

# create file runner-services.sh
#!/bin/bash

# Your script commands her
/home/username/actions-runner/run.sh

# create file service at /etc/systemd/services/action-runner.service

[Unit]
Description=action-runner

[Service]
ExecStart=/home/username/actions-runner/runner-services.sh
Restart=on-failure
User=username -> adjust with your username
Group=username -> adjust with your username

[Install]
WantedBy=multi-user.target

Resume buku psychology of money

Buku yang menarik , mengajarkan cara menggunakan uang secara bijak, jadi dapat banyak insight insight di buku ini.

Berikut adalah beberapa poin penting dari buku Psychology of Money:

    • Emosi dapat memengaruhi keputusan keuangan kita secara negatif. Ketika kita membuat keputusan keuangan, kita sering kali didorong oleh emosi, seperti ketakutan, keserakahan, atau amarah. Hal ini dapat membuat kita mengambil keputusan yang tidak rasional.
    • Kita cenderung mengabaikan risiko yang tidak terlihat. Kita cenderung lebih memperhatikan risiko yang jelas dan nyata, seperti risiko kehilangan pekerjaan atau sakit. Namun, kita sering kali mengabaikan risiko yang tidak terlihat, seperti risiko inflasi atau penurunan nilai saham.
    • Kita sering kali terlalu percaya diri. Kita sering kali percaya bahwa kita dapat mengalahkan pasar atau mendapatkan keuntungan besar dari investasi. Namun, kenyataannya, sebagian besar orang tidak dapat melakukannya.
    • Penting untuk memiliki rencana keuangan dan disiplin dalam menjalankannya. Rencana keuangan dapat membantu kita untuk tetap fokus pada tujuan keuangan kita. Disiplin dalam menjalankan rencana keuangan dapat membantu kita untuk mencapai tujuan tersebut.

Berikut adalah beberapa contoh spesifik penerapan prinsip-prinsip dalam buku Psychology of Money dalam kehidupan sehari-hari:

  • Saat Anda mendapatkan kenaikan gaji, jangan langsung meningkatkan gaya hidup Anda. Sebaliknya, gunakan kenaikan gaji Anda untuk meningkatkan tabungan atau investasi Anda.
  • Saat Anda menghadapi tagihan yang tidak terduga, jangan panik. Cobalah untuk membuat anggaran baru untuk mengatasi tagihan tersebut. Anda juga dapat mencoba untuk mendapatkan penghasilan tambahan untuk menutupi tagihan tersebut.
  • Saat Anda membuat keputusan keuangan yang besar, seperti membeli rumah atau mobil, pastikan untuk mempertimbangkan semua faktor, termasuk biaya jangka panjang dan kemampuan Anda untuk membayar biaya tersebut. Jangan hanya membuat keputusan berdasarkan emosi.
  • Saat Anda merasa tergoda untuk membeli sesuatu yang tidak Anda butuhkan, tanyakan pada diri sendiri apakah Anda benar-benar membutuhkan barang tersebut. Jika jawabannya tidak, maka jangan membeli barang tersebut.
  • Saat Anda membuat anggaran, pastikan untuk memasukkan pos untuk tabungan dan investasi. Tabungan dan investasi akan membantu Anda untuk mencapai tujuan keuangan jangka panjang Anda.

Install node-red via docker

Create docker volume for persistent data

docker volume create --name node_red_data

Run docker
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red

backup volume node-red
docker cp  mynodered:/data  /your/backup/directory

Enable tuneling at proxmox lxc

Noted for me adding tuneling at proxmox lxc.

Open proxmox host shell and open /etc/pve/lxcnumber/lxc.conf (/etc/pve/100/100.conf) and then add this

lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir

and then
chown 100000:100000 /dev/net/tun

after that reboot the container and voila success if problem still occure change dns setting add 1.1.1.1 to the dns server

Thats it, its works for me

Happy coding and Salam ngoprek

Belajar Kubernetes dengan k3s bagian 1

Catatan belajar kubernetes dengan k3s, semoga bermanfaat juga buat yang lain

langkah pertama instalasi, saya menggunakan ubuntu server sebagai host dokumentasi k3s silahkan baca disini

Langkah langkah installasi k3s

curl -sfL https://get.k3s.io | sh -

lalu copykan config k3s ke kubectl dengan command

sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
Setelah itu pastikan node berjalan dengan mengetikkan
kubectl ger nodes
Biasanya butuh beberapa saat sampai dengan nodes berjalan
Apabila status ready seperti diatas maka k3s sudah berjalan, selamat anda sudah berhasil menginstall k3s
Happy coding dan salam ngoprek
Scroll to Top