Skip to content

Agent Mesh

use tls

Antonio Ojea9c792f4f1c6d
diff --git a/.github/k8s/sam-hub-template.yaml b/.github/k8s/sam-hub-template.yaml
index d0487042..fa06c6cb 100644
--- a/.github/k8s/sam-hub-template.yaml
+++ b/.github/k8s/sam-hub-template.yaml
@@ -17,10 +17,10 @@ spec:
targetPort: 4001
protocol: UDP
name: libp2p-udp
- - port: 80
+ - port: 443
targetPort: 9090
protocol: TCP
- name: register-http
+ name: register-https
selector:
app: sam-hub-${ENV_NAME}
---
@@ -32,10 +32,10 @@ metadata:
spec:
type: ClusterIP
ports:
- - port: 80
+ - port: 443
targetPort: 9090
protocol: TCP
- name: http
+ name: https
selector:
app: sam-hub-${ENV_NAME}
---
@@ -78,12 +78,14 @@ spec:
httpGet:
path: /healthz
port: metrics
+ scheme: HTTPS
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: metrics
+ scheme: HTTPS
initialDelaySeconds: 15
periodSeconds: 20
args:
@@ -93,6 +95,8 @@ spec:
- "--issuer=https://auth.sam-mesh.dev,https://container.googleapis.com/v1/projects/${GCP_PROJECT_ID}/locations/${CLUSTER_REGION}/clusters/${CLUSTER_NAME}"
# 1. Dex CLI client ID. 2. Canary projected volume audience.
- "--allowed-audiences=sam-mesh-audience,sam-hub-audience"
+ - "--tls-cert-file=/etc/sam/certs/tls.crt"
+ - "--tls-key-file=/etc/sam/certs/tls.key"
resources:
requests:
cpu: 100m
@@ -100,6 +104,15 @@ spec:
limits:
cpu: 500m
memory: 512Mi
+ volumeMounts:
+ - name: tls-certs
+ mountPath: /etc/sam/certs
+ readOnly: true
+ volumes:
+ - name: tls-certs
+ secret:
+ secretName: hub-sam-mesh-tls
+ optional: true
---
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
diff --git a/.github/k8s/sam-node-template.yaml b/.github/k8s/sam-node-template.yaml
index 18094ca4..5422aaa8 100644
--- a/.github/k8s/sam-node-template.yaml
+++ b/.github/k8s/sam-node-template.yaml
@@ -45,7 +45,7 @@ spec:
args:
- "run"
- "--config=/etc/sam/sam-node.yaml"
- - "--hub=http://sam-hub-internal-${ENV_NAME}.sam-${ENV_NAME}.svc.cluster.local"
+ - "--hub=https://sam-hub-internal-${ENV_NAME}.sam-${ENV_NAME}.svc.cluster.local"
- "--jwt-path=/var/run/secrets/tokens/sam-token"
- "--api-token=secret-token"
ports: