Skip to content

feat(KFLUXVNGD-332): deploy smee-sidecar in production #6942

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 64 additions & 2 deletions components/smee-client/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ spec:
labels:
app: gosmee-client
spec:
volumes:
- name: shared-health
emptyDir: {}
containers:
- image: "ghcr.io/chmouel/gosmee:v0.20.2"
- image: "ghcr.io/chmouel/gosmee:v0.26.1"
imagePullPolicy: Always
name: gosmee
args:
- "client"
- TBA
- "http://pipelines-as-code-controller.openshift-pipelines:8080"
- "http://localhost:8080"
volumeMounts:
- name: shared-health
mountPath: /shared
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
resources:
Expand All @@ -31,3 +43,53 @@ spec:
requests:
cpu: 1
memory: 750Mi
livenessProbe:
exec:
command:
- /shared/check-smee-health.sh
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 25
failureThreshold: 4
- name: health-check-sidecar
image: quay.io/konflux-ci/smee-sidecar:to-be-replaced
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
- name: metrics
containerPort: 9100
volumeMounts:
- name: shared-health
mountPath: /shared
env:
- name: DOWNSTREAM_SERVICE_URL
value: "http://pipelines-as-code-controller.openshift-pipelines:8080"
- name: SMEE_CHANNEL_URL
value: "TBA"
- name: HEALTH_CHECK_TIMEOUT_SECONDS
value: "20"
livenessProbe:
exec:
command:
- /shared/check-sidecar-health.sh
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 25
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
9 changes: 9 additions & 0 deletions components/smee-client/production/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base

images:
- name: quay.io/konflux-ci/smee-sidecar
newName: quay.io/konflux-ci/smee-sidecar
newTag: 5015d8c0daa445a106b3c1124d0f4e145fff7a16
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../base
patches:
- path: sever-url-patch.yaml
target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
- op: replace
path: /spec/template/spec/containers/0/args/1
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook14
- op: replace
path: /spec/template/spec/containers/1/env/1/value
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook14
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../base
patches:
- path: sever-url-patch.yaml
target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
- op: replace
path: /spec/template/spec/containers/0/args/1
value: "https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook15"
- op: replace
path: /spec/template/spec/containers/1/env/1/value
value: "https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook15"
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../base
patches:
- path: sever-url-patch.yaml
target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
- op: replace
path: /spec/template/spec/containers/0/args/1
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook12
- op: replace
path: /spec/template/spec/containers/1/env/1/value
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook12
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../base
patches:
- path: sever-url-patch.yaml
target:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
- op: replace
path: /spec/template/spec/containers/0/args/1
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook13
- op: replace
path: /spec/template/spec/containers/1/env/1/value
value: https://smee-smee.apps.stone-prd-host1.wdlc.p1.openshiftapps.com/redhathook13
95 changes: 0 additions & 95 deletions components/smee-client/staging/deployment.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions components/smee-client/staging/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# TODO: change to point to ../base when deploying sidecar to production
- deployment.yaml
- ../base

images:
- name: quay.io/konflux-ci/smee-sidecar
Expand Down
97 changes: 90 additions & 7 deletions components/smee/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@ spec:
labels:
app: gosmee
spec:
volumes:
- name: shared-health
emptyDir: {}
containers:
- image: "ghcr.io/chmouel/gosmee:v0.20.2"
- image: "ghcr.io/chmouel/gosmee:v0.26.1"
imagePullPolicy: Always
name: gosmee
args: ["server", "--address", "0.0.0.0"]
ports:
- name: "gosmee-http"
containerPort: 3333
protocol: TCP
volumeMounts:
- name: shared-health
mountPath: /shared
livenessProbe:
tcpSocket:
port: 3333
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 3
exec:
command:
- /shared/check-smee-health.sh
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 25
failureThreshold: 12 # High-enough not to fail if other container crashlooping
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
Expand All @@ -41,3 +48,79 @@ spec:
requests:
cpu: 1
memory: 256Mi
- image: "ghcr.io/chmouel/gosmee:v0.26.1"
imagePullPolicy: Always
name: gosmee-liveness-probe-client
args:
- "client"
- "http://localhost:3333/smeesvrmonit"
- "http://localhost:8080"
volumeMounts:
- name: shared-health
mountPath: /shared
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi
livenessProbe:
exec:
command:
- /shared/check-smee-health.sh
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 25
failureThreshold: 12 # High-enough not to fail if other container crashlooping
- name: health-check-sidecar
image: quay.io/konflux-ci/smee-sidecar:to-be-replaced
imagePullPolicy: Always
ports:
- name: http
containerPort: 8080
- name: metrics
containerPort: 9100
volumeMounts:
- name: shared-health
mountPath: /shared
env:
- name: DOWNSTREAM_SERVICE_URL
value: "http://no.smee.svc.cluster.local:8080"
- name: SMEE_CHANNEL_URL
value: "http://localhost:3333/smeesvrmonit"
- name: HEALTH_CHECK_TIMEOUT_SECONDS
value: "20"
livenessProbe:
exec:
command:
- /shared/check-sidecar-health.sh
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 25
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- "ALL"
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
6 changes: 6 additions & 0 deletions components/smee/production/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../base

images:
- name: quay.io/konflux-ci/smee-sidecar
newName: quay.io/konflux-ci/smee-sidecar
newTag: 5015d8c0daa445a106b3c1124d0f4e145fff7a16

patches:
- path: ip-allow-list.yaml
target:
Expand Down
Loading