Spring Cloud Kubernetes

【Kubernetes的SpringCloud最佳实践】Spring Cloud netflix 能否被K8s资源完全替代? Spring Cloud netflix能否被K8s替代最佳实践? 阅读详情

Spring Cloud Kubernetes

Spring Cloud integration with Kubernetes

Maven Central Apache 2

Features


DiscoveryClient for Kubernetes

Maven Central Javadocs Dependency Status

This project provides an implementation of Discovery Client for Kubernetes. This allows you to query Kubernetes endpoints (see services) by name. A service is typically exposed by the Kubernetes API server as a collection of endpoints which represent http, https addresses that a client can access from a Spring Boot application running as a pod. This discovery feature is also used by the Spring Cloud Kubernetes Ribbon or Zipkin projects to fetch respectively the list of the endpoints defined for an application to be load balanced or the Zipkin servers available to send the traces or spans.

This is something that you get for free just by adding the following dependency inside your project:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-kubernetes</artifactId>
    <version>${latest.version}</version>
</dependency>

Then you can inject the client in your code simply by:

@Autowire
private DiscoveryClient discoveryClient;

If for any reason you need to disable the DiscoveryClient you can simply set the following property in application .properties:

spring.cloud.kubernetes.discovery.enabled=false

Some Spring Cloud components use the DiscoveryClient in order to obtain info about the local service instance. For this to work you need to align the service name with the spring.application.name property.

Kubernetes PropertySource

The most common approach to configure your Spring Boot application is to create an application.properties|yaml or an application-profile.properties|yaml file containing key-value pairs providing customization values to your application or Spring Boot starters. Users may override these properties by specifying system properties or environment variables.

ConfigMap PropertySource

Kubernetes provides a resource named ConfigMap to externalize the parameters to pass to your application in the form of key-value pairs or embedded application.properties|yaml files. The Spring Cloud Kubernetes Config project makes Kubernetes ConfigMaps available during application bootstrapping and triggers hot reloading of beans or Spring context when changes are detected on observed ConfigMaps.

ConfigMapPropertySource will search for a Kubernetes ConfigMap which metadata.name is either the name of your Spring application (as defined by its spring.application.name property) or a custom name defined within thebootstrap.properties file under the following key spring.cloud.kubernetes.config.name.

If such a ConfigMap is found, it will be processed as follows:

  • apply individual configuration properties.
  • apply as yaml the content of any property named application.yaml
  • apply as properties file the content of any property named application.properties

Example:

Let's assume that we have a Spring Boot application named demo that uses properties to read its thread pool configuration.

  • pool.size.core
  • pool.size.maximum

This can be externalized to config map in yaml format:

kind: ConfigMap
apiVersion: v1
metadata:
  name: demo
data:
  pool.size.core: 1
  pool.size.max: 16

Individual properties work fine for most cases but sometimes embedded yaml is more convenient. In this case we will use a single property named application.yaml to embed our yaml:

kind: ConfigMap
apiVersion: v1
metadata:
 name: demo
data:
 application.yaml: |-
   pool:
     size:
       core: 1
       max:16

Spring Boot applications can also be configured differently depending on active profiles and it is possible to provide different property values for different profiles using an application.properties|yaml property, specifying profile-specific values each in their own document (indicated by the --- sequence) as follows:

kind: ConfigMap
apiVersion: v1
metadata:
  name: demo
data:
  application.yml: |-
    greeting:
      message: Say Hello to the World
    ---
    spring:
      profiles: development
    greeting:
      message: Say Hello to the Developers
    ---
    spring:
      profiles: production
    greeting:
      message: Say Hello to the Ops

To tell to Spring Boot which profile should be enabled at bootstrap, a system property can be passed to the Java command launching your Spring Boot application using an env variable that you will define with the OpenShift DeploymentConfig or Kubernetes ReplicationConfig resource file as follows:

apiVersion: v1
kind: DeploymentConfig
spec:
  replicas: 1
  ...
    spec:
      containers:
      - env:
        - name: JAVA_APP_DIR
          value: /deployments
        - name: JAVA_OPTIONS
          value: -Dspring.profiles.active=developer

Notes:

  • To access ConfigMaps on OpenShift the service account needs at least view permissions i.e.:

    oc policy add-role-to-user view system:serviceaccount:$(oc project -q):default -n $(oc project -q)

Properties:

NameTypeDefaultDescription
spring.cloud.kubernetes.config.enabledBooleantrueEnable Secrets PropertySource
spring.cloud.kubernetes.config.nameString${spring.application.name}Sets the name of ConfigMap to lookup
spring.cloud.kubernetes.config.namespaceStringClient namespaceSets the Kubernetes namespace where to lookup
spring.cloud.kubernetes.config.pathsListnullSets the paths were ConfigMaps are mounted
spring.cloud.kubernetes.config.enableApiBooleantrueEnable/Disable consuming ConfigMaps via APIs
Secrets PropertySource

Kubernetes has the notion of Secrets for storing sensitive data such as password, OAuth tokens, etc. This project provides integration with Secrets to make secrets accessible by Spring Boot applications. This feature can be explicitly enabled/disabled using the spring.cloud.kubernetes.secrets.enabled property.

The SecretsPropertySource when enabled will lookup Kubernetes for Secrets from the following sources:

  1. reading recursively from secrets mounts
  2. named after the application (as defined by spring.application.name)
  3. matching some labels

Please note that by default, consuming Secrets via API (points 2 and 3 above) is not enabled for security reasons and it is recommend that containers share secrets via mounted volumes.

If the secrets are found their data is made available to the application.

Example:

Let's assume that we have a spring boot application named demo that uses properties to read its database configuration. We can create a Kubernetes secret using the following command:

oc create secret generic db-secret --from-literal=username=user --from-literal=password=p455w0rd

This would create the following secret (shown using oc get secrets db-secret -o yaml):

apiVersion: v1
data:
  password: cDQ1NXcwcmQ=
  username: dXNlcg==
kind: Secret
metadata:
  creationTimestamp: 2017-07-04T09:15:57Z
  name: db-secret
  namespace: default
  resourceVersion: "357496"
  selfLink: /api/v1/namespaces/default/secrets/db-secret
  uid: 63c89263-6099-11e7-b3da-76d6186905a8
type: Opaque

Note that the data contains Base64-encoded versions of the literal provided by the create command.

This secret can then be used by your application for example by exporting the secret's value as environment variables:

apiVersion: v1
kind: Deployment
metadata:
  name: ${project.artifactId}
spec:
   template:
     spec:
       containers:
         - env:
            - name: DB_USERNAME
              valueFrom:
                 secretKeyRef:
                   name: db-secret
                   key: username
            - name: DB_PASSWORD
              valueFrom:
                 secretKeyRef:
                   name: db-secret
                   key: password

You can select the Secrets to consume in a number of ways:

  1. By listing the directories were secrets are mapped:

    -Dspring.cloud.kubernetes.secrets.paths=/etc/secrets/db-secret,etc/secrets/postgresql
    

    If you have all the secrets mapped to a common root, you can set them like:

    -Dspring.cloud.kubernetes.secrets.paths=/etc/secrets
    
  2. By setting a named secret:

    -Dspring.cloud.kubernetes.secrets.name=db-secret
    
  3. By defining a list of labels:

    -Dspring.cloud.kubernetes.secrets.labels.broker=activemq
    -Dspring.cloud.kubernetes.secrets.labels.db=postgresql
    

Properties:

NameTypeDefaultDescription
spring.cloud.kubernetes.secrets.enabledBooleantrueEnable Secrets PropertySource
spring.cloud.kubernetes.secrets.nameString${spring.application.name}Sets the name of the secret to lookup
spring.cloud.kubernetes.secrets.namespaceStringClient namespaceSets the Kubernetes namespace where to lookup
spring.cloud.kubernetes.secrets.labelsMapnullSets the labels used to lookup secrets
spring.cloud.kubernetes.secrets.pathsListnullSets the paths were secrets are mounted (example 1)
spring.cloud.kubernetes.secrets.enableApiBooleanfalseEnable/Disable consuming secrets via APIs (examples 2 and 3)

Notes:

  • The property spring.cloud.kubernetes.secrets.labels behaves as defined by Map-based binding.
  • The property spring.cloud.kubernetes.secrets.paths behaves as defined by Collection-based binding.
  • Access to secrets via API may be restricted for security reasons, the preferred way is to mount secret to the POD.

Example of application using secrets (though it hasn't been updated to use the new spring-cloud-kubernetes project):spring-boot-camel-config

PropertySource Reload

Some applications may need to detect changes on external property sources and update their internal status to reflect the new configuration. The reload feature of Spring Cloud Kubernetes is able to trigger an application reload when a related ConfigMap or Secret changes.

This feature is disabled by default and can be enabled using the configuration property spring.cloud.kubernetes.reload.enabled=true (eg. in the application.properties file).

The following levels of reload are supported (property spring.cloud.kubernetes.reload.strategy):

  • refresh (default): only configuration beans annotated with @ConfigurationProperties or @RefreshScope are reloaded. This reload level leverages the refresh feature of Spring Cloud Context.
  • restart_context: the whole Spring ApplicationContext is gracefully restarted. Beans are recreated with the new configuration.
  • shutdown: the Spring ApplicationContext is shut down to activate a restart of the container. When using this level, make sure that the lifecycle of all non-daemon threads is bound to the ApplicationContext and that a replication controller or replica set is configured to restart the pod.

Example:

Assuming that the reload feature is enabled with default settings (refresh mode), the following bean will be refreshed when the config map changes:

@Configuration
@ConfigurationProperties(prefix = "bean")
public class MyConfig {

    private String message = "a message that can be changed live";

    // getter and setters

}

A way to see that changes effectively happen is creating another bean that prints the message periodically.

@Component
public class MyBean {

    @Autowired
    private MyConfig config;

    @Scheduled(fixedDelay = 5000)
    public void hello() {
        System.out.println("The message is: " + config.getMessage());
    }
}

The message printed by the application can be changed using a ConfigMap as follows:

apiVersion: v1
kind: ConfigMap
metadata:
  name: reload-example
data:
  application.properties: |-
    bean.message=Hello World!

Any change to the property named bean.message in the ConfigMap associated to the pod will be reflected in the output. More generally speaking, changes associated to properties prefixed with the value defined by the prefix field of the @ConfigurationProperties annotation will be detected and reflected in the application. Associating a ConfigMap to a pod is explained above.

The full example is available in spring-cloud-kubernetes-reload-example.

The reload feature supports two operating modes:

  • event (default): watches for changes in config maps or secrets using the Kubernetes API (web socket). Any event will produce a re-check on the configuration and a reload in case of changes. The view role on the service account is required in order to listen for config map changes. A higher level role (eg. edit) is required for secrets (secrets are not monitored by default).
  • polling: re-creates the configuration periodically from config maps and secrets to see if it has changed. The polling period can be configured using the property spring.cloud.kubernetes.reload.period and defaults to 15 seconds. It requires the same role as the monitored property source. This means, for example, that using polling on file mounted secret sources does not require particular privileges.

Properties:

NameTypeDefaultDescription
spring.cloud.kubernetes.reload.enabledBooleanfalseEnables monitoring of property sources and configuration reload
spring.cloud.kubernetes.reload.monitoring-config-mapsBooleantrueAllow monitoring changes in config maps
spring.cloud.kubernetes.reload.monitoring-secretsBooleanfalseAllow monitoring changes in secrets
spring.cloud.kubernetes.reload.strategyEnumrefreshThe strategy to use when firing a reload (refresh, restart_context, shutdown)
spring.cloud.kubernetes.reload.modeEnumeventSpecifies how to listen for changes in property sources (event, polling)
spring.cloud.kubernetes.reload.periodLong15000The period in milliseconds for verifying changes when using the polling strategy

Notes:

  • Properties under spring.cloud.kubernetes.reload. should not be used in config maps or secrets: changing such properties at runtime may lead to unexpected results;
  • Deleting a property or the whole config map does not restore the original state of the beans when using the refresh level.

Pod Health Indicator

Spring Boot uses HealthIndicator to expose info about the health of an application. That makes it really useful for exposing health related information to the user and are also a good fit for use as readiness probes.

The Kubernetes health indicator which is part of the core module exposes the following info:

  • pod name, ip address, namespace, service account, node name and its ip address
  • flag that indicates if the Spring Boot application is internal or external to Kubernetes

Transparency

All of the features described above will work equally well regardless of whether your application is running inside Kubernetes or not. This is really helpful for development and troubleshooting. From a development point of view, this is really helpful as you can start your Spring Boot application and debug one of the modules part of this project. It is not required to deploy it in Kubernetes as the code of the project relies on the Fabric8 Kubernetes Java client which is a fluent DSL able to communicate using http protocol to the REST API of Kubernetes Server.

Kubernetes Profile Autoconfiguration

When the application runs as a pod inside Kubernetes a Spring profile named kubernetes will automatically get activated. This allows the developer to customize the configuration, to define beans that will be applied when the Spring Boot application is deployed within the Kubernetes platform (e.g. different dev and prod configuration).

Ribbon discovery in Kubernetes

Maven Central Javadocs Dependency Status

Spring Cloud client applications calling a microservice should be interested on relying on a client load-balancing feature in order to automatically discover at which endpoint(s) it can reach a given service. This mechanism has been implemented within the spring-cloud-kubernetes-ribbon project where a Kubernetes client will populate a Ribbon ServerList containing information about such endpoints.

The implementation is part of the following starter that you can use by adding its dependency to your pom file:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-kubernetes-netflix</artifactId>
    <version>${latest.version}</version>
</dependency>

When the list of the endpoints is populated, the Kubernetes client will search the registered endpoints living in the current namespace/project matching the service name defined using the Ribbon Client annotation:

@RibbonClient(name = "name-service")

You can configure Ribbon's behavior by providing properties in your application.properties (via your application's dedicated ConfigMap) using the following format: <name of your service>.ribbon.<Ribbon configuration key> where:

  • <name of your service> corresponds to the service name you're accessing over Ribbon, as configured using the@RibbonClient annotation (e.g. name-service in the example above)
  • <Ribbon configuration key> is one of the Ribbon configuration key defined by Ribbon's CommonClientConfigKey class

Additionally, the spring-cloud-kubernetes-ribbon project defines two additional configuration keys to further control how Ribbon interacts with Kubernetes. In particular, if an endpoint defines multiple ports, the default behavior is to use the first one found. To select more specifically which port to use, in a multi-port service, use the PortName key. If you want to specify in which Kubernetes' namespace the target service should be looked up, use the KubernetesNamespace key, remembering in both instances to prefix these keys with your service name and ribbon prefix as specified above.

Examples that are using this module for ribbon discovery are:

Remark : The Ribbon discovery client can be disabled by setting this key within the application properties filespring.cloud.kubernetes.ribbon.enabled=false.

Zipkin discovery in Kubernetes

Maven Central Javadocs Dependency Status

Zipkin is a distributed tracing system which is supported by the project Spring Cloud Sleuth which allows to collect traces or spans from microservice applications.

A Discovery client has been implemented top of Kubernetes in order to fetch the Zipkin service (e.g. zipkin). This client is provided by the spring-cloud-kubernetes-zipkin project that you can use by adding this starter to your maven pom file:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-kubernetes-zipkin</artifactId>
    <version>${latest.version}</version>
</dependency>

This works as an extension of the spring-cloud-sleuth-zipkin project. The name of the Zipkin service and the target Kubernetes namespace/project where the service runs can be specified using the following application.propertiesproperties:

spring.cloud.kubernetes.zipkin.discovery.serviceName=my-zipkin
spring.cloud.kubernetes.zipkin.discovery.serviceNamespace=tracing

By default, the discovery client will look for a Zipkin service named zipkin within the current namespace.

Examples of application that are using Zipkin discovery in Kubernetes:

ConfigMap Archaius Bridge

Maven Central Javadocs Dependency Status

The section ConfigMap PropertySource introduced how to configure a spring boot application via Kubernetes ConfigMapcontaining your configuration properties file.

If you prefer to use the configuration management library Netflix Archaius instead of using the Spring application.properties|"yaml file, then you can also leverage the ConfigMap feature by using the spring-cloud-kubernetes-archaius project.

To use it, add the following starter spring-cloud-starter-kubernetes-all to your pom file definition.

This module allows you to annotate your application with the @ArchaiusConfigMapSource and archaius will automatically use the Kubernetes configmap as a watched source (get notification on changes).


Troubleshooting

Version and compatibility

The current version of Spring Cloud Kubernetes is using version 2.2.x of the Fabric8 Kubernetes Client and is expected to work with version 1.x of Kubernetes and 1.x of Openshift. Note, that Kubernetes and Openshift are for the most part backwards compatible so, its expected that this framework is compatible with both the latest and earlier versions.

Namespace

Most of the components provided in this project need to know the namespace. For Kubernetes (1.3+) the namespace is made available to pod as part of the service account secret and automatically detected by the client. For earlier version it needs to be specified as an env var to the pod. A quick way to do this is:

  env:
  - name: "KUBERNETES_NAMESPACE"
    valueFrom:
      fieldRef:
        fieldPath: "metadata.namespace"
Service Account

For distros of Kubernetes that support more fine-grained role-based access within the cluster, you need to make sure a pod that runs with spring-cloud-kubernetes has access to the Kubernetes API. For example, OpenShift has very comprehensive security measures that are on by default (typically) in a shared cluster. For any service accounts you assign to a deployment/pod, you need to make sure it has the correct roles. For example, you can add cluster-reader permissions to your default service account depending on the project you're in:

oc policy add-role-to-user cluster-reader system:serviceaccount:<project/namespace>:default

Building

You can just use maven to build it from sources:

mvn clean install

Usage

The project provides a "starter" module, so you just need to add the following dependency in your project.

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-kubernetes</artifactId>
    <version>x.y.z</version>
</dependency>
spring-cloud-kubernetes自动同步k8s的configmap更新 以上就是实战工程的所有代码了,仅仅只是引入了少量jar依赖,以及在启动配置文件中指定了configmap的信息和同步模式,即完成了获取配置文件的所有操作,至于代码中用到配置文件的地方,和使用SpringCloud Config并无差别。以上就是开启自动更新的步骤了,您基于上一章的源码做上述更改即可,也可以随同本文一起重新开发一个全新应用,来实现获取configmap的配置,并且实时同步configmap的变化;#更新配置信息的模式:polling是主动拉取,event是事件通知。 阅读详情

相关推荐

Spring Cloud Config整合Spring Cloud Kubernetes,在k8s上管理配置

1 前言 欢迎访问南瓜慢说 www.pkslow.com获取更多精彩文章! Kubernetes有专门的ConfigMap和Secret来管理配置,但它也有一些局限性,所以还是希望通过Spring Cloud Config来管理。在Kubernetes上面的微服务系统会有所不同,我们来探索一下如何整合Spring Cloud Kubernetes来做配置管理。 整体方案与《使用Spring Cloud Config统一管理配置,别再到处放配置文件了》差不多,只是引入Spring Cloud Kubern

南瓜慢说 1158

kubernetes环境部署Spring Cloud

目标 将sc的所有组件和微服务部署到k8s环境上。 部署环境 k8s环境 Host Name Role IP master1 k8s-master01/etcd 192.168.200.87 master2 k8s-master02/etcd 192.168.200.206 master3 k8s-master03/etcd 192.168.200.209 node1 ...

总结、分享、交流 3835

spring-cloud-kubernetes 远程访问k8s apiserver

k8s集群apiserver访问方式 1、通过证书认证 2、通过token认证 本地开发spring-cloud-k8s时使用token访问apiserver 1、获取token kubectl get secret `kubectl get secret -n kube-system |grep cluster |awk '{print $1}'` -n kube-system -o json | jq .data.token |sed 's/"//g'| base64 -d 2、项目情况可以看上篇博

li_a_long的博客 917

Spring Cloud Kubernetes服务注册与发现实现原理与源码分析

前面我们已经分析完OpenFeign与Ribbon的源码,包括两者的整合使用,以及Ribbon的重试机制,从最顶层调用接口开始到负载均衡的实现。今天我们分析更底层的实现,即服务注册与发现。 本篇内容包含: Spring Cloud Commons的serviceregistry与discovery Spring Cloud Kubernetes服务注册与发现实现原理 Spring Cloud Kubernetes Core源码分析 Spring Cloud Kubernetes Discove..

qingdao666666的博客 953

Spring Cloud系列教程 | 第十四篇:Spring Cloud与Kubernetes的集成

Spring Cloud与Kubernetes的集成 &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Spring Cloud提供了专门的spring-cloud-kubernetes项目与k8s集成,尽管k8s提供了服务注册和发现等功能与Spring cloud是竞争的,甚至k8s加装服务网格Istio以后超过Spring cloud,但是在Spring cloud提供与代

qq_43253123的博客 3236

Spring Cloud Alibaba与K8s的集成

Spring Cloud Alibaba 与 K8s 的集成,就像让智能工厂接入全球化物流网——前者专注业务精细化管理,后者提供弹性基础设施。下一篇文章我们将实战灰度发布,像在游乐场同时开放新旧过山车,逐步切换流量。如果你在容器化过程中经历过“水土不服”,这种组合方案就是专治不服的“调和剂”。技术融合的魅力,在于让每个组件做自己最擅长的事。

caishuangxi111的博客 1760

Kubernetes遇上Spring Cloud | 服务无法向Eureka注册

                      --昨夜西风凋碧树,独上高楼,望尽天涯路 错误描述 当采用docker+Spring Cloud+Kubernetes时,发现服务无法像Kubernetes注册,错误如下: 服务会采用Pod name向eureka注册 原因 由于eureka的默认注册方式为:采用hostname注册,当讲微服务通过Kubernetes发布的时候...

weixin_37417954的博客 5230

Kubernetes实战指南:零宕机无缝迁移Spring Cloud至k8s

1. 项目迁移背景 1.1 为什么要在“太岁”上动土? 目前公司的测试环境、UAT环境、生产环境均已经使用k8s进行维护管理,大部分项目均已完成容器化,并且已经在线上平稳运行许久。在我们将大大小小的项目完成容器化以后,测试、UAT、生产环境的发版工具以及CICD流程慢慢的实现统一化管理,并且基于k8s开发了内部的发版审核平台,同时接入了Jira等项目管理工具。 在自研平台进行发版时,能够自动关联项目的开发进度以及Release版本,最重要的是其可以控制发版权限、统一发版工具及发版模式,并且支持一键式发

SharingOfficer的博客 2142

Spring Cloud Kubernetes 服务注册和发现实现

Spring Cloud Kubernetes 服务注册和发现 Spring Cloud Kubernetes 使用,可以通过引入 org.springframework.cloud:spring-cloud-starter-kubernetes,这个 starter 依赖于 org.springframework.cloud:spring-cloud-kubernetes-core 和 org.springframework.cloud:spring-cloud-kubernetes-discovery

啦啦啦啦 la 2632

SpringCloud与Kubernetes融合实战项目spring-cloud-k8s-demo

动态伸缩虽好,但也带来新问题:新启动的 Pod 还没预热完成就被打死了怎么办?解决方案三连击:当我们把 Spring Cloud 微服务从“依赖中间件”转向“平台自治”,你会发现:架构更轻了(少了 Eureka、Config Server)响应更快了(秒级发现、毫秒级故障转移)运维更简单了(一切通过 YAML 声明)弹性更强了(自动伸缩、自动恢复)这不仅仅是技术替换,而是一种思维方式的转变:从“我在 K8s 上运行应用”变成“我的应用天生属于 K8s”

weixin_42126677的博客 1071

ADC选型实战:从参数指标到精准应用的工程指南

本文深入解析ADC(模数转换器)选型的关键参数与实战技巧,涵盖分辨率、转换误差等核心指标,并提供高精度温度测量、高速数据采集等五大应用场景的选型指南。通过实际案例和代码示例,详细讲解校准方法、功耗优化策略及常见问题排查,帮助工程师实现从参数指标到精准应用的工程实践。

weixin_29166013的博客 326

spring-cloud-kubernetes 实战 一 服务发现

简介 spring-cloud-kubernetes是springcloud官方推出的开源项目,用于将Spring Cloud和Spring Boot应用运行在kubernetes环境,并且提供了通用的接口来调用kubernetes服务,Spring-Cloud-kubernetes 地址。 之前介绍过Spring-Cloud 实战相关系列文章,相信大家都应该清楚 迁移到kubernetes 平台...

xiliangMa的博客 4029

Windows 11 部署 Docker Desktop:从 WSL 报错到服务配置的完整排障实录

本文详细记录了在Windows 11上部署Docker Desktop时遇到的WSL报错问题及完整解决方案。从Hyper-V配置、BIOS设置到系统服务检查,提供了一系列实用命令和排查步骤,帮助开发者快速解决'Unexpecter WSL error'等常见问题,实现Docker与WSL2的稳定运行。

weixin_30687051的博客 120

spring-cloud-kubernetes与k8s的configmap

spring-cloud-kubernetes-config是spring-cloud-kubernetes框架下的一个库,用于将kubernetes的configmap作为配置文件,提供给springboot应用

程序员欣宸的博客 8653

CocosCreator3.8.2实战:5分钟搞定多分辨率适配与横竖屏自动翻转(附完整Demo)

本文针对CocosCreator3.8.2开发者,提供了一套5分钟快速集成、开箱即用的多分辨率屏幕适配与横竖屏自动翻转解决方案。通过封装好的ScreenAdapter组件,开发者无需处理复杂计算,即可实现等比缩放或拉伸全屏两种主流适配模式,并自动响应设备旋转,有效解决移动端UI在不同屏幕比例和方向下的显示问题。文末附完整Demo。

z4a5b6的博客 723

【软件系统架构】系列六: SysML(系统建模语言)

SysML(系统建模语言)是OMG组织基于UML扩展的专用建模语言,用于支持复杂系统全生命周期建模。它包含9类标准图,核心建模元素包括块(Block)、端口接口、需求和约束等。与UML相比,SysML更适用于软硬件结合的复杂系统建模。作为MBSE的核心工具,SysML通过结构图、行为图、需求图和参数图实现系统设计、需求追踪和性能验证。虽然面临学习门槛高、工具成本高等挑战,但随着AI融合和国产化替代趋势,SysML在航空航天、汽车电子等领域的应用日益广泛。SysML v2将简化语法并提升互操作性,推动系统工程

moton2017的博客 2386

如何快速上手Spring Cloud Kubernetes?5分钟搭建你的第一个K8s微服务

Spring Cloud Kubernetes是Spring Cloud生态系统与Kubernetes的无缝集成方案,它让开发者能够轻松构建在Kubernetes环境中运行的微服务应用。通过提供服务发现、配置管理、健康检查等核心功能,Spring Cloud Kubernetes帮助开发者实现微服务的快速部署与动态扩展,同时保持Spring Boot应用的开发体验。 ## 🌟 核心功能概览

gitblog_00747的博客 1095

树莓派 RP2350B 开发环境搭建

本文介绍了树莓派RP2350B开发环境的搭建过程。

张一西的博客 287

探索Spring Cloud Kubernetes:无缝集成K8s与微服务

在当今的云计算时代,Kubernetes(K8s)已成为容器编排的事实标准,而Spring Boot和Spring Cloud则是Java微服务开发的首选框架。`spring-cloud-kubernetes`项目将这两个强大的工具集结合在一起,为开发者提供了一种无缝的方式,利用Kubernetes平台的力量来构建、部署和管理Spring Cloud应用。 ## 项目简介 `spring-cl

gitblog_00064的博客 1405

智能车图像处理16-进阶篇8--右环岛状态机与补线

这篇文章主要讲述智能车竞赛中如何判断右环岛并且进行状态补线。

taiyuezyh的博客 1万+

1、初探 Tiny Machine Learning

Tiny Machine Learning(TinyML)是机器学习与嵌入式系统的融合领域,致力于在资源受限的微控制器上运行AI模型。本文介绍了机器学习基础、TinyML的核心概念、应用领域(如智能家居、工业物联网、医疗保健)、面临的挑战(如资源限制、模型压缩、数据质量),以及从硬件准备到模型部署的实践步骤。通过利用训练与推理的资源不对称性,可在PC上训练模型并部署至低功耗设备进行实时推理,推动边缘智能的发展。

loss4bartender的博客 122

Spring Cloud Kubernetes:在K8s环境中的服务发现与配置

Spring Cloud Kubernetes通过将Spring Cloud抽象层与Kubernetes原生功能无缝集成,为Java开发者提供了在Kubernetes环境中构建微服务应用的强大工具。本文详细介绍了Spring Cloud Kubernetes的服务发现、负载均衡、配置管理和高级特性等核心功能,以及相关的最佳实践。在实际应用中,Spring Cloud Kubernetes不仅简化了从传统部署向容器化环境的迁移过程,还使开发者能够充分利用Kubernetes的编排能力和弹性扩展能力。

程序媛学姐的博客 1927

OpenClaw 技术架构解析-网关层(上)

OpenClaw 网关层是架构核心中枢,承接Channel层消息,串联消息路由器、会话状态管理器等五大组件,负责消息分发、会话管理、状态统筹、上下文维护等关键职责,是连接Channel层与AI执行引擎的核心桥梁,保障多渠道交互稳定、有序运行。

wend的博客 713

Spring Cloud Kubernetes 使用教程

Spring Cloud Kubernetes 是 Spring Cloud 的一个子项目,旨在将 Spring Cloud 的编程模型与 Kubernetes 的容器编排平台集成。通过这种方式,开发者可以利用 Spring Cloud 的丰富功能,如服务发现、配置管理、负载均衡等,同时在 Kubernetes 环境中无缝运行这些服务。 ## 项目快速启动 ### 环境准备 - JDK 1....

gitblog_00751的博客 1120

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Spring Cloud Kubernetes 实践 服务注册发现、服务动态配置

随着云计算和微服务架构的不断发展,k8s 和Spring Cloud成为了当今技术领域的两大热门话题。k8s作为一个开源的容器编排平台,已经在自动化部署、扩展和管理方面取得了巨大的成功,而Spring Cloud则以其丰富的生态和语言亲和性,为Java开发者提供了便利的微服务框架支持。在现如今的技术趋势下,两者融合已经成为了必要的方向。

小毕超博客 2550

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

上一篇: 使用ingress 暴露springcloud服务
下一篇: 在Kubernetes集群里安装微服务DevOps平台fabric8
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值