From 3b11b7ad13509f915892f157b5012887a5df487a Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Fri, 28 Jul 2023 20:45:45 +0200 Subject: [PATCH] gix --- .../tests/__snapshots__/jobs-build.dev.yaml | 178 ------------------ .../tests/__snapshots__/pgweb.dev.yaml | 82 ++++++++ plugins/fabrique/charts/pgweb/Chart.yaml | 2 +- plugins/fabrique/charts/pgweb/values.yaml | 1 + 4 files changed, 84 insertions(+), 179 deletions(-) create mode 100644 packages/kontinuous/tests/__snapshots__/pgweb.dev.yaml diff --git a/packages/kontinuous/tests/__snapshots__/jobs-build.dev.yaml b/packages/kontinuous/tests/__snapshots__/jobs-build.dev.yaml index 0b1e5c34cb..4d923f9a0e 100644 --- a/packages/kontinuous/tests/__snapshots__/jobs-build.dev.yaml +++ b/packages/kontinuous/tests/__snapshots__/jobs-build.dev.yaml @@ -945,115 +945,6 @@ spec: - configMapRef: name: hasura-configmap --- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - component: pgweb - application: test-jobs-build - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - kontinuous/deployment.env: test-jobs-build-feature-branch-1 - kontinuous/ref: feature-branch-1 - kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/resourceName: deployment-pgweb-5afr2ikf - app.kubernetes.io/manifest-managed-by: kontinuous - app.kubernetes.io/manifest-created-by: kontinuous - name: pgweb - namespace: test-jobs-build-feature-branch-1 - annotations: - kontinuous/chartPath: project.fabrique.contrib.pgweb - kontinuous/source: project/charts/fabrique/charts/contrib/charts/pgweb/templates/deployment.yaml - kontinuous/plugin.needs: '[\\"db\\"]' - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - kontinuous/depname.full: project.fabrique.contrib.pgweb.deployment.pgweb - kontinuous/depname.chartResource: pgweb.deployment.pgweb - kontinuous/depname.chartName: pgweb - kontinuous/depname.chartPath: project.fabrique.contrib.pgweb - kontinuous/depname.resourcePath: deployment.pgweb - kontinuous/depname.resourceName: pgweb - kontinuous/depname.chartNameTopFull: pgweb - kontinuous/depname.chartNameTop: pgweb - kontinuous/plugin.log: \\"false\\" - reloader.stakater.com/auto: \\"true\\" -spec: - replicas: 1 - selector: - matchLabels: - component: pgweb - template: - metadata: - labels: - component: pgweb - application: test-jobs-build - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - kontinuous/deployment.env: test-jobs-build-feature-branch-1 - kontinuous/ref: feature-branch-1 - kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/resourceName: deployment-pgweb-5afr2ikf - app.kubernetes.io/manifest-managed-by: kontinuous - app.kubernetes.io/manifest-created-by: kontinuous - annotations: - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - spec: - initContainers: - - name: wait-for-postgres - image: ghcr.io/socialgouv/docker/wait-for-postgres:6.56.1 - imagePullPolicy: Always - env: - - name: WAIT_FOR_RETRIES - value: \\"24\\" - envFrom: - - secretRef: - name: pg-user - resources: - limits: - cpu: 20m - memory: 32Mi - requests: - cpu: 5m - memory: 16Mi - containers: - - image: sosedoff/pgweb:0.11.8 - name: pgweb - envFrom: - - secretRef: - name: pg-user - ports: - - containerPort: 8081 - name: http - livenessProbe: - failureThreshold: 6 - httpGet: - path: / - port: http - initialDelaySeconds: 30 - periodSeconds: 5 - timeoutSeconds: 5 - readinessProbe: - failureThreshold: 15 - httpGet: - path: / - port: http - initialDelaySeconds: 1 - periodSeconds: 5 - successThreshold: 1 - timeoutSeconds: 1 - startupProbe: - failureThreshold: 12 - httpGet: - path: / - port: http - periodSeconds: 5 - resources: - limits: - cpu: 500m - memory: 256Mi - requests: - cpu: 100m - memory: 64Mi ---- apiVersion: v1 kind: Service metadata: @@ -1114,36 +1005,6 @@ spec: component: hasura type: ClusterIP --- -apiVersion: v1 -kind: Service -metadata: - labels: - component: pgweb - application: test-jobs-build - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - kontinuous/deployment.env: test-jobs-build-feature-branch-1 - kontinuous/ref: feature-branch-1 - kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/resourceName: service-pgweb-2rlshjo0 - app.kubernetes.io/manifest-managed-by: kontinuous - app.kubernetes.io/manifest-created-by: kontinuous - name: pgweb - namespace: test-jobs-build-feature-branch-1 - annotations: - kontinuous/chartPath: project.fabrique.contrib.pgweb - kontinuous/source: project/charts/fabrique/charts/contrib/charts/pgweb/templates/service.yaml - kontinuous/plugin.needs: '[\\"db\\"]' - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c -spec: - ports: - - name: http - port: 8081 - targetPort: 8081 - selector: - component: pgweb - type: ClusterIP ---- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -1221,44 +1082,5 @@ spec: - hosts: - hasura-test-jobs-build-feature-branch-1.dev.fabrique.social.gouv.fr secretName: wildcard-crt ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - annotations: - kubernetes.io/ingress.class: nginx - kontinuous/chartPath: project.fabrique.contrib.pgweb - kontinuous/source: project/charts/fabrique/charts/contrib/charts/pgweb/templates/ingress.yaml - kontinuous/plugin.needs: '[\\"db\\"]' - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - labels: - component: pgweb - application: test-jobs-build - kontinuous/deployment: test-jobs-build-feature-branch-1-ffac537e6cbbf934b087-50be2a5c - kontinuous/deployment.env: test-jobs-build-feature-branch-1 - kontinuous/ref: feature-branch-1 - kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 - kontinuous/resourceName: ingress-pgweb-2mnfw5rd - app.kubernetes.io/manifest-managed-by: kontinuous - app.kubernetes.io/manifest-created-by: kontinuous - name: pgweb - namespace: test-jobs-build-feature-branch-1 -spec: - rules: - - host: pgweb-test-jobs-build-feature-branch-1.dev.fabrique.social.gouv.fr - http: - paths: - - backend: - service: - name: pgweb - port: - name: http - path: / - pathType: Prefix - tls: - - hosts: - - pgweb-test-jobs-build-feature-branch-1.dev.fabrique.social.gouv.fr - secretName: wildcard-crt " `; diff --git a/packages/kontinuous/tests/__snapshots__/pgweb.dev.yaml b/packages/kontinuous/tests/__snapshots__/pgweb.dev.yaml new file mode 100644 index 0000000000..7f1928a308 --- /dev/null +++ b/packages/kontinuous/tests/__snapshots__/pgweb.dev.yaml @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test build manifests with snapshots pgweb.dev 1`] = ` +"apiVersion: v1 +kind: Namespace +metadata: + annotations: + field.cattle.io/projectId: \\"1234\\" + kontinuous/gitBranch: feature-branch-1 + kontinuous/mainNamespace: \\"true\\" + kapp.k14s.io/exists: \\"\\" + kontinuous/chartPath: project.fabrique.contrib.rancher-namespace + kontinuous/source: project/charts/fabrique/charts/contrib/charts/rancher-namespace/templates/namespace.yaml + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + janitor/ttl: 7d + labels: + application: test-pgweb + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + kontinuous/deployment.env: test-pgweb-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: namespace-test-pgweb-feature-branch-1-2hz0mbsl + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: test-pgweb-feature-branch-1 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: netpol-ingress + namespace: test-pgweb-feature-branch-1 + annotations: + kontinuous/chartPath: project.fabrique.contrib.security-policies + kontinuous/source: project/charts/fabrique/charts/contrib/charts/security-policies/templates/network-policy.yml + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + labels: + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + kontinuous/deployment.env: test-pgweb-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: networkpolicy-netpol-ingress-61ndxljw + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous +spec: + ingress: + - from: + - podSelector: {} + - from: + - namespaceSelector: + matchLabels: + network-policy/source: ingress-controller + - from: + - namespaceSelector: + matchLabels: + network-policy/source: monitoring + podSelector: {} + policyTypes: + - Ingress +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: default + annotations: + kontinuous/chartPath: project.fabrique.contrib.security-policies + kontinuous/source: project/charts/fabrique/charts/contrib/charts/security-policies/templates/service-account.yaml + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + labels: + kontinuous/deployment: test-pgweb-feature-branch-1-ffac537e6cbbf934b08745a37-51uoqv4n + kontinuous/deployment.env: test-pgweb-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: serviceaccount-default-2g5dmk74 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + namespace: test-pgweb-feature-branch-1 +automountServiceAccountToken: false +" +`; diff --git a/plugins/fabrique/charts/pgweb/Chart.yaml b/plugins/fabrique/charts/pgweb/Chart.yaml index 99601e0f7f..07af27f15f 100644 --- a/plugins/fabrique/charts/pgweb/Chart.yaml +++ b/plugins/fabrique/charts/pgweb/Chart.yaml @@ -3,6 +3,6 @@ name: pgweb version: 1.136.3 dependencies: - name: pgweb - degit: socialgouv/helm-charts/charts/pgweb@v1 + degit: socialgouv/helm-charts/charts/pgweb@pgweb condition: pgweb.enabled version: "1" diff --git a/plugins/fabrique/charts/pgweb/values.yaml b/plugins/fabrique/charts/pgweb/values.yaml index 07f7abf174..3b9366f49d 100644 --- a/plugins/fabrique/charts/pgweb/values.yaml +++ b/plugins/fabrique/charts/pgweb/values.yaml @@ -2,4 +2,5 @@ pgweb: enabled: true ~tpl~repositoryName: "{{ .Values.global.repositoryName }}" ingress: + enabled: true ~tpl~annotations: "{{ .Values.global.ingress.annotations | toJson }}"