AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-239421

roy's questions

Martin Hope
roy
Asked: 2023-10-31 21:57:46 +0800 CST

无法通过服务端点访问 Kubernetes NFS 服务器

  • 5

我已经使用以下清单部署了 NFS 服务器

---

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nfs-pv-provisioning-demo
  namespace: nfs
  labels:
    role: nfs-server
spec:
  storageClassName: aws-gp3
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nfs-server
  namespace: nfs
spec:
  replicas: 1
  selector:
    matchLabels:
      role: nfs-server
  template:
    metadata:
      labels:
        role: nfs-server
    spec:
      containers:
      - name: nfs-server
        image: registry.k8s.io/volume-nfs:0.8
        ports:
          - name: nfs
            containerPort: 2049
          - name: mountd
            containerPort: 20048
          - name: rpcbind
            containerPort: 111
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /exports
            name: mypvc
      volumes:
        - name: mypvc
          persistentVolumeClaim:
            claimName: nfs-pv-provisioning-demo

---

kind: Service
apiVersion: v1
metadata:
  name: nfs-server
  namespace: nfs
spec:
  ports:
    - name: nfs
      port: 2049
    - name: mountd
      port: 20048
    - name: rpcbind
      port: 111
  selector:
    role: nfs-server

---

但是当我使用nfs-server.nfs.svc.cluster.local服务器名称时,它无法解析它。当我使用集群 IP 作为服务端点时,它起作用了。

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs
  namespace: nfs
spec:
  capacity:
    storage: 1Mi
  accessModes:
    - ReadWriteMany
  nfs:
    server: nfs-server.nfs.svc.cluster.local
    # server: 172.20.144.30
    path: "/"
  mountOptions:
    - nfsvers=4.2

知道这个设置有什么问题吗?

kubernetes
  • 1 个回答
  • 24 Views
Martin Hope
roy
Asked: 2021-05-18 06:32:13 +0800 CST

Nginx SSL 身份验证幕客户端证书

  • 1

我使用以下配置使用带有 TLS 身份验证的 Nginx。所有具有有效客户端证书的请求都将在 Nginx 终止,请求将被转发到后端应用程序。


    upstream app {
        server app:8080;
    }

    server {
        listen                 443 ssl;
        server_name            localhost;
        ssl_certificate        /etc/ssl/cert_example_com.crt;
        ssl_certificate_key    /etc/ssl/cert_example_com.key;
        ssl_client_certificate /etc/ssl/ca.crt;
        ssl_protocols          TLSv1.2 TLSv1.3;
        ssl_ciphers            HIGH:!aNULL:!MD5;
        ssl_verify_client      on;

        location / {
                proxy_pass         http://app;
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_http_version 1.1;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection 'upgrade';
                proxy_set_header   Host $host;
                proxy_cache_bypass $http_upgrade;
        }
    }

使用此配置,我希望 Nginx 仅对某些客户端证书进行身份验证。这是因为我使用 Private RootCA 来生成 A 类证书和 B 类证书。A 类证书与 MQTT 一起用于身份验证,B 类证书用于 Nginx ( HTTPS) 身份验证。

MQTT 的客户端证书(A 类)对于每个客户端都是唯一的<UUID>.example.com。Nginx 的客户端证书(B 类)将具有名称(DN)base.example.com,并且证书将在多个客户端之间共享。base.example.com此外,同一名称 (DN)和不同证书 ID的 B 类证书数量有限。

对此有什么帮助我怎么能做到这一点?

ssl nginx certificate-authority ssl-certificate
  • 1 个回答
  • 281 Views
Martin Hope
roy
Asked: 2021-05-05 14:08:04 +0800 CST

连接上游时 Nginx 上游超时(110:连接超时)

  • 0

我在容器(Kubernetes)中运行了 Nginx 和 App。使用 NginX 入口点进行 TLS 握手,配置如下

    upstream app {
        server app:8200;
    }

    server {
        listen                  443 ssl;
        server_name             localhost;
        ssl_certificate         /etc/ssl/util_example_com.crt;
        ssl_certificate_key     /etc/ssl/util_example_com.key;
        ssl_client_certificate  /etc/ssl/ca.crt;
        ssl_protocols           TLSv1.2 TLSv1.3;
        ssl_ciphers             HIGH:!aNULL:!MD5;
        ssl_verify_client       on;

        location / {
                proxy_pass         http://app;
                proxy_read_timeout 180;
                proxy_set_header   X-Forwarded-For $remote_addr;
                proxy_http_version 1.1;
                proxy_set_header   Upgrade $http_upgrade;
                proxy_set_header   Connection 'upgrade';
                proxy_set_header   Host $host;
                proxy_cache_bypass $http_upgrade;
        }

    }

我可以curl http://app:8080/generator从 Nginx 容器。但是,当我在公共端点上使用 curl ( https://util.example.com/generator) 首先命中 Nginx 时,我504 Gateway Time-out在 Nginx 中得到 & 跟随错误

2021/05/04 21:54:50 [error] 21#21: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client: 10.2.16.183, server: localhost, request: "POST /generator HTTP/1.1", upstream: "http://172.20.154.113:8200/generator", host: "util.example.com"

任何帮助,这里发生了什么。

ssl nginx
  • 1 个回答
  • 5402 Views
Martin Hope
roy
Asked: 2020-11-19 13:37:34 +0800 CST

具有保险库中间证书的 CA

  • 1

我想使用 Vault (HashiCorp) 为内部服务设置私有 CA。我在 Vault 之外生成根 CA 和中间 CA 证书。Vault 将根据请求生成短期(30 天)证书。

我遵循了这个 guid https://jamielinux.com/docs/openssl-certificate-authority/introduction.html 并生成了 Root CA Certificate example.com& dev.example.com,但是我是否需要*.dev.example.comVault 的通配符中间证书来生成进一步的子域证书,例如one.dev.example.com,two.dev.example.com?

对此有任何帮助吗?

ssl certificate certificate-authority openssl self-signed-certificate
  • 1 个回答
  • 1496 Views
Martin Hope
roy
Asked: 2020-07-01 06:03:15 +0800 CST

保险柜的 OCSP 设置

  • 1

我在 PKI Secrets Engine 的容器中运行了保管库设置,并希望为应用程序添加 OCSP 支持以检查证书是否未被吊销。我没有找到任何关于如何为保险库设置 OCSP 的解释,也没有在任何博客中明确信息。

在我的设置中,我为 CRL 配置了以下内容

vault write pki/config/urls \
        issuing_certificates="http://127.0.0.1:8200/v1/pki/ca" \
        crl_distribution_points="http://127.0.0.1:8200/v1/pki/crl"

但是对于 OCSP 来说,没有什么比这更重要的了

我是否需要为 OSCP 设置单独的服务或 Vault 可以自行处理?

任何帮助了解 OCSP for Vault 将不胜感激?

ssl-certificate vault ocsp
  • 1 个回答
  • 878 Views
Martin Hope
roy
Asked: 2019-10-29 13:37:23 +0800 CST

测试 TLS TCP 端点

  • 0

TLS我有使用(自签名)证书运行的服务的 TCP 端点。为了测试这个端点,我使用它什么都不openssl s_client -connect service.domain.com:5050打印。CONNECTED(00000006)

我有用于此端点的自签名证书的证书和密钥。如何在openssl上面的命令中使用密钥?

如果这是不可能的openssl,还有什么其他方法可以测试这个?

ssl
  • 2 个回答
  • 827 Views
Martin Hope
roy
Asked: 2019-10-03 11:47:13 +0800 CST

Kubernetes pod 具有未绑定的即时 PersistentVolumeClaims (eks)

  • 6

我StorageClass为集群定义了以下aws eks(3个节点)

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: aws-gp2
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  zones: us-west-2a, us-west-2b, us-west-2c, us-west-2d
  fsType: ext4
reclaimPolicy: Retain
allowVolumeExpansion: true

并让eks节点在us-west-2a, us-west-2b, us-west-2c区域中运行。

当我尝试mysql使用动态持久卷进行部署时

---

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: mysql-pv-claim
  namespace: default
  labels:
    app: mysql
    env: prod
spec:
  storageClassName: aws-gp2
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 20Gi

---

kind: Deployment
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
metadata:
  name: mysql
  namespace: default
  labels:
    app: mysql
    env: prod
spec:
  selector:
    matchLabels:
      app: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: mysql
    spec:
      containers:
      - image: mysql:5.6
        name: mysql
        env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mysql-secret
              key: root-password
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - name: mysql-persistent-storage
          mountPath: /var/lib/mysql
      volumes:
      - name: mysql-persistent-storage
        persistentVolumeClaim:
          claimName: mysql-pv-claim

但是 pod 并没有超越Pending状态。

Pod 的事件日志说:

Events:
  Type     Reason            Age               From               Message
  ----     ------            ----              ----               -------
  Warning  FailedScheduling  8s (x7 over 20s)  default-scheduler  pod has unbound immediate PersistentVolumeClaims (repeated 3 times)
  Warning  FailedScheduling  8s (x2 over 8s)   default-scheduler  0/3 nodes are available: 3 node(s) had volume node affinity conflict.

我不明白为什么 pod 无法安装 PVC。

我向 eks 集群添加了 1 个节点,因此所有 4 个节点都可以跨越 4 个 az,然后重新部署它mysql并且它工作。仍然不知道真正的问题是什么。

kubernetes
  • 1 个回答
  • 13458 Views
Martin Hope
roy
Asked: 2019-04-10 09:56:18 +0800 CST

Verizon VPN 到 AWS VPC

  • 0

我想知道 Verizon 是否可以终止他们的 VPN 到 AWS VPC?

我们现有的设置在 EC2 实例上运行 Cisco 路由器 (CSR1000V),Verizon VPN 在 EC2 实例的公共 IP 上终止。这就是 Verizon 流量进入 AWS VPC 的方式。

amazon-web-services
  • 1 个回答
  • 102 Views
Martin Hope
roy
Asked: 2019-01-17 13:52:51 +0800 CST

独立 NTP 配置

  • 2

我正在尝试设置本地 NTP 服务器进行一些测试。我已经安装了 NTPUbuntu 18.04并在配置文件中注释了 server-pool 块

这是完整的配置:

driftfile /var/lib/ntp/ntp.drift

leapfile /usr/share/zoneinfo/leap-seconds.list

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

restrict -4 default kod notrap nomodify nopeer noquery limited
restrict -6 default kod notrap nomodify nopeer noquery limited

restrict 127.0.0.1
restrict ::1

restrict source notrap nomodify noquery

restrict 10.24.0.0 mask 255.255.0.0 notrust

server 127.127.1.0
fudge 127.127.1.0 stratum 10

使用此命令设置我想要的时间sudo timedatectl set-time "2013-06-02 23:26:00"

我还尝试查看服务是否是 ntp 服务正在sudo systemctl status ntp.service运行,但是当在端口上进行 grepped 时,123我没有发现任何正在运行的东西。发现有ps

ubuntu@ntp:~$ ps auxww | grep '[n]tp'
ntp      13517  0.0  0.8 103212  4136 ?        Ssl  Jun02   0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 111:115

当客户端尝试从该服务器上运行的 NTP 获取时间时,它会超时。也没有看到任何消息/var/log/syslog

更多信息 :

ubuntu@ntp:~$ ps auxww | grep '[n]tp'
ntp        807  0.0  0.7 103212  3480 ?        Ssl  Jan28   0:02 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 111:115

ubuntu@ntp:~$ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*127.127.1.0     .LOCL.          10 l    2   64  377    0.000    0.000   0.000

ubuntu@ntp:~$ ntpq -c rv
associd=0 status=0515 leap_none, sync_local, 1 event, clock_sync,
version="ntpd [email protected] (1)", processor="x86_64",
system="Linux/4.15.0-1019-aws", leap=00, stratum=11, precision=-24,
rootdelay=0.000, rootdisp=11.016, refid=LOCAL(0),
reftime=de1977a0.2605c5ad  Mon, Jan 29 2018  5:36:16.148,
clock=de1977a6.758ae7fc  Mon, Jan 29 2018  5:36:22.459, peer=57525, tc=6,
mintc=3, offset=0.000000, frequency=0.000, sys_jitter=0.000000,
clk_jitter=0.000, clk_wander=0.000, tai=37, leapsec=201701010000,
expire=201812280000

我试过这个脚本来从真正的 NTP 服务器获取时间,它在哪里工作,但不是在独立的 NTP 上。

我在这里想念什么?

ubuntu
  • 1 个回答
  • 562 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve