Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: chart static-app using zerodowntime probes #400

Closed
wants to merge 11 commits into from
262 changes: 262 additions & 0 deletions packages/kontinuous/tests/__snapshots__/static-app.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`test build manifests with snapshots static-app.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-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
janitor/ttl: 7d
labels:
application: test-static-app
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-feature-branch-1
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: namespace-test-static-app-feature-branch-1-69vu59uj
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
cert: wildcard
name: test-static-app-feature-branch-1
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: netpol-ingress
namespace: test-static-app-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-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
labels:
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-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-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
labels:
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-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-static-app-feature-branch-1
automountServiceAccountToken: false
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: site
application: test-static-app
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-feature-branch-1
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: deployment-site-kmsczrbj
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
name: site
namespace: test-static-app-feature-branch-1
annotations:
kontinuous/chartPath: project.fabrique.contrib.site
kontinuous/source: project/charts/fabrique/charts/contrib/charts/site/templates/deployment.yaml
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/depname.full: project.fabrique.contrib.site.deployment.site
kontinuous/depname.chartResource: site.deployment.site
kontinuous/depname.chartName: site
kontinuous/depname.chartPath: project.fabrique.contrib.site
kontinuous/depname.resourcePath: deployment.site
kontinuous/depname.resourceName: site
kontinuous/depname.chartNameTopFull: site
kontinuous/depname.chartNameTop: site
kontinuous/plugin.log: \\"false\\"
reloader.stakater.com/auto: \\"true\\"
spec:
replicas: 1
selector:
matchLabels:
component: site
strategy:
type: RollingUpdate
template:
metadata:
labels:
component: site
application: test-static-app
namespace: test-static-app-feature-branch-1
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-feature-branch-1
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: deployment-site-kmsczrbj
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
annotations:
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
podAffinityTerm:
labelSelector:
matchExpressions:
- key: namespace
operator: In
values:
- test-static-app-feature-branch-1
- key: component
operator: In
values:
- site
topologyKey: kubernetes.io/hostname
containers:
- image: harbor.fabrique.social.gouv.fr/test-static-app/app:sha-ffac537e6cbbf934b08745a378932722df287a53
name: app
ports:
- containerPort: 8080
name: http
livenessProbe:
failureThreshold: 15
httpGet:
path: /live
port: 8080
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
readinessProbe:
failureThreshold: 15
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 1
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
startupProbe:
failureThreshold: 12
httpGet:
path: /live
port: 8080
periodSeconds: 5
lifecycle:
preStop:
exec:
command:
- /pre-stop.sh
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 41m
memory: 121Mi
---
apiVersion: v1
kind: Service
metadata:
labels:
component: site
application: test-static-app
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-feature-branch-1
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: service-site-684o81sg
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
name: site
namespace: test-static-app-feature-branch-1
annotations:
kontinuous/chartPath: project.fabrique.contrib.site
kontinuous/source: project/charts/fabrique/charts/contrib/charts/site/templates/service.yaml
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
component: site
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kontinuous/chartPath: project.fabrique.contrib.site
kontinuous/source: project/charts/fabrique/charts/contrib/charts/site/templates/ingress.yaml
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
labels:
component: site
application: test-static-app
kontinuous/deployment: test-static-app-feature-branch-1-ffac537e6cbbf934b087-27at1928
kontinuous/deployment.env: test-static-app-feature-branch-1
kontinuous/ref: feature-branch-1
kontinuous/gitSha: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/appVersion: ffac537e6cbbf934b08745a378932722df287a53
kontinuous/resourceName: ingress-site-ni9q5ueo
app.kubernetes.io/manifest-managed-by: kontinuous
app.kubernetes.io/manifest-created-by: kontinuous
name: site
namespace: test-static-app-feature-branch-1
spec:
rules:
- host: site-test-static-app-feature-branch-1.dev.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: site
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- site-test-static-app-feature-branch-1.dev.fabrique.social.gouv.fr
secretName: wildcard-crt
"
`;
3 changes: 3 additions & 0 deletions packages/kontinuous/tests/samples/static-app/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dependencies:
fabrique:
import: socialgouv/kontinuous/plugins/fabrique
2 changes: 2 additions & 0 deletions packages/kontinuous/tests/samples/static-app/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
site:
~chart: static-app
4 changes: 4 additions & 0 deletions plugins/contrib/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ dependencies:
repository: file://./charts/app
version: 1.164.11
condition: app.enabled
- name: static-app
repository: file://./charts/static-app
version: 1.164.0
condition: static-app.enabled
- name: daemon
repository: file://./charts/daemon
version: 1.164.11
Expand Down
3 changes: 3 additions & 0 deletions plugins/contrib/charts/static-app/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: v2
name: static-app
version: 1.164.0
Loading
Loading