小编Ale*_*uun的帖子

kubernetes 如何将 pod 暴露给集群机器之外的东西?

我阅读了以下kubernetes 文档,这些文档导致以下 yaml 在集群中运行 postgresql 和 pgadmin:

--- pgadmin-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pgadmin-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: pgadmin-pod
  template:
    metadata:
      labels:
        app: pgadmin-pod
    spec:
      containers:
        - name: pgadmin-container
          image: dpage/pgadmin4
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 80
          env:
            - name: PGADMIN_DEFAULT_EMAIL
              value: email@example.com
            - name: PGADMIN_DEFAULT_PASSWORD
              value: password

--- pgadmin-service.yaml
apiVersion: v1
kind: Service
metadata:
  name: pgadmin-service
spec:
  type: NodePort
  ports:
    - port: 30000
      targetPort: 80
  selector:
    app: pgadmin-pod

--- postgres-deployment.yaml
apiVersion: apps/v1
kind: …
Run Code Online (Sandbox Code Playgroud)

postgresql networking pgadmin kubernetes

5
推荐指数
1
解决办法
1864
查看次数

标签 统计

kubernetes ×1

networking ×1

pgadmin ×1

postgresql ×1