惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
SecWiki News
SecWiki News
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
Jina AI
Jina AI
N
Netflix TechBlog - Medium
GbyAI
GbyAI
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
I
Intezer
T
Tor Project blog
P
Palo Alto Networks Blog
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
Cloudbric
Cloudbric
Y
Y Combinator Blog
The Last Watchdog
The Last Watchdog
Forbes - Security
Forbes - Security
Last Week in AI
Last Week in AI
S
Security Affairs
博客园 - Franky
F
Fortinet All Blogs
量子位
M
MIT News - Artificial intelligence
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
S
Secure Thoughts
V
Visual Studio Blog
AI
AI
美团技术团队
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
T
Threatpost
Cyberwarzone
Cyberwarzone

Xinwei Xiong (cubxxw) - AI, Open Source & Nomad Blog

2026 June Thought Notes: The Pushing-Away Comes Be… | cubxxw Dissecting open-lovable: An App Generator That Tam… | cubxxw Ignite and Settle (Part 3): Anxious Attachment — W… | cubxxw Ignite and Settle (Part 2): Avoidant Attachment — … | cubxxw Ignite and Settle (Part 1): The Quality and Time o… | cubxxw The Super-Individual Stack: AI-Native Product Dire… | cubxxw Building a Production-Grade AI Agent System from S… | cubxxw Seen Clearly, Loved Deeply: Five Lenses on Love, a… | cubxxw Context Is Not Prompt: Why Context Engineering Is Becoming AI's New Foundation The Agent Engineering Map: Where Does That 98.4% o… | cubxxw April 2026 Thought Notes Agent Identity: From Locke to OpenClaw Maintaining Self-Worth in the Age of AI March 2026 Thought Notes Lhasa: Slow and Heavy Wandering & Growing: 2025-2026 Annual Review AI and Self-Identity: Who Am I in the AI Age February 2026 Thought Notes January 2026 Thought Notes December 2025 Thought Notes Japan Travel Notes — Learning to Be with Time Through Wood, Fire, and Gaps 2025 November Thought Notes October 2025 Thought Notes September 2025 Thought Notes 2025 August Thought Notes 2025 July Thought Notes 2025 June Thought Notes Metacognitive Transformation Review 2025 May Thought Notes 2025 April Thought Notes AI Recommendation Systems: How They Work NotebookLM: Google's AI Research Tool TDD for AI: Test-Driven Development Guide MarkItDown: Convert Documents to Markdown LangGraph: Stateful AI Agent Workflows LangChain: Open Source LLM Framework LLM/AI API Gateway Market Analysis & Startup Stack Recommendations Independent Developer in the AI Era: Open Source Deep Dive GPT Researcher: Open Source Deep Dive Jina AI: Multimodal Search & Embeddings 2025 March Thought Notes 2024 Annual Review Travel Footprints About Me Kubernetes Resources and Learning Path Summary LangChain: Building LLM Applications Large Language Models: How LLMs Work Open Source Resume Builders & Career Tips Troubleshooting Guide for OpenIM Navigating the Open Source Landscape Sora Ease Guide: Mastering Sora AI for Developers In 2023, I Was Wandering at the Edge of the World Exploring Sora Technology for Enthusiasts and Developers Combining GitHub and Google Workspace for Effective Project Management Brain-Friendly English Learning Strategies Flow State: Deep Focus and Happiness Guide GTD and the Quadrant Method Practice Go Directives & Automation Tools Deep Dive Concurrent Type Checking and Cross-Platform Development in Go Vector Database Learning OpenIM: Version Control & Testing Workflow Emerging Challenges and Trends in 2024 2023 Annual Summary Reflections and Aspirations GitOps & Kubernetes Deployment Strategies Deployment and Design of Management Backend and Monitoring Hugo Advanced Tutorial Kubernetes for Kustomize Learning OpenIM Use Harbor Build Enterprise Mirror Repositories Learn About Automated Testing Deep Dive into Kubernetes CNI, CRI, CSI Components Kubernetes Control Plane - Detailed Analysis of Kubelet Kubernetes Control Plane - Scheduler In-depth understanding of the components of Kubernetes Kube apisserver Deep Dive Into the Components of Kubernetes Etcd OpenIM clustering design Kubernetes deploy concludes Open Source Business: From Community to Revenue The Art of Asking Questions in Open Source Communities Open Source Contribution Guidelines Cross Platform Compilation Github Actions Advanced Techniques Openim Devops Design GoReleaser: Automate your software releases Openim Multi Process Management About My Blog About My Hugo teaching Openkf Multi Architecture Image Prow Ecological Learning Openim Remote Work Culture Advanced Githook Design Openim Offline Deployment Design Read Openim Project Sealos Openim Source Code Project Management From Theory to Practice Stage Growth of Open Source Use Auto Gpt Use Go Tools Dlv Participating in This Project Kubernetes an Article to Get Started Quickly Start Here | cubxxw 分类 · CATEGORIES
Kubernetes Port Config via Config Files
Xinwei Xiong · 2023-09-18 · via Xinwei Xiong (cubxxw) - AI, Open Source & Nomad Blog

[Xinwei Xiong Me] · September 18, 2023

2 min · 402 words · EN |

Introduction

In the current module’s execution, numerous ports (ws, api, rpc, Prometheus) are passed directly. This approach can be cumbersome and doesn’t align with Kubernetes’ best practices where a pod typically exposes only one port (either 80 or 443). This proposal suggests transitioning to a configuration file-centric approach, while still retaining the capability to pass ports directly when needed.

Goals

  1. Simplify the port configuration for Kubernetes deployment.
  2. Prioritize port values passed as arguments over configuration file values.
  3. Provide flexibility to users who wish to use traditional port-based or environment variable-based deployments.

Proposed Solution

1. Configuration File

Instead of passing multiple ports directly, a configuration file will be introduced. By default, this file will contain predefined ports. This configuration file can be passed to the module using Kubernetes’ ConfigMap.

Example Configuration File:

ws_port: 3000
api_port: 3001
rpc_port: 3002
prometheus_port: 9090

2. Passing Ports Directly

While the configuration file approach is recommended for Kubernetes deployment, users can still pass the ports directly. If ports are passed as arguments, these values will override the values from the configuration file.

3. Environment Variable-based Deployment

For users who prefer source code deployment using environment variables, the module can be designed to read port values set as environment variables on a Linux system. If these environment variables are set, they will override the configuration file values but will have lower precedence than port values passed directly as arguments.

Example: If WS_PORT environment variable is set to 3005, it will override the ws_port value from the configuration file, unless ws_port is passed as an argument.

Implementation Steps

  1. Update Module to Read Configuration File: Modify the module to read port values from the provided configuration file.
  2. Argument-based Overrides: Implement logic to override configuration file port values if they are provided as arguments.
  3. Environment Variable-based Overrides: Implement logic to check for environment variables and use those values if set. Ensure that direct argument values have the highest priority.
  4. Documentation: Update documentation to provide clear instructions on the three methods of setting port values: configuration file, direct arguments, and environment variables.
  5. Testing: Thoroughly test the module in different scenarios:
    • Using only the configuration file.
    • Passing ports as arguments.
    • Setting environment variables.

Conclusion

Adopting a configuration file approach simplifies the deployment process, especially in Kubernetes environments. While the configuration file is prioritized for simplicity, the flexibility of passing ports directly or using environment variables ensures backward compatibility and caters to various user preferences.