Skip to content

Commit

Permalink
feat(localbuild): scale down dex and notifications pods for argo cd (#…
Browse files Browse the repository at this point in the history
…122)

* feat(hack): add script to generate install.yaml for argo cd
* fix(hack): use tagged base for argo cd
* feat(argocd): scale notifications controller to zero
* feat(argocd): scale dex server to zero
* fix: make script executable
* chore: point to how to generate file

Signed-off-by: Nicholas Morey <[email protected]>
  • Loading branch information
morey-tech authored Dec 18, 2023
1 parent 243ba5f commit ad688d4
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 37 deletions.
6 changes: 6 additions & 0 deletions hack/argo-cd/dex-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-dex-server
spec:
replicas: 0
5 changes: 5 additions & 0 deletions hack/argo-cd/generate-manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
INSTALL_YAML="pkg/controllers/localbuild/resources/argo/install.yaml"

echo "# UCP ARGO INSTALL RESOURCES" > ${INSTALL_YAML}
echo "# This file is auto-generated with 'hack/argo-cd/generate-manifests.sh'." >> ${INSTALL_YAML}
kustomize build ./hack/argo-cd/ >> ${INSTALL_YAML}
8 changes: 8 additions & 0 deletions hack/argo-cd/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/argoproj/argo-cd/v2.8.7/manifests/install.yaml

patches:
- path: dex-server.yaml
- path: notifications-controller.yaml
6 changes: 6 additions & 0 deletions hack/argo-cd/notifications-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: argocd-notifications-controller
spec:
replicas: 0
87 changes: 50 additions & 37 deletions pkg/controllers/localbuild/resources/argo/install.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# UCP ARGO INSTALL RESOURCES
# This is an auto-generated file. DO NOT EDIT
# This file is auto-generated with 'hack/argo-cd/generate-manifests.sh'
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
Expand Down Expand Up @@ -788,18 +788,16 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name. This must be set if Server is
not set.
cluster by its symbolic name
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is not
set.
description: Server specifies the URL of the target cluster and
must be set to the Kubernetes control plane API
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -3797,8 +3795,7 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the
target cluster by its symbolic name. This must be set
if Server is not set.
target cluster by its symbolic name
type: string
namespace:
description: Namespace specifies the target namespace
Expand All @@ -3807,9 +3804,8 @@ spec:
not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name
is not set.
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
type: string
type: object
ignoreDifferences:
Expand Down Expand Up @@ -10045,8 +10041,6 @@ spec:
type: string
group:
type: string
includeSharedProjects:
type: boolean
includeSubgroups:
type: boolean
insecure:
Expand All @@ -10061,8 +10055,6 @@ spec:
- key
- secretName
type: object
topic:
type: string
required:
- group
type: object
Expand Down Expand Up @@ -14528,8 +14520,6 @@ spec:
type: string
group:
type: string
includeSharedProjects:
type: boolean
includeSubgroups:
type: boolean
insecure:
Expand All @@ -14544,8 +14534,6 @@ spec:
- key
- secretName
type: object
topic:
type: string
required:
- group
type: object
Expand Down Expand Up @@ -16940,8 +16928,6 @@ spec:
type: string
group:
type: string
includeSharedProjects:
type: boolean
includeSubgroups:
type: boolean
insecure:
Expand All @@ -16956,8 +16942,6 @@ spec:
- key
- secretName
type: object
topic:
type: string
required:
- group
type: object
Expand Down Expand Up @@ -18172,18 +18156,16 @@ spec:
properties:
name:
description: Name is an alternate way of specifying the target
cluster by its symbolic name. This must be set if Server is
not set.
cluster by its symbolic name
type: string
namespace:
description: Namespace specifies the target namespace for the
application's resources. The namespace will only be set for
namespace-scoped resources that have not set a value for .metadata.namespace
type: string
server:
description: Server specifies the URL of the target cluster's
Kubernetes control plane API. This must be set if Name is
not set.
description: Server specifies the URL of the target cluster
and must be set to the Kubernetes control plane API
type: string
type: object
type: array
Expand Down Expand Up @@ -18741,6 +18723,18 @@ rules:
- get
- list
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- apiGroups:
- argoproj.io
resources:
- workflows
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
Expand Down Expand Up @@ -18980,8 +18974,7 @@ metadata:
name: argocd-dex-server
spec:
ports:
- appProtocol: TCP
name: http
- name: http
port: 5556
protocol: TCP
targetPort: 5556
Expand Down Expand Up @@ -19238,7 +19231,7 @@ spec:
key: applicationsetcontroller.allowed.scm.providers
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
name: argocd-applicationset-controller
ports:
Expand Down Expand Up @@ -19304,6 +19297,7 @@ metadata:
app.kubernetes.io/part-of: argocd
name: argocd-dex-server
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: argocd-dex-server
Expand Down Expand Up @@ -19361,7 +19355,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /shared/argocd-dex
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
name: copyutil
securityContext:
Expand Down Expand Up @@ -19405,6 +19399,7 @@ metadata:
app.kubernetes.io/part-of: argocd
name: argocd-notifications-controller
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: argocd-notifications-controller
Expand All @@ -19431,7 +19426,13 @@ spec:
key: notificationscontroller.log.level
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:latest
- name: ARGOCD_APPLICATION_NAMESPACES
valueFrom:
configMapKeyRef:
key: application.namespaces
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
livenessProbe:
tcpSocket:
Expand Down Expand Up @@ -19689,6 +19690,18 @@ spec:
key: reposerver.streamed.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_REPO_SERVER_DISABLE_HELM_MANIFEST_MAX_EXTRACTED_SIZE
valueFrom:
configMapKeyRef:
key: reposerver.disable.helm.manifest.max.extracted.size
name: argocd-cmd-params-cm
optional: true
- name: ARGOCD_GIT_MODULES_ENABLED
valueFrom:
configMapKeyRef:
Expand All @@ -19701,7 +19714,7 @@ spec:
value: /helm-working-dir
- name: HELM_DATA_HOME
value: /helm-working-dir
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down Expand Up @@ -19753,7 +19766,7 @@ spec:
- -n
- /usr/local/bin/argocd
- /var/run/argocd/argocd-cmp-server
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
name: copyutil
securityContext:
allowPrivilegeEscalation: false
Expand Down Expand Up @@ -20040,7 +20053,7 @@ spec:
key: server.enable.proxy.extension
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
livenessProbe:
httpGet:
Expand Down Expand Up @@ -20286,7 +20299,7 @@ spec:
key: controller.kubectl.parallelism.limit
name: argocd-cmd-params-cm
optional: true
image: quay.io/argoproj/argocd:latest
image: quay.io/argoproj/argocd:v2.8.7
imagePullPolicy: Always
name: argocd-application-controller
ports:
Expand Down

0 comments on commit ad688d4

Please sign in to comment.