ac2488d242
Not every cluster has a default storage class and even if they do, we don't always want to use that default storage class for our persistent volumes. Instead, allow the user to specific this via the cluster configuration itself for the three cases we require (zookeeper, scheduler, and registry). Change-Id: I948d57ce59d9b16c1c70fc52af2e22bd6131e6e2
112 lines
2.9 KiB
YAML
112 lines
2.9 KiB
YAML
{%- if manage_registry_cert %}
|
|
---
|
|
apiVersion: cert-manager.io/v1
|
|
kind: Certificate
|
|
metadata:
|
|
name: zuul-registry-tls
|
|
labels:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry-tls
|
|
spec:
|
|
keyEncoding: pkcs8
|
|
secretName: zuul-registry-tls
|
|
commonName: client
|
|
usages:
|
|
- digital signature
|
|
- key encipherment
|
|
- server auth
|
|
- client auth
|
|
issuerRef:
|
|
name: ca-issuer
|
|
kind: Issuer
|
|
{%- endif %}
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: zuul-registry
|
|
labels:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry
|
|
spec:
|
|
type: NodePort
|
|
ports:
|
|
- name: zuul-registry
|
|
port: 443
|
|
protocol: TCP
|
|
targetPort: registry
|
|
selector:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: zuul-registry
|
|
labels:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry
|
|
spec:
|
|
replicas: {{ spec.registry.count }}
|
|
serviceName: zuul-registry
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: zuul
|
|
app.kubernetes.io/instance: {{ instance_name }}
|
|
app.kubernetes.io/part-of: zuul
|
|
app.kubernetes.io/component: zuul-registry
|
|
spec:
|
|
imagePullSecrets: {{ spec.imagePullSecrets }}
|
|
containers:
|
|
- name: registry
|
|
image: {{ spec.imagePrefix }}/zuul-registry:{{ spec.zuulRegistryImageVersion }}
|
|
env:
|
|
- name: DEBUG
|
|
value: '1'
|
|
ports:
|
|
- name: registry
|
|
containerPort: 9000
|
|
volumeMounts:
|
|
- name: zuul-registry-config
|
|
mountPath: /conf
|
|
readOnly: true
|
|
- name: zuul-registry-tls
|
|
mountPath: /tls
|
|
readOnly: true
|
|
- name: zuul-registry
|
|
mountPath: /storage
|
|
volumes:
|
|
- name: zuul-registry-config
|
|
secret:
|
|
secretName: zuul-registry-generated-config
|
|
- name: zuul-registry-tls
|
|
secret:
|
|
secretName: {{ spec.registry.tls.secretName }}
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: zuul-registry
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: {{ spec.registry.volumeSize }} #80Gi
|
|
{%- if spec.registry.storageClassName != "" %}
|
|
storageClassName: {{ spec.registry.storageClassName }}
|
|
{%- endif %}
|