diff --git a/packages/kontinuous/tests/__snapshots__/maildev.dev.yaml b/packages/kontinuous/tests/__snapshots__/maildev.dev.yaml new file mode 100644 index 0000000000..ab38535d9d --- /dev/null +++ b/packages/kontinuous/tests/__snapshots__/maildev.dev.yaml @@ -0,0 +1,239 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test build manifests with snapshots maildev.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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + janitor/ttl: 7d + labels: + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: namespace-test-maildev-feature-branch-1-1neqr4v3 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + cert: wildcard + name: test-maildev-feature-branch-1 +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: netpol-ingress + namespace: test-maildev-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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-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-maildev-feature-branch-1 +automountServiceAccountToken: false +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: maildev + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-maildev-3wk4n2r4 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/deployment.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/depname.full: project.fabrique.maildev.maildev.deployment.maildev + kontinuous/depname.chartResource: maildev.deployment.maildev + kontinuous/depname.chartName: maildev + kontinuous/depname.chartPath: project.fabrique.maildev.maildev + kontinuous/depname.resourcePath: deployment.maildev + kontinuous/depname.resourceName: maildev + kontinuous/depname.chartNameTopFull: maildev.maildev + kontinuous/depname.chartNameTop: maildev + kontinuous/plugin.log: \\"false\\" + reloader.stakater.com/auto: \\"true\\" + namespace: test-maildev-feature-branch-1 +spec: + replicas: 1 + selector: + matchLabels: + component: maildev + template: + metadata: + labels: + component: maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-maildev-3wk4n2r4 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + spec: + containers: + - name: maildev + image: maildev/maildev:2.1.0 + imagePullPolicy: IfNotPresent + args: + - --mail-directory + - /home/node/maildev-data + volumeMounts: + - name: data + mountPath: /home/node/maildev-data + ports: + - name: http + containerPort: 1080 + protocol: TCP + - name: smtp + containerPort: 1025 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + resources: + requests: + cpu: 41m + memory: 121Mi + volumes: + - name: data + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: service-maildev-43k23ywy + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: maildev + annotations: + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/service.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + namespace: test-maildev-feature-branch-1 +spec: + ports: + - name: http + port: 1080 + targetPort: 1080 + - name: smtp + port: 1025 + targetPort: 1025 + selector: + component: maildev + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/ingress.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-feature-branch-1 + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: ingress-maildev-3q61sa35 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: maildev + namespace: test-maildev-feature-branch-1 +spec: + rules: + - host: maildev-test-maildev-feature-branch-1.dev.fabrique.social.gouv.fr + http: + paths: + - backend: + service: + name: maildev + port: + name: http + path: / + pathType: Prefix + tls: + - hosts: + - maildev-test-maildev-feature-branch-1.dev.fabrique.social.gouv.fr + secretName: wildcard-crt +" +`; diff --git a/packages/kontinuous/tests/__snapshots__/maildev.prod.yaml b/packages/kontinuous/tests/__snapshots__/maildev.prod.yaml new file mode 100644 index 0000000000..a74b9b03d1 --- /dev/null +++ b/packages/kontinuous/tests/__snapshots__/maildev.prod.yaml @@ -0,0 +1,240 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`test build manifests with snapshots maildev.prod 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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: namespace-test-maildev-1iq1pm0g + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: test-maildev +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: netpol-ingress + namespace: test-maildev + 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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + 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-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + labels: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + 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-maildev +automountServiceAccountToken: false +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: maildev + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-maildev-3wk4n2r4 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/deployment.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/depname.full: project.fabrique.maildev.maildev.deployment.maildev + kontinuous/depname.chartResource: maildev.deployment.maildev + kontinuous/depname.chartName: maildev + kontinuous/depname.chartPath: project.fabrique.maildev.maildev + kontinuous/depname.resourcePath: deployment.maildev + kontinuous/depname.resourceName: maildev + kontinuous/depname.chartNameTopFull: maildev.maildev + kontinuous/depname.chartNameTop: maildev + kontinuous/plugin.log: \\"false\\" + reloader.stakater.com/auto: \\"true\\" + namespace: test-maildev +spec: + replicas: 1 + selector: + matchLabels: + component: maildev + template: + metadata: + labels: + component: maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: deployment-maildev-3wk4n2r4 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + annotations: + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + spec: + containers: + - name: maildev + image: maildev/maildev:2.1.0 + imagePullPolicy: IfNotPresent + args: + - --mail-directory + - /home/node/maildev-data + volumeMounts: + - name: data + mountPath: /home/node/maildev-data + ports: + - name: http + containerPort: 1080 + protocol: TCP + - name: smtp + containerPort: 1025 + protocol: TCP + livenessProbe: + httpGet: + path: /healthz + port: http + readinessProbe: + httpGet: + path: /healthz + port: http + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + resources: + requests: + cpu: 41m + memory: 121Mi + volumes: + - name: data + emptyDir: {} +--- +apiVersion: v1 +kind: Service +metadata: + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: service-maildev-43k23ywy + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: maildev + annotations: + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/service.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + namespace: test-maildev +spec: + ports: + - name: http + port: 1080 + targetPort: 1080 + - name: smtp + port: 1025 + targetPort: 1025 + selector: + component: maildev + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + kubernetes.io/ingress.class: nginx + kontinuous/chartPath: project.fabrique.maildev.maildev + kontinuous/source: project/charts/fabrique/charts/maildev/charts/maildev/templates/ingress.yaml + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + cert-manager.io: cluster-issuer + cert-manager.io/cluster-issuer: letsencrypt-prod + kubernetes.io/tls-acme: \\"true\\" + labels: + component: maildev + application: test-maildev + kontinuous/deployment: test-maildev-feature-branch-1-ffac537e6cbbf934b08745a-5iniqvup + kontinuous/deployment.env: test-maildev-prod + kontinuous/ref: feature-branch-1 + kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53 + kontinuous/resourceName: ingress-maildev-3q61sa35 + app.kubernetes.io/manifest-managed-by: kontinuous + app.kubernetes.io/manifest-created-by: kontinuous + name: maildev + namespace: test-maildev +spec: + rules: + - host: maildev-test-maildev.fabrique.social.gouv.fr + http: + paths: + - backend: + service: + name: maildev + port: + name: http + path: / + pathType: Prefix + tls: + - hosts: + - maildev-test-maildev.fabrique.social.gouv.fr + secretName: maildev-crt +" +`; diff --git a/packages/kontinuous/tests/samples/maildev/config.yaml b/packages/kontinuous/tests/samples/maildev/config.yaml new file mode 100644 index 0000000000..b7df8496f9 --- /dev/null +++ b/packages/kontinuous/tests/samples/maildev/config.yaml @@ -0,0 +1,3 @@ +dependencies: + fabrique: + import: socialgouv/kontinuous/plugins/fabrique diff --git a/packages/kontinuous/tests/samples/maildev/env/prod/values.yaml b/packages/kontinuous/tests/samples/maildev/env/prod/values.yaml new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/packages/kontinuous/tests/samples/maildev/env/prod/values.yaml @@ -0,0 +1 @@ +{} diff --git a/packages/kontinuous/tests/samples/maildev/values.yaml b/packages/kontinuous/tests/samples/maildev/values.yaml new file mode 100644 index 0000000000..7354eb61d9 --- /dev/null +++ b/packages/kontinuous/tests/samples/maildev/values.yaml @@ -0,0 +1 @@ +maildev: {}