diff --git a/helm/korifi/job-task-runner/deployment.yaml b/helm/korifi/job-task-runner/deployment.yaml index e2f809c1d..999349bb2 100644 --- a/helm/korifi/job-task-runner/deployment.yaml +++ b/helm/korifi/job-task-runner/deployment.yaml @@ -2,14 +2,14 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: job-task-runner - name: job-task-runner-controller-manager + app: korifi-job-task-runner + name: korifi-job-task-runner-controller-manager namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.jobTaskRunner.replicas }} selector: matchLabels: - app: job-task-runner + app: korifi-job-task-runner template: metadata: annotations: @@ -18,7 +18,7 @@ spec: prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: - app: job-task-runner + app: korifi-job-task-runner spec: containers: - name: manager @@ -58,7 +58,7 @@ spec: {{- .Values.jobTaskRunner.resources | toYaml | nindent 10 }} {{- include "korifi.securityContext" . | indent 8 }} {{- include "korifi.podSecurityContext" . | indent 6 }} - serviceAccountName: job-task-runner-controller-manager + serviceAccountName: korifi-job-task-runner-controller-manager {{- if .Values.jobTaskRunner.nodeSelector }} nodeSelector: {{ toYaml .Values.jobTaskRunner.nodeSelector | indent 8 }} diff --git a/helm/korifi/job-task-runner/rbac.yaml b/helm/korifi/job-task-runner/rbac.yaml index b860e0e5d..10ab17d14 100644 --- a/helm/korifi/job-task-runner/rbac.yaml +++ b/helm/korifi/job-task-runner/rbac.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: job-task-runner-controller-manager + name: korifi-job-task-runner-controller-manager namespace: {{ .Release.Namespace }} imagePullSecrets: {{- range .Values.systemImagePullSecrets }} @@ -12,7 +12,7 @@ imagePullSecrets: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: job-task-runner-leader-election-rolebinding + name: korifi-job-task-runner-leader-election-rolebinding namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io @@ -20,18 +20,18 @@ roleRef: name: korifi-controllers-leader-election-role subjects: - kind: ServiceAccount - name: job-task-runner-controller-manager + name: korifi-job-task-runner-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: job-task-runner-manager-rolebinding + name: korifi-job-task-runner-manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: korifi-job-task-runner-taskworkload-manager-role subjects: - kind: ServiceAccount - name: job-task-runner-controller-manager + name: korifi-job-task-runner-controller-manager namespace: {{ .Release.Namespace }} diff --git a/helm/korifi/job-task-runner/service.yaml b/helm/korifi/job-task-runner/service.yaml index 217a4b389..5f3f0d1ca 100644 --- a/helm/korifi/job-task-runner/service.yaml +++ b/helm/korifi/job-task-runner/service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: - name: job-task-runner-debug-port + name: korifi-job-task-runner-debug-port namespace: {{ .Release.Namespace }} spec: ports: @@ -13,6 +13,6 @@ spec: protocol: TCP targetPort: 40000 selector: - app: job-task-runner + app: korifi-job-task-runner type: NodePort {{- end }} diff --git a/helm/korifi/kpack-image-builder/cert.yaml b/helm/korifi/kpack-image-builder/cert.yaml index 2dba93cfd..11c3ff8c8 100644 --- a/helm/korifi/kpack-image-builder/cert.yaml +++ b/helm/korifi/kpack-image-builder/cert.yaml @@ -1,13 +1,13 @@ apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: kpack-image-builder-serving-cert + name: korifi-kpack-image-builder-serving-cert namespace: {{ .Release.Namespace }} spec: dnsNames: - - kpack-image-builder-webhook-service.{{ .Release.Namespace }}.svc - - kpack-image-builder-webhook-service.{{ .Release.Namespace }}.svc.cluster.local + - korifi-kpack-image-builder-webhook-service.{{ .Release.Namespace }}.svc + - korifi-kpack-image-builder-webhook-service.{{ .Release.Namespace }}.svc.cluster.local issuerRef: kind: Issuer name: selfsigned-issuer - secretName: kpack-image-builder-webhook-cert + secretName: korifi-kpack-image-builder-webhook-cert diff --git a/helm/korifi/kpack-image-builder/configmap.yaml b/helm/korifi/kpack-image-builder/configmap.yaml index 3592153b5..bed91627e 100644 --- a/helm/korifi/kpack-image-builder/configmap.yaml +++ b/helm/korifi/kpack-image-builder/configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: kpack-image-builder-config + name: korifi-kpack-image-builder-config namespace: {{ .Release.Namespace }} data: config.yaml: |- diff --git a/helm/korifi/kpack-image-builder/deployment.yaml b/helm/korifi/kpack-image-builder/deployment.yaml index 42f34960b..f409dc51d 100644 --- a/helm/korifi/kpack-image-builder/deployment.yaml +++ b/helm/korifi/kpack-image-builder/deployment.yaml @@ -2,14 +2,14 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: kpack-image-builder - name: kpack-image-builder-controller-manager + app: korifi-kpack-image-builder + name: korifi-kpack-image-builder-controller-manager namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.kpackImageBuilder.replicas | default 1}} selector: matchLabels: - app: kpack-image-builder + app: korifi-kpack-image-builder template: metadata: annotations: @@ -19,7 +19,7 @@ spec: prometheus.io/scrape: "true" checksum/config: {{ tpl ($.Files.Get "controllers/configmap.yaml") $ | sha256sum }} labels: - app: kpack-image-builder + app: korifi-kpack-image-builder spec: containers: - name: manager @@ -38,12 +38,12 @@ spec: - "--" - "--health-probe-bind-address=:8081" - "--leader-elect" - - "--config=/etc/kpack-image-builder-config" + - "--config=/etc/korifi-kpack-image-builder-config" {{- else }} args: - --health-probe-bind-address=:8081 - --leader-elect - - --config=/etc/kpack-image-builder-config + - --config=/etc/korifi-kpack-image-builder-config {{- end }} livenessProbe: httpGet: @@ -71,11 +71,11 @@ spec: - mountPath: /tmp/k8s-webhook-server/serving-certs name: cert readOnly: true - - mountPath: /etc/kpack-image-builder-config - name: kpack-image-builder-config + - mountPath: /etc/korifi-kpack-image-builder-config + name: korifi-kpack-image-builder-config readOnly: true {{- include "korifi.podSecurityContext" . | indent 6 }} - serviceAccountName: kpack-image-builder-controller-manager + serviceAccountName: korifi-kpack-image-builder-controller-manager {{- if .Values.kpackImageBuilder.nodeSelector }} nodeSelector: {{ toYaml .Values.kpackImageBuilder.nodeSelector | indent 8 }} @@ -89,7 +89,7 @@ spec: - name: cert secret: defaultMode: 420 - secretName: kpack-image-builder-webhook-cert + secretName: korifi-kpack-image-builder-webhook-cert - configMap: - name: kpack-image-builder-config - name: kpack-image-builder-config + name: korifi-kpack-image-builder-config + name: korifi-kpack-image-builder-config diff --git a/helm/korifi/kpack-image-builder/manifests.yaml b/helm/korifi/kpack-image-builder/manifests.yaml index 2b17cbb09..c50a75fd4 100644 --- a/helm/korifi/kpack-image-builder/manifests.yaml +++ b/helm/korifi/kpack-image-builder/manifests.yaml @@ -4,14 +4,14 @@ kind: MutatingWebhookConfiguration metadata: name: korifi-kpack-image-builder-mutating-webhook-configuration annotations: - cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/kpack-image-builder-serving-cert' + cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/korifi-kpack-image-builder-serving-cert' webhooks: - admissionReviewVersions: - v1 - v1beta1 clientConfig: service: - name: kpack-image-builder-webhook-service + name: korifi-kpack-image-builder-webhook-service namespace: '{{ .Release.Namespace }}' path: /mutate-korifi-cloudfoundry-org-v1alpha1-kpack-image-builder-finalizer failurePolicy: Fail diff --git a/helm/korifi/kpack-image-builder/rbac.yaml b/helm/korifi/kpack-image-builder/rbac.yaml index ebcddc839..48d54810f 100644 --- a/helm/korifi/kpack-image-builder/rbac.yaml +++ b/helm/korifi/kpack-image-builder/rbac.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: kpack-image-builder-controller-manager + name: korifi-kpack-image-builder-controller-manager namespace: {{ .Release.Namespace }} {{- if .Values.eksContainerRegistryRoleARN }} annotations: @@ -16,7 +16,7 @@ imagePullSecrets: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: kpack-image-builder-leader-election-rolebinding + name: korifi-kpack-image-builder-leader-election-rolebinding namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io @@ -24,18 +24,18 @@ roleRef: name: korifi-controllers-leader-election-role subjects: - kind: ServiceAccount - name: kpack-image-builder-controller-manager + name: korifi-kpack-image-builder-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: kpack-image-builder-manager-rolebinding + name: korifi-kpack-image-builder-manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: korifi-kpack-build-manager-role subjects: - kind: ServiceAccount - name: kpack-image-builder-controller-manager + name: korifi-kpack-image-builder-controller-manager namespace: {{ .Release.Namespace }} diff --git a/helm/korifi/kpack-image-builder/service.yaml b/helm/korifi/kpack-image-builder/service.yaml index ac41475ba..e1e62b379 100644 --- a/helm/korifi/kpack-image-builder/service.yaml +++ b/helm/korifi/kpack-image-builder/service.yaml @@ -1,20 +1,20 @@ apiVersion: v1 kind: Service metadata: - name: kpack-image-builder-webhook-service + name: korifi-kpack-image-builder-webhook-service namespace: {{ .Release.Namespace }} spec: ports: - port: 443 targetPort: 9443 selector: - app: kpack-image-builder + app: korifi-kpack-image-builder --- {{- if .Values.debug }} apiVersion: v1 kind: Service metadata: - name: kpack-image-builder-debug-port + name: korifi-kpack-image-builder-debug-port namespace: {{ .Release.Namespace }} spec: ports: @@ -24,6 +24,6 @@ spec: protocol: TCP targetPort: 40000 selector: - app: kpack-image-builder + app: korifi-kpack-image-builder type: NodePort {{- end }} diff --git a/helm/korifi/statefulset-runner/deployment.yaml b/helm/korifi/statefulset-runner/deployment.yaml index 665ae98c4..133554855 100644 --- a/helm/korifi/statefulset-runner/deployment.yaml +++ b/helm/korifi/statefulset-runner/deployment.yaml @@ -2,14 +2,14 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: statefulset-runner - name: statefulset-runner-controller-manager + app: korifi-statefulset-runner + name: korifi-statefulset-runner-controller-manager namespace: {{ .Release.Namespace }} spec: replicas: {{ .Values.statefulsetRunner.replicas }} selector: matchLabels: - app: statefulset-runner + app: korifi-statefulset-runner template: metadata: annotations: @@ -18,7 +18,7 @@ spec: prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: - app: statefulset-runner + app: korifi-statefulset-runner spec: containers: - name: manager @@ -56,7 +56,7 @@ spec: {{- .Values.statefulsetRunner.resources | toYaml | nindent 10 }} {{- include "korifi.securityContext" . | indent 8 }} {{- include "korifi.podSecurityContext" . | indent 6 }} - serviceAccountName: statefulset-runner-controller-manager + serviceAccountName: korifi-statefulset-runner-controller-manager {{- if .Values.statefulsetRunner.nodeSelector }} nodeSelector: {{ toYaml .Values.statefulsetRunner.nodeSelector | indent 8 }} diff --git a/helm/korifi/statefulset-runner/post-install-runnerinfo.yaml b/helm/korifi/statefulset-runner/post-install-runnerinfo.yaml index fb845ba64..0b801f185 100644 --- a/helm/korifi/statefulset-runner/post-install-runnerinfo.yaml +++ b/helm/korifi/statefulset-runner/post-install-runnerinfo.yaml @@ -23,7 +23,7 @@ spec: app.kubernetes.io/instance: {{ .Release.Name | quote }} helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" spec: - serviceAccountName: statefulset-runner-controller-manager + serviceAccountName: korifi-statefulset-runner-controller-manager restartPolicy: Never {{- include "korifi.podSecurityContext" . | indent 6 }} containers: diff --git a/helm/korifi/statefulset-runner/rbac.yaml b/helm/korifi/statefulset-runner/rbac.yaml index e5ebde3ec..2910338cc 100644 --- a/helm/korifi/statefulset-runner/rbac.yaml +++ b/helm/korifi/statefulset-runner/rbac.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: statefulset-runner-controller-manager + name: korifi-statefulset-runner-controller-manager namespace: {{ .Release.Namespace }} imagePullSecrets: {{- range .Values.systemImagePullSecrets }} @@ -11,7 +11,7 @@ imagePullSecrets: apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: statefulset-runner-leader-election-rolebinding + name: korifi-statefulset-runner-leader-election-rolebinding namespace: {{ .Release.Namespace }} roleRef: apiGroup: rbac.authorization.k8s.io @@ -19,18 +19,18 @@ roleRef: name: korifi-controllers-leader-election-role subjects: - kind: ServiceAccount - name: statefulset-runner-controller-manager + name: korifi-statefulset-runner-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: - name: statefulset-runner-manager-rolebinding + name: korifi-statefulset-runner-manager-rolebinding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: korifi-statefulset-runner-appworkload-manager-role subjects: - kind: ServiceAccount - name: statefulset-runner-controller-manager + name: korifi-statefulset-runner-controller-manager namespace: {{ .Release.Namespace }} diff --git a/helm/korifi/statefulset-runner/service.yaml b/helm/korifi/statefulset-runner/service.yaml index b8e449281..097b7cc43 100644 --- a/helm/korifi/statefulset-runner/service.yaml +++ b/helm/korifi/statefulset-runner/service.yaml @@ -3,7 +3,7 @@ apiVersion: v1 kind: Service metadata: - name: statefulset-runner-debug-port + name: korifi-statefulset-runner-debug-port namespace: {{ .Release.Namespace }} spec: ports: @@ -13,6 +13,6 @@ spec: protocol: TCP targetPort: 40000 selector: - app: statefulset-runner + app: korifi-statefulset-runner type: NodePort {{- end }} diff --git a/job-task-runner/PROJECT b/job-task-runner/PROJECT deleted file mode 100644 index b8128c974..000000000 --- a/job-task-runner/PROJECT +++ /dev/null @@ -1,16 +0,0 @@ -domain: cloudfoundry.org -layout: -- go.kubebuilder.io/v3 -projectName: job-task-runner -repo: code.cloudfoundry.org/korifi/job-task-runner -resources: -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: cloudfoundry.org - group: korifi - kind: TaskWorkload - path: code.cloudfoundry.org/korifi/job-task-runner/api/v1alpha1 - version: v1alpha1 -version: "3" diff --git a/job-task-runner/main.go b/job-task-runner/main.go index 3fe01dfa5..aa66a3bb5 100644 --- a/job-task-runner/main.go +++ b/job-task-runner/main.go @@ -8,6 +8,7 @@ import ( korifiv1alpha1 "code.cloudfoundry.org/korifi/controllers/api/v1alpha1" jobtaskcontrollers "code.cloudfoundry.org/korifi/job-task-runner/controllers" "code.cloudfoundry.org/korifi/tools" + "code.cloudfoundry.org/korifi/version" "go.uber.org/zap/zapcore" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" @@ -53,6 +54,8 @@ func main() { ctrl.SetLogger(logger) klog.SetLogger(ctrl.Log) + ctrl.Log.Info("starting Korifi job-task runner", "version", version.Version) + mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{ Scheme: scheme, Metrics: metricsserver.Options{ diff --git a/kpack-image-builder/Makefile b/kpack-image-builder/Makefile index fc0043cc7..f631f1c8c 100644 --- a/kpack-image-builder/Makefile +++ b/kpack-image-builder/Makefile @@ -42,10 +42,10 @@ manifests: bin/controller-gen output:rbac:artifacts:config=../helm/korifi/kpack-image-builder \ output:webhook:artifacts:config=../helm/korifi/kpack-image-builder - yq -i 'with(.metadata; .annotations["cert-manager.io/inject-ca-from"]="{{ .Release.Namespace }}/kpack-image-builder-serving-cert")' $(webhooks-file) + yq -i 'with(.metadata; .annotations["cert-manager.io/inject-ca-from"]="{{ .Release.Namespace }}/korifi-kpack-image-builder-serving-cert")' $(webhooks-file) yq -i 'with(.metadata; .name="korifi-kpack-image-builder-" + .name)' $(webhooks-file) yq -i 'with(.webhooks[]; .clientConfig.service.namespace="{{ .Release.Namespace }}")' $(webhooks-file) - yq -i 'with(.webhooks[]; .clientConfig.service.name="kpack-image-builder-" + .clientConfig.service.name)' $(webhooks-file) + yq -i 'with(.webhooks[]; .clientConfig.service.name="korifi-kpack-image-builder-" + .clientConfig.service.name)' $(webhooks-file) diff --git a/kpack-image-builder/PROJECT b/kpack-image-builder/PROJECT deleted file mode 100644 index bb0956e9c..000000000 --- a/kpack-image-builder/PROJECT +++ /dev/null @@ -1,16 +0,0 @@ -domain: cloudfoundry.org -layout: -- go.kubebuilder.io/v3 -projectName: korifi-kpack-build -repo: code.cloudfoundry.org/korifi/kpack-image-builder -resources: -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: cloudfoundry.org - group: ext - kind: BuildWorkload - path: code.cloudfoundry.org/korifi/kpack-image-builder/api/v1alpha1 - version: v1alpha1 -version: "3" diff --git a/kpack-image-builder/main.go b/kpack-image-builder/main.go index 605e373dd..2bb7d5218 100644 --- a/kpack-image-builder/main.go +++ b/kpack-image-builder/main.go @@ -12,6 +12,7 @@ import ( "code.cloudfoundry.org/korifi/tools" "code.cloudfoundry.org/korifi/tools/image" "code.cloudfoundry.org/korifi/tools/registry" + "code.cloudfoundry.org/korifi/version" buildv1alpha2 "github.com/pivotal/kpack/pkg/apis/build/v1alpha2" "go.uber.org/zap/zapcore" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -64,6 +65,8 @@ func main() { ctrl.SetLogger(logger) klog.SetLogger(ctrl.Log) + ctrl.Log.Info("starting Korifi kpack image builder", "version", version.Version) + conf := ctrl.GetConfigOrDie() mgr, err := ctrl.NewManager(conf, ctrl.Options{ Scheme: scheme, diff --git a/statefulset-runner/PROJECT b/statefulset-runner/PROJECT deleted file mode 100644 index 070c7802f..000000000 --- a/statefulset-runner/PROJECT +++ /dev/null @@ -1,23 +0,0 @@ -domain: cloudfoundry.org -layout: -- go.kubebuilder.io/v3 -projectName: statefulset-runner -repo: code.cloudfoundry.org/korifi/statefulset-runner -resources: -- api: - crdVersion: v1 - namespaced: true - controller: true - domain: cloudfoundry.org - group: korifi - kind: AppWorkload - path: code.cloudfoundry.org/korifi/statefulset-runner/api/v1alpha1 - version: v1alpha1 -- group: "" - kind: Pod - path: k8s.io/api/core/v1 - version: v1 - webhooks: - defaulting: true - webhookVersion: v1 -version: "3" diff --git a/statefulset-runner/main.go b/statefulset-runner/main.go index 908b94c3c..fc9d53915 100644 --- a/statefulset-runner/main.go +++ b/statefulset-runner/main.go @@ -14,6 +14,7 @@ import ( korifiv1alpha1 "code.cloudfoundry.org/korifi/controllers/api/v1alpha1" statefulsetcontrollers "code.cloudfoundry.org/korifi/statefulset-runner/controllers" "code.cloudfoundry.org/korifi/tools" + "code.cloudfoundry.org/korifi/version" "go.uber.org/zap/zapcore" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" @@ -59,6 +60,8 @@ func main() { ctrl.SetLogger(logger) klog.SetLogger(ctrl.Log) + ctrl.Log.Info("starting Korifi statefulset runner", "version", version.Version) + conf := ctrl.GetConfigOrDie() mgr, err := ctrl.NewManager(conf, ctrl.Options{ Scheme: scheme, diff --git a/tests/crds/apps_test.go b/tests/crds/apps_test.go index 94a770d54..3efa88ad3 100644 --- a/tests/crds/apps_test.go +++ b/tests/crds/apps_test.go @@ -178,7 +178,7 @@ func uploadAppBits(appGUID, packageGUID string) { kpackBuilderConfigMap := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Namespace: "korifi", - Name: "kpack-image-builder-config", + Name: "korifi-kpack-image-builder-config", }, } Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(kpackBuilderConfigMap), kpackBuilderConfigMap)).To(Succeed()) diff --git a/tests/helpers/fail_handler/pods.go b/tests/helpers/fail_handler/pods.go index 22045ea7d..16f9b53fc 100644 --- a/tests/helpers/fail_handler/pods.go +++ b/tests/helpers/fail_handler/pods.go @@ -218,19 +218,19 @@ func PrintKorifiLogs(config *rest.Config, correlationId string, since time.Time) { Namespace: "korifi", LabelKey: "app", - LabelValue: "kpack-image-builder", + LabelValue: "korifi-kpack-image-builder", Since: tools.PtrTo(metav1.NewTime(since)), }, { Namespace: "korifi", LabelKey: "app", - LabelValue: "statefulset-runner", + LabelValue: "korifi-statefulset-runner", Since: tools.PtrTo(metav1.NewTime(since)), }, { Namespace: "korifi", LabelKey: "app", - LabelValue: "job-task-runner", + LabelValue: "korifi-job-task-runner", Since: tools.PtrTo(metav1.NewTime(since)), }, })