diff --git a/zuul_operator/templates/zuul.conf b/zuul_operator/templates/zuul.conf index 8c32359..587d2b2 100644 --- a/zuul_operator/templates/zuul.conf +++ b/zuul_operator/templates/zuul.conf @@ -26,6 +26,9 @@ start=true listen_address=0.0.0.0 port=9000 +[fingergw] +port=9079 + [executor] private_key_file=/etc/zuul/sshkey/sshkey {% for key, value in spec.executor.items() -%} diff --git a/zuul_operator/templates/zuul.yaml b/zuul_operator/templates/zuul.yaml index 2746862..79af07f 100644 --- a/zuul_operator/templates/zuul.yaml +++ b/zuul_operator/templates/zuul.yaml @@ -90,6 +90,28 @@ spec: app.kubernetes.io/part-of: zuul app.kubernetes.io/component: zuul-web --- +apiVersion: v1 +kind: Service +metadata: + name: zuul-fingergw + labels: + app.kubernetes.io/name: zuul + app.kubernetes.io/instance: {{ instance_name }} + app.kubernetes.io/part-of: zuul + app.kubernetes.io/component: zuul-fingergw +spec: + type: NodePort + ports: + - name: zuul-fingergw + port: 9079 + protocol: TCP + targetPort: zuul-web + selector: + app.kubernetes.io/name: zuul + app.kubernetes.io/instance: {{ instance_name }} + app.kubernetes.io/part-of: zuul + app.kubernetes.io/component: zuul-fingergw +--- apiVersion: apps/v1 kind: StatefulSet metadata: @@ -219,6 +241,53 @@ spec: secretName: zookeeper-client-tls --- apiVersion: apps/v1 +kind: Deployment +metadata: + name: zuul-fingergw + labels: + app.kubernetes.io/name: zuul + app.kubernetes.io/instance: {{ instance_name }} + app.kubernetes.io/part-of: zuul + app.kubernetes.io/component: zuul-fingergw +spec: + replicas: {{ spec.fingergw.count }} + selector: + matchLabels: + app.kubernetes.io/name: zuul + app.kubernetes.io/instance: {{ instance_name }} + app.kubernetes.io/part-of: zuul + app.kubernetes.io/component: zuul-fingergw + 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-fingergw + annotations: + zuulConfSha: "{{ zuul_conf_sha }}" + spec: + containers: + - name: fingergw + image: {{ spec.imagePrefix }}/zuul-fingergw:{{ spec.zuulImageVersion }} + ports: + - name: zuul-fingergw + containerPort: 9079 + volumeMounts: + - name: zuul-config + mountPath: /etc/zuul + - name: zookeeper-client-tls + mountPath: /tls/client + readOnly: true + volumes: + - name: zuul-config + secret: + secretName: zuul-config + - name: zookeeper-client-tls + secret: + secretName: zookeeper-client-tls +--- +apiVersion: apps/v1 kind: StatefulSet metadata: name: zuul-executor diff --git a/zuul_operator/zuul.py b/zuul_operator/zuul.py index b4567ff..126bccc 100644 --- a/zuul_operator/zuul.py +++ b/zuul_operator/zuul.py @@ -70,6 +70,7 @@ class Zuul: self.spec.setdefault('executor', {}).setdefault('count', 1) self.spec.setdefault('merger', {}).setdefault('count', 0) self.spec.setdefault('web', {}).setdefault('count', 1) + self.spec.setdefault('fingergw', {}).setdefault('count', 1) self.spec.setdefault('imagePrefix', 'docker.io/zuul') self.spec.setdefault('zuulImageVersion', 'latest')