<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>LEo的网络日志</title>
    <description>LEo's blog</description>
    <link>http://reborncodinglife.com</link>
    <atom:link href="http://reborncodinglife.com/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>使用external-secrets访问azure keyvault</title>
        <description>&lt;h2 id=&quot;查看aks是否启用oidc&quot;&gt;查看aks是否启用oidc&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az aks show \
  -g rg-aap-mgmt \
  -n aks-aap-mgmt \
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;记录oidc issuer url。&lt;/p&gt;

&lt;h2 id=&quot;创建-user-assigned-managed-identity&quot;&gt;创建 user assigned managed identity&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az identity create \
  -g rg-aap-mgmt \
  -n id-obs-aap-mgmt-dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;记录输出中的clientId和principalId。&lt;/p&gt;

&lt;h2 id=&quot;给-managed-identity-授权-key-vault&quot;&gt;给 managed identity 授权 key vault&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az role assignment create \
  --assignee-object-id &amp;lt;principalId&amp;gt; \
  --assignee-principal-type ServicePrincipal \
  --role &quot;Key Vault Secrets User&quot; \
  --scope /subscriptions/&amp;lt;SUB_ID&amp;gt;/resourceGroups/&amp;lt;KV_RG&amp;gt;/providers/Microsoft.KeyVault/vaults/&amp;lt;KV_NAME&amp;gt;

or

az keyvault set-policy \
  --name kv-aap-vault-dev \
  --object-id xxx \
  --secret-permissions get list
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;创建-federated-identity-credential&quot;&gt;创建 federated identity credential&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az identity federated-credential create \
  --name eso-federation \
  --identity-name eso-identity \
  --resource-group &amp;lt;AKS_RG&amp;gt; \
  --issuer &amp;lt;OIDC_ISSUER_URL&amp;gt; \
  --subject system:serviceaccount:external-secrets:external-secrets \
  --audience api://AzureADTokenExchange

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;给external-secrets的sa添加一下annotation&quot;&gt;给external-secrets的sa添加一下annotation&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;azure.workload.identity/client-id: xxx
azure.workload.identity/tenant-id: xxx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;创建-clustersecretstore&quot;&gt;创建 clustersecretstore&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apiVersion: external-secrets.io/v1beta1
kind: ClusterSecretStore
metadata:
  name: cluster-cross-account-secret-store
  namespace: external-secrets
spec:
  provider:
    azurekv:
      authType: WorkloadIdentity
      vaultUrl: https://kv-aap-vault-dev.vault.azure.net
      serviceAccountRef:
        name: cluster-external-secrets
        namespace: external-secrets
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;创建clusterexternalsecret&quot;&gt;创建clusterexternalsecret&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apiVersion: external-secrets.io/v1beta1
kind: ClusterExternalSecret
metadata:
  name: grafana-admin-credentials
  namespace: external-secrets
spec:
  externalSecretName: &quot;grafana-admin-credentials&quot;
  namespaceSelector:
    matchLabels:
      kubernetes.io/metadata.name: xxx
  refreshTime: 1m
  externalSecretSpec:
    refreshInterval: 1m
    secretStoreRef:
      name: cluster-secret-store
      kind: ClusterSecretStore
    target:
      name: grafana-admin-credentials
      template:
        type: Opaque
        data:
          xxx: &quot;&quot;
          xxx: admin
    data:
    - secretKey: admin_password
      remoteRef:
        key: &quot;xxx&quot;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;查看生成的secret&quot;&gt;查看生成的secret&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ k get secret
NAME                                   TYPE     DATA   AGE
grafana-admin-credentials              Opaque   2      25s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 20 Jan 2026 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2026/01/20/use-external-secrets-to-get-secrets-from-azurekv/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2026/01/20/use-external-secrets-to-get-secrets-from-azurekv/</guid>
      </item>
    
      <item>
        <title>使用external-secrets访问aws secrets manager</title>
        <description>&lt;h2 id=&quot;遇到的错误&quot;&gt;遇到的错误&lt;/h2&gt;

&lt;p&gt;在安装 external-secrets 并创建 clustersecretstore 后，状态一直不是 ready，日志中出现了以下的错误：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;accessdenied: not authorized to perform sts:assumerolewithwebidentity
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;这意味着 external-secrets 试图通过 serviceaccount 向 aws sts 请求权限，但 aws 并没有授予这个 serviceaccount 相应的 iam role 权限。&lt;/p&gt;

&lt;h2 id=&quot;解决步骤&quot;&gt;解决步骤&lt;/h2&gt;

&lt;h3 id=&quot;1-确认使用的-serviceaccount&quot;&gt;1. 确认使用的 serviceaccount&lt;/h3&gt;

&lt;p&gt;external-secrets 的 pod 使用哪个 serviceaccount，需要确认清楚。&lt;/p&gt;

&lt;h3 id=&quot;2-检查-rosaeks-的-oidc-provider&quot;&gt;2. 检查 rosa/eks 的 oidc provider&lt;/h3&gt;

&lt;p&gt;集群是否已经启用 oidc，并在 aws iam 中注册，确保 aws 可以验证 pod 身份。&lt;/p&gt;

&lt;h3 id=&quot;3-在-aws-上创建-iam-role&quot;&gt;3. 在 aws 上创建 iam role&lt;/h3&gt;

&lt;p&gt;为 external-secrets 的 serviceaccount 创建一个 iam role，并配置允许通过 oidc token assume 这个 role。&lt;/p&gt;

&lt;h3 id=&quot;4-设置-role-的信任关系&quot;&gt;4. 设置 role 的信任关系&lt;/h3&gt;

&lt;p&gt;trust policy 指定只有对应的 serviceaccount 可以 assume 这个 role。&lt;/p&gt;

&lt;h3 id=&quot;5-为-role-授权访问-secrets-manager&quot;&gt;5. 为 role 授权访问 secrets manager&lt;/h3&gt;

&lt;p&gt;给 role 添加最小权限策略，使其可以读取需要的 secret。&lt;/p&gt;

&lt;h3 id=&quot;6-把-role-绑定到-serviceaccount&quot;&gt;6. 把 role 绑定到 serviceaccount&lt;/h3&gt;

&lt;p&gt;在 serviceaccount 上添加 annotation，指向刚创建的 iam role。&lt;/p&gt;

&lt;h3 id=&quot;7-重启-external-secrets-pod&quot;&gt;7. 重启 external-secrets pod&lt;/h3&gt;

&lt;p&gt;让 pod 获取新的 oidc token 并通过 sts 拿到临时凭证。&lt;/p&gt;

&lt;h3 id=&quot;8-验证-clustersecretstore-状态&quot;&gt;8. 验证 clustersecretstore 状态&lt;/h3&gt;

&lt;p&gt;确认状态变成 ready，external-secrets 能正常读取 secrets manager。&lt;/p&gt;
</description>
        <pubDate>Thu, 15 Jan 2026 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2026/01/15/use-external-secrets-to-get-secrets-from-aws-secret-mgr/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2026/01/15/use-external-secrets-to-get-secrets-from-aws-secret-mgr/</guid>
      </item>
    
      <item>
        <title>macos双开微信</title>
        <description>&lt;p&gt;运行命令即可。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo cp -R /Applications/WeChat.app /Applications/WeChat1.app

sudo /usr/libexec/PlistBuddy -c &quot;Set :CFBundleIdentifier com.tencent.xinWeChat1&quot; /Applications/WeChat1.app/Contents/Info.plist

sudo codesign --force --deep --sign - /Applications/WeChat1.app
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Thu, 15 Jan 2026 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2026/01/15/run-2-wechat-on-macos/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2026/01/15/run-2-wechat-on-macos/</guid>
      </item>
    
      <item>
        <title>使用fluent-bit将k8s日志转发到splunk</title>
        <description>&lt;h2 id=&quot;安装fluent-bit&quot;&gt;安装fluent-bit&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;helm repo add fluent https://fluent.github.io/helm-charts
helm install my-fluent-bit fluent/fluent-bit --version 0.49.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;配置values&quot;&gt;配置values&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;config:
  inputs: |
    [INPUT]
        Name tail
        Path /var/log/containers/*.log
        multiline.parser docker, cri
        Tag kube.*
        Mem_Buf_Limit 5MB
        Skip_Long_Lines On

  filters: |
    [FILTER]
        Name kubernetes
        Match kube.*
        Merge_Log On
        Keep_Log Off
        K8S-Logging.Parser On
        K8S-Logging.Exclude On

    [FILTER]
        Name grep
        Match kube.*
        Regex kubernetes[&apos;namespace_name&apos;] ^(kube-system|operators|ansible-automation-platform)$

  outputs: |
    [OUTPUT]
        name splunk
        match kube.*
        host 
        port 443
        splunk_token 
        TLS On
        TLS.Debug Off
        TLS.Verify On
        event_key $log
        event_source $log_path
        event_index ssli_test
        event_host ssli_test
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Wed, 21 May 2025 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2025/05/21/use-fluent-bit-to-forward-k8s-log-to-splunk/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2025/05/21/use-fluent-bit-to-forward-k8s-log-to-splunk/</guid>
      </item>
    
      <item>
        <title>在ansible on clouds部署mesh</title>
        <description>&lt;h2 id=&quot;在azure创建aap-24&quot;&gt;在azure创建aap 2.4&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;选择public模式，方便访问aap&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;在azure创建hop和exec-node&quot;&gt;在azure创建hop和exec node&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;2个node使用的rhel9.5&lt;/li&gt;
  &lt;li&gt;创建exec node时选择不同的vnet，确保2个node之间的子网不重叠，以免ip冲突，hop无法连接exec&lt;/li&gt;
  &lt;li&gt;配置hop node和exec node
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo subscription-manager register --auto-attach
# aap 2.4
sudo subscription-manager repos --enable ansible-automation-platform-2.4-for-rhel-9-x86_64-rpms
# aap 2.5
sudo subscription-manager repos --enable ansible-automation-platform-2.5-for-rhel-9-x86_64-rpms
sudo dnf install -y ansible-core
ansible-galaxy collection install ansible.receptor
sudo firewall-cmd --permanent --zone=public --add-port=27199/tcp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;配置hop node ssh免登录到exec node
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ssh-keygen -t rsa -b 4096
ssh-copy-id -i ~/.ssh/id_rsa.pub ssli@exec_node
ssh-copy-id -i ~/.ssh/id_rsa.pub ssli@hop_node
# 在exec node执行
ssh-keygen -t rsa -b 4096
ssh-copy-id -i ~/.ssh/id_rsa.pub ssli@exec_node
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;配置automation-controller&quot;&gt;配置automation controller&lt;/h2&gt;

&lt;p&gt;参考这个文章配置automation controller：https://www.redhat.com/en/blog/deploying-automation-mesh-ansible-clouds&lt;/p&gt;

&lt;h2 id=&quot;配置hop和exec-node&quot;&gt;配置hop和exec node&lt;/h2&gt;

&lt;p&gt;参考这个文档配置hop和exec node：https://www.redhat.com/en/blog/deploying-automation-mesh-ansible-clouds&lt;/p&gt;

&lt;h2 id=&quot;网络配置&quot;&gt;网络配置&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;aap到hop node的双向peering&lt;/li&gt;
  &lt;li&gt;hop node到exec node的双向peering&lt;/li&gt;
  &lt;li&gt;hop node到exec node的网络安全组中打开相应的端口22和27199&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;故障排查&quot;&gt;故障排查&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;重启hop node和exec node&lt;/li&gt;
  &lt;li&gt;重启controller pod&lt;/li&gt;
  &lt;li&gt;在credentials添加exec node的登录用户和密码用于执行作业&lt;/li&gt;
  &lt;li&gt;增加磁盘空间&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Error: copying system image from manifest list: writing blob: adding layer with blob &quot;sha256:d865617f929d019bc8240e48ac30981f27cf3f56ab30b05c99164d4d7b904438&quot;/&quot;&quot;/&quot;sha256:f06049f87c01a63cd0d784d9fef445e7381cceccaa7c5a05ab9306fbe6939e5a&quot;: unpacking failed (error: exit status 1; output: open /usr/local/lib/python3.9/site-packages/azure/mgmt/network/v2019_06_01/aio/operations/__pycache__/_network_security_groups_operations.cpython-39.pyc: no space left on device)
WARN[0035] Failed to add pause process to systemd sandbox cgroup: dbus: couldn&apos;t determine address of session bus
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;增加磁盘空间：&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[ssli@ssli-mesh-exec ~]$ podman info |egrep &apos;graphRoot|overlay&apos;
  graphDriverName: overlay
  graphRoot: /home/ssli/.local/share/containers/storage
  graphRootAllocated: 1006632960
  graphRootUsed: 380014592
[ssli@ssli-mesh-exec ~]$ df -hP /home/ssli/
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-homelv  960M  363M  598M  38% /home
[ssli@ssli-mesh-exec ~]$ sudo lvextend -L +4G /dev/mapper/rootvg-homelv
  Size of logical volume rootvg/homelv changed from 1.00 GiB (256 extents) to 5.00 GiB (1280 extents).
  Logical volume rootvg/homelv successfully resized.
[ssli@ssli-mesh-exec ~]$ sudo xfs_growfs /home
meta-data=/dev/mapper/rootvg-homelv isize=512    agcount=4, agsize=65536 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0
data     =                       bsize=4096   blocks=262144, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=16384, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 262144 to 1310720
[ssli@ssli-mesh-exec ~]$ df -hP /home/ssli/
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-homelv  5.0G  393M  4.6G   8% /home
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;确认automation-mesh&quot;&gt;确认automation mesh&lt;/h2&gt;

&lt;p&gt;在controller的instances页面，hop node和exec node状态都是ready。&lt;/p&gt;

&lt;h2 id=&quot;参考&quot;&gt;参考&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;https://www.redhat.com/en/blog/deploying-automation-mesh-ansible-clouds&lt;/li&gt;
  &lt;li&gt;https://docs.redhat.com/en/documentation/red_hat_ansible_automation_platform/2.4/html/red_hat_ansible_automation_platform_automation_mesh_for_operator-based_installations/assembly-automation-mesh-operator-aap#proc-define-mesh-node-types&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Thu, 09 Jan 2025 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2025/01/09/deploying-automation-mesh-ansible-clouds/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2025/01/09/deploying-automation-mesh-ansible-clouds/</guid>
      </item>
    
      <item>
        <title>terraform tips</title>
        <description>&lt;h3 id=&quot;terraform-plan&quot;&gt;terraform plan&lt;/h3&gt;

&lt;p&gt;这个命令会生成并显示一个执行计划，帮助你预览terraform将对你的基础设施做出的变更，而不会真正执行这些变更。它的主要作用是安全地审查更改内容，确保变更符合预期&lt;/p&gt;

&lt;h3 id=&quot;terraform-apply&quot;&gt;terraform apply&lt;/h3&gt;

&lt;p&gt;这个命令会真正执行terraform的变更，将你的基础设施状态调整为与代码定义的状态一致。它会创建、更新或销毁资源，使实际环境符合配置文件的描述。&lt;/p&gt;

&lt;h3 id=&quot;variablestf&quot;&gt;variables.tf&lt;/h3&gt;

&lt;p&gt;可以清晰地定义变量的类型、描述和默认值。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;variable &quot;cluster_name&quot; {
  description = &quot;The name of the Kubernetes cluster&quot;
  type        = string
  default     = &quot;default-cluster&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;providerstf&quot;&gt;providers.tf&lt;/h3&gt;

&lt;p&gt;用于配置和定义所需的提供者。&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;terraform {
  required_providers {

    dynatrace = {
      source  = &quot;dynatrace-oss/dynatrace&quot;
      version = &quot;&amp;gt;= 1.57.3&quot;
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Wed, 08 Jan 2025 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2025/01/08/terraform-tips/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2025/01/08/terraform-tips/</guid>
      </item>
    
      <item>
        <title>aoc sre tips</title>
        <description>&lt;h2 id=&quot;saas-login&quot;&gt;saas login&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;python3 -m venv .venv
source .venv/bin/activate
lkinit
python3 aws-saml.py
aws --profile saml sts get-caller-identity


INSTANCE_NAME=cus-25ssli AWS_REGION=us-east-1 make login-to-instance
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;订阅组件的release信息&quot;&gt;订阅组件的release信息&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;https://github.com/nginxinc/nginx-ingress-helm-operator/releases&lt;/li&gt;
  &lt;li&gt;https://github.com/Dynatrace/dynatrace-operator/releases/tag/v1.4.0&lt;/li&gt;
  &lt;li&gt;https://releases.aks.azure.com/#tabus&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;检查aap-job-status&quot;&gt;检查aap job status&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;https://access.redhat.com/solutions/5532181&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;解决aks-failed状态问题&quot;&gt;解决aks failed状态问题&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az resource update --ids &amp;lt;aks-resource-id&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;修改aap-gw-admin-password&quot;&gt;修改aap gw admin password&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aap-gateway-manage update_password --username=admin --password=changeme
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;aap无法登录&quot;&gt;aap无法登录&lt;/h2&gt;

&lt;p&gt;密码正确时候，检查CSRF配置。&lt;/p&gt;

&lt;h2 id=&quot;从pfx中提取所有证书&quot;&gt;从pfx中提取所有证书&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl pkcs12 -in ssli.pfx -nokeys -out allcerts.crt -legacy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;查看证书包含的域名&quot;&gt;查看证书包含的域名&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -in cert.pem -text -noout | grep DNS
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;进入aap-db&quot;&gt;进入aap db&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;awx-manage dbshell
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;debug-rds-connection-issue&quot;&gt;debug rds connection issue&lt;/h2&gt;

&lt;p&gt;https://repost.aws/knowledge-center/rds-mysql-max-connections&lt;/p&gt;

&lt;h2 id=&quot;获取aks-kubeconfig失败&quot;&gt;获取aks kubeconfig失败&lt;/h2&gt;

&lt;p&gt;如果报错如下：&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: API version 2024-08-01 does not have operation group &apos;managed_clusters&apos;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;降级azure-mgmt-containerservice模块到33.0.0。&lt;/p&gt;

&lt;h2 id=&quot;az查询appgw信息&quot;&gt;az查询appgw信息&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;az network application-gateway show --name applicationgateway --resource-group MC_rg_name_aks_name_location
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;查询证书是否过期&quot;&gt;查询证书是否过期&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl x509 -in cert.crt -noout -enddate
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;aap-gw修改密码&quot;&gt;aap gw修改密码&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;aap-gateway-manage update_password --username=admin --password=password
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;创建的aap managed applicaition会被自动清除，请在managed app上添加以下tag以防被自动删除&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;expire_on : 20230101
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;创建的aap managed applicaition的ui url可以在applicationsAAPDeploy deployments中的outputs页面查到&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;创建的aap managed applicaition的访问模式(public/private)可以在applicationsAAPDeploy deployments中的inputs页面查到&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;创建的aap managed applicaition，如果要访问其中的aks，需要创建相应的jump vm，然后才能访问，具体参考该工具：https://github.com/ansible/aap-azurerm/tree/main/tools/utils&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;创建jump vm访问aap&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ az login -t your.onmicrosoft.com
$ pwd
/Users/ssli/share/git/aap-azurerm/tools/utils
$ ./create_jump_vm.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;nc连接postgres&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/ # nc -vz ssli-postgres.postgres.database.azure.com 5432
ssli-postgres.postgres.database.azure.com (10.226.0.4:5432) open
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;nc验证dns服务&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;nc -vz 1.2.3.4 53
-v：显示更多信息
-z：只扫描主机和端口，无需建立连接，53端口一般用于dns服务
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;创建postgres client测试db&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ kubectl run pg-client --image postgres:latest --command -- sleep 3600
$ k exec -it pg-client -- /bin/sh
# psql -h ssli-postgres.postgres.database.azure.com -U ssli -d postgres
Password for user ssli:
psql (15.3 (Debian 15.3-1.pgdg120+1), server 13.10)
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type &quot;help&quot; for help.

postgres=&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;验证dns server&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kubectl run -i --tty --rm debug --image=quay.io/aoc/netshoot:latest --restart=Never -- sh
host test.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;adastra tips&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;source venv/bin/activate
adastra config set --env production
adastra customer list

adastra access request cus-xxx
adastra access status
adastra access login cus-xxx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;验证receptor&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;receptorctl --socket /var/run/receptor/receptor.sock ping 10.65.55.57
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Thu, 12 Dec 2024 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2024/12/12/aoc-sre-tips/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2024/12/12/aoc-sre-tips/</guid>
      </item>
    
      <item>
        <title>kubernetes tools</title>
        <description>&lt;h2 id=&quot;kubie&quot;&gt;kubie&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;kubie ctx
kubie ns
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;k9s&quot;&gt;k9s&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;curl -sS https://webinstall.dev/k9s | bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;minikube&quot;&gt;minikube&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;minikube start --kubernetes-version=v1.23.0 --driver=docker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Sat, 07 Dec 2024 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2024/12/07/kubernetes-tools/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2024/12/07/kubernetes-tools/</guid>
      </item>
    
      <item>
        <title>ansbile和awx和rhaap</title>
        <description>&lt;p&gt;随着自动化技术在 IT 运维中的普及，Ansible 及其相关项目和产品成为许多组织的首选工具。本文将深入介绍 Ansible、AWX、Tower 和 Red Hat Ansible Automation Platform (RH AAP) 的基本概念、功能及其区别。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;什么是-ansible&quot;&gt;什么是 Ansible？&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ansible&lt;/strong&gt; 是一个开源的 IT 自动化工具，主要用于配置管理、应用部署和任务编排。它的设计原则是简单、强大且无代理（agentless）。Ansible 的主要特点包括：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;YAML 编写的 Playbook&lt;/strong&gt;：易于阅读和维护。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;无代理架构&lt;/strong&gt;：通过 SSH 或 WinRM 与目标节点交互。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;模块化设计&lt;/strong&gt;：提供上千个模块以支持不同的功能和平台。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;强大的社区支持&lt;/strong&gt;：拥有丰富的生态系统和插件。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ansible 适合于开发者、运维人员和系统管理员在小型或中型规模环境中使用。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;什么是-awx&quot;&gt;什么是 AWX？&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWX&lt;/strong&gt; 是 Ansible 项目的一个开源社区版本，它为 Ansible 提供了一个 Web 界面和 API 服务。主要功能包括：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;任务可视化&lt;/strong&gt;：通过图形化界面创建、运行和监控 Playbook。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;角色分离&lt;/strong&gt;：允许多个用户和团队协作。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;作业调度&lt;/strong&gt;：支持定时运行任务。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;RESTful API&lt;/strong&gt;：便于与其他系统集成。&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;优势&quot;&gt;优势：&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;适合对 Ansible 有基本了解的用户，想要通过 Web 界面更直观地管理任务。&lt;/li&gt;
  &lt;li&gt;作为免费的社区版本，可以满足多数非企业级场景。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;什么是-ansible-tower&quot;&gt;什么是 Ansible Tower？&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Ansible Tower&lt;/strong&gt; 是 AWX 的商业版本，由 Red Hat 提供。它建立在 AWX 的基础之上，增加了一些企业级功能，如：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;RBAC（基于角色的访问控制）&lt;/strong&gt;：精细化的权限管理。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;审计和日志记录&lt;/strong&gt;：符合企业合规要求。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;支持和维护&lt;/strong&gt;：由 Red Hat 提供的官方支持。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;高级功能&lt;/strong&gt;：
    &lt;ul&gt;
      &lt;li&gt;集成 LDAP/AD。&lt;/li&gt;
      &lt;li&gt;提供更好的可扩展性和高可用性。&lt;/li&gt;
      &lt;li&gt;提供更安全的密钥和凭证管理。&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;优势-1&quot;&gt;优势：&lt;/h3&gt;
&lt;p&gt;适合需要企业级支持和增强功能的大型组织。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;什么是-red-hat-ansible-automation-platform-rh-aap&quot;&gt;什么是 Red Hat Ansible Automation Platform (RH AAP)？&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;RH AAP&lt;/strong&gt; 是 Red Hat 提供的全面自动化解决方案，它包含了 Ansible、Ansible Tower（作为其控制层）以及额外的内容和功能。RH AAP 的主要特性包括：&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;内容集合（Content Collections）&lt;/strong&gt;：为特定平台和功能提供预定义的模块和角色。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;自动化运行环境（Automation Execution Environment, AEE）&lt;/strong&gt;：标准化、容器化的执行环境，便于跨团队协作和部署。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;自动化控制层&lt;/strong&gt;：包括 Ansible Tower（管理界面）和自动化分析功能。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;认证的内容和支持&lt;/strong&gt;：由 Red Hat 提供经过认证的模块和持续的技术支持。&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;优势-2&quot;&gt;优势：&lt;/h3&gt;
&lt;p&gt;适合需要全面自动化管理和扩展的企业级用户。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;ansibleawxtower-和-rh-aap-对比&quot;&gt;Ansible、AWX、Tower 和 RH AAP 对比&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;功能&lt;/th&gt;
      &lt;th&gt;Ansible&lt;/th&gt;
      &lt;th&gt;AWX&lt;/th&gt;
      &lt;th&gt;Tower&lt;/th&gt;
      &lt;th&gt;RH AAP&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;性质&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;开源工具&lt;/td&gt;
      &lt;td&gt;开源项目&lt;/td&gt;
      &lt;td&gt;商业产品&lt;/td&gt;
      &lt;td&gt;企业级平台&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;核心功能&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;配置管理、部署&lt;/td&gt;
      &lt;td&gt;Web 界面 + API&lt;/td&gt;
      &lt;td&gt;企业增强版 + 支持&lt;/td&gt;
      &lt;td&gt;自动化平台 + 企业扩展&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;可视化界面&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;不支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;任务调度&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;不支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
      &lt;td&gt;支持&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;权限管理&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;基础权限&lt;/td&gt;
      &lt;td&gt;基本功能&lt;/td&gt;
      &lt;td&gt;企业级 RBAC&lt;/td&gt;
      &lt;td&gt;企业级 RBAC&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;企业支持&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;无&lt;/td&gt;
      &lt;td&gt;无&lt;/td&gt;
      &lt;td&gt;Red Hat 提供支持&lt;/td&gt;
      &lt;td&gt;Red Hat 提供支持&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;额外功能&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;无&lt;/td&gt;
      &lt;td&gt;无&lt;/td&gt;
      &lt;td&gt;日志审计、集成 LDAP&lt;/td&gt;
      &lt;td&gt;内容集合、分析与扩展环境&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;strong&gt;适用场景&lt;/strong&gt;&lt;/td&gt;
      &lt;td&gt;小型或实验环境&lt;/td&gt;
      &lt;td&gt;中小型项目&lt;/td&gt;
      &lt;td&gt;中大型企业&lt;/td&gt;
      &lt;td&gt;大型企业及复杂环境&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;如何选择&quot;&gt;如何选择？&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;个人或小型团队&lt;/strong&gt;：推荐直接使用 Ansible，结合命令行和 Playbook 即可满足需求。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;需要简单的 Web 管理界面&lt;/strong&gt;：可以选择开源的 AWX。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;中大型企业&lt;/strong&gt;：若需要企业级功能和支持，可以选择 Ansible Tower。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;全面的企业级自动化&lt;/strong&gt;：如果组织需要完整的自动化生态和支持，RH AAP 是最佳选择。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;总结&quot;&gt;总结&lt;/h2&gt;

&lt;p&gt;从 Ansible 到 RH AAP，每个工具都基于开源理念，适配了不同规模和需求的用户。通过选择合适的工具或平台，用户可以更高效地构建和管理自动化流程。&lt;/p&gt;

&lt;p&gt;希望本文能帮助您了解 Ansible 及其相关工具，找到适合自己的自动化解决方案！&lt;/p&gt;

</description>
        <pubDate>Sat, 07 Dec 2024 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2024/12/07/ansible-vs-awx-vs-rhaap/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2024/12/07/ansible-vs-awx-vs-rhaap/</guid>
      </item>
    
      <item>
        <title>ansbile eda</title>
        <description>&lt;h2 id=&quot;什么是事件驱动自动化&quot;&gt;什么是事件驱动自动化？&lt;/h2&gt;

&lt;p&gt;事件驱动自动化是一种新型的自动化方式，其核心是响应特定事件的触发条件并执行预定义的操作。例如，在 IT 运营中，当系统检测到宕机事件时，可以自动生成故障单、收集信息甚至重启设备，从而实现完全自动化的闭环操作。&lt;/p&gt;

&lt;h3 id=&quot;eda-的工作原理&quot;&gt;EDA 的工作原理&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;事件源&lt;/strong&gt;：监听并捕获系统中发生的事件（如警报、状态变化）。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;规则引擎&lt;/strong&gt;：分析事件是否满足触发条件。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;自动化操作&lt;/strong&gt;：执行相应的动作，如运行 Ansible Playbook 或直接触发模块。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;EDA 的简便性和灵活性源于其基于 YAML 的规则库（Rulebook），使用 “if-this-then-that” 的逻辑实现高度自定义的自动化。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;eda-的主要组件&quot;&gt;EDA 的主要组件&lt;/h2&gt;

&lt;h3 id=&quot;1-事件源sources&quot;&gt;1. &lt;strong&gt;事件源（Sources）&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;事件源是 EDA 的起点，用于监听和捕获事件。RHAAP 提供丰富的事件源插件，包括：&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;监控工具&lt;/strong&gt;：Prometheus Alertmanager。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;云平台&lt;/strong&gt;：AWS SQS、Azure Service Bus。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;自定义事件&lt;/strong&gt;：Webhook、文件系统监控等。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;通过事件源，EDA 可以无缝集成到多供应商环境中。&lt;/p&gt;

&lt;h3 id=&quot;2-规则rules&quot;&gt;2. &lt;strong&gt;规则（Rules）&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;规则是 EDA 的核心逻辑，定义了事件触发的条件和对应的响应操作。例如，当网络设备宕机时，可以定义规则触发自动重启。&lt;/p&gt;

&lt;h3 id=&quot;3-操作actions&quot;&gt;3. &lt;strong&gt;操作（Actions）&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;动作是事件满足规则后执行的具体任务，包括：&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;运行 Ansible Playbook。&lt;/li&gt;
  &lt;li&gt;调用模块或更新系统事实。&lt;/li&gt;
  &lt;li&gt;触发新事件或进行调试。&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;eda-的优势&quot;&gt;EDA 的优势&lt;/h2&gt;

&lt;h3 id=&quot;1-提升效率&quot;&gt;1. &lt;strong&gt;提升效率&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;通过自动化高频、重复性任务，EDA 显著减少人工操作，提高团队生产力。&lt;/p&gt;

&lt;h3 id=&quot;2-增强系统可靠性&quot;&gt;2. &lt;strong&gt;增强系统可靠性&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;EDA 能够快速响应事件并执行修复操作，从而提高系统稳定性。&lt;/p&gt;

&lt;h3 id=&quot;3-降低运维复杂性&quot;&gt;3. &lt;strong&gt;降低运维复杂性&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;EDA 支持跨供应商集成，适应复杂的混合云和边缘环境。&lt;/p&gt;

&lt;h3 id=&quot;4-支持快速扩展&quot;&gt;4. &lt;strong&gt;支持快速扩展&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;EDA 提供了灵活的规则和插件机制，企业可以快速适应新需求。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;典型应用场景&quot;&gt;典型应用场景&lt;/h2&gt;

&lt;h3 id=&quot;1-自动化故障修复&quot;&gt;1. &lt;strong&gt;自动化故障修复&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;当系统出现异常时，EDA 可自动检测并执行修复操作，如重启服务或调整配置。&lt;/p&gt;

&lt;h3 id=&quot;2-工单丰富化&quot;&gt;2. &lt;strong&gt;工单丰富化&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;EDA 可以与 ITSM 工单系统集成，将事件的详细信息自动填充到工单中，提升问题排查效率。&lt;/p&gt;

&lt;h3 id=&quot;3-提高系统稳定性&quot;&gt;3. &lt;strong&gt;提高系统稳定性&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;通过实时监控和自动响应，EDA 能有效预防潜在风险，减少宕机概率。&lt;/p&gt;

&lt;h3 id=&quot;4-简化边缘设备管理&quot;&gt;4. &lt;strong&gt;简化边缘设备管理&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;EDA 能自动化配置和管理边缘设备，适应大规模部署场景。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;如何开始使用-eda&quot;&gt;如何开始使用 EDA？&lt;/h2&gt;

&lt;p&gt;Red Hat 建议采用 “从小开始，逐步扩展” 的策略：&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;选择简单的用例&lt;/strong&gt;：例如自动化收集系统信息。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;逐步扩展规则库和事件源&lt;/strong&gt;：增加对网络、云和边缘的覆盖。&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;实现复杂自动化&lt;/strong&gt;：包括 AIOps、自助服务等。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;对于 Ansible Automation Platform 用户，可以直接在规则库中调用现有的 Playbook，无需重复开发。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;总结&quot;&gt;总结&lt;/h2&gt;

&lt;p&gt;事件驱动自动化是 IT 运营现代化的关键。RHAAP 的 EDA 功能通过灵活的规则引擎和丰富的事件源集成，帮助企业实现高效、可靠的自动化运维。&lt;/p&gt;

&lt;p&gt;如果您希望提升 IT 运营的效率和稳定性，RHAAP 的 EDA 是不可错过的选择。&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;相关资源&quot;&gt;相关资源&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.redhat.com/en/engage/event-driven-ansible-20220907&quot;&gt;Red Hat 官方文档&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.ansible.com/use-cases/event-driven-automation&quot;&gt;Ansible 自动化用例&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://red.ht/ansible_labs&quot;&gt;互动和自学实验室&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Sat, 07 Dec 2024 00:12:05 +0000</pubDate>
        <link>http://reborncodinglife.com/2024/12/07/ansible-eda/</link>
        <guid isPermaLink="true">http://reborncodinglife.com/2024/12/07/ansible-eda/</guid>
      </item>
    
  </channel>
</rss>
