🔧 Bind diagnostic workloads to existing registry pull credentials
Some checks are pending
web-ci / checks (push) Waiting to run
web-ci / pool-search-mongo (push) Waiting to run

This commit is contained in:
Codex 2026-11-10 08:20:49 -08:00
parent 574eed61fb
commit c52a8ab89a
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,6 @@ image=sys.argv[1]
if '@sha256:' not in image: raise SystemExit('immutable image required')
ns='droboticflow-fanyu'
def resource(kind,name,spec): return {'apiVersion':'apps/v1' if kind=='Deployment' else 'v1','kind':kind,'metadata':{'name':name,'namespace':ns},**spec}
items=[resource('ConfigMap','diagnostic-edge',{'data':{'nginx.conf':Path(__file__).with_name('nginx.conf').read_text()}}),resource('Deployment','diagnostic-edge',{'spec':{'replicas':2,'selector':{'matchLabels':{'app':'diagnostic-edge'}},'template':{'metadata':{'labels':{'app':'diagnostic-edge'}},'spec':{'automountServiceAccountToken':False,'securityContext':{'runAsUser':101,'runAsGroup':101,'runAsNonRoot':True,'fsGroup':101,'seccompProfile':{'type':'RuntimeDefault'}},'topologySpreadConstraints':[{'maxSkew':1,'topologyKey':'kubernetes.io/hostname','whenUnsatisfiable':'ScheduleAnyway','labelSelector':{'matchLabels':{'app':'diagnostic-edge'}}}],'containers':[{'name':'proxy','image':image,'command':['nginx','-g','daemon off;'],'ports':[{'containerPort':8080},{'containerPort':8443}],'resources':{'requests':{'cpu':'50m','memory':'32Mi'},'limits':{'cpu':'250m','memory':'128Mi'}},'securityContext':{'readOnlyRootFilesystem':True,'allowPrivilegeEscalation':False,'capabilities':{'drop':['ALL']}},'volumeMounts':[{'name':'config','mountPath':'/etc/nginx/nginx.conf','subPath':'nginx.conf','readOnly':True},{'name':'tls','mountPath':'/tls','readOnly':True},{'name':'tmp','mountPath':'/tmp'}],'readinessProbe':{'tcpSocket':{'port':8443}},'livenessProbe':{'tcpSocket':{'port':8443}}}],'volumes':[{'name':'config','configMap':{'name':'diagnostic-edge'}},{'name':'tls','secret':{'secretName':'diagnostic-edge-tls','defaultMode':288}},{'name':'tmp','emptyDir':{'sizeLimit':'128Mi'}}]}}}})]
items=[resource('ConfigMap','diagnostic-edge',{'data':{'nginx.conf':Path(__file__).with_name('nginx.conf').read_text()}}),resource('Deployment','diagnostic-edge',{'spec':{'replicas':2,'selector':{'matchLabels':{'app':'diagnostic-edge'}},'template':{'metadata':{'labels':{'app':'diagnostic-edge'}},'spec':{'imagePullSecrets':[{'name':'droboticflow-registry'}],'automountServiceAccountToken':False,'securityContext':{'runAsUser':101,'runAsGroup':101,'runAsNonRoot':True,'fsGroup':101,'seccompProfile':{'type':'RuntimeDefault'}},'topologySpreadConstraints':[{'maxSkew':1,'topologyKey':'kubernetes.io/hostname','whenUnsatisfiable':'ScheduleAnyway','labelSelector':{'matchLabels':{'app':'diagnostic-edge'}}}],'containers':[{'name':'proxy','image':image,'command':['nginx','-g','daemon off;'],'ports':[{'containerPort':8080},{'containerPort':8443}],'resources':{'requests':{'cpu':'50m','memory':'32Mi'},'limits':{'cpu':'250m','memory':'128Mi'}},'securityContext':{'readOnlyRootFilesystem':True,'allowPrivilegeEscalation':False,'capabilities':{'drop':['ALL']}},'volumeMounts':[{'name':'config','mountPath':'/etc/nginx/nginx.conf','subPath':'nginx.conf','readOnly':True},{'name':'tls','mountPath':'/tls','readOnly':True},{'name':'tmp','mountPath':'/tmp'}],'readinessProbe':{'tcpSocket':{'port':8443}},'livenessProbe':{'tcpSocket':{'port':8443}}}],'volumes':[{'name':'config','configMap':{'name':'diagnostic-edge'}},{'name':'tls','secret':{'secretName':'diagnostic-edge-tls','defaultMode':288}},{'name':'tmp','emptyDir':{'sizeLimit':'128Mi'}}]}}}})]
items.append({'apiVersion':'networking.k8s.io/v1','kind':'NetworkPolicy','metadata':{'name':'diagnostic-gateway-ingress','namespace':ns},'spec':{'podSelector':{'matchLabels':{'app':'diagnostic-gateway'}},'policyTypes':['Ingress'],'ingress':[{'from':[{'podSelector':{'matchLabels':{'app':'diagnostic-edge'}}}],'ports':[{'protocol':'TCP','port':8080}]}]}})
print(json.dumps({'apiVersion':'v1','kind':'List','items':items}))

View File

@ -66,6 +66,8 @@ spec:
metadata:
labels: {app: diagnostic-gateway}
spec:
imagePullSecrets:
- name: droboticflow-registry
serviceAccountName: diagnostic-gateway
securityContext:
runAsNonRoot: true