Skip to content

Commit

Permalink
Revert "moved apps to bl45p-apps"
Browse files Browse the repository at this point in the history
This reverts commit cecf03f.
  • Loading branch information
gilesknap committed Jul 12, 2024
1 parent cecf03f commit 9017a29
Show file tree
Hide file tree
Showing 5 changed files with 380 additions and 0 deletions.
21 changes: 21 additions & 0 deletions apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: bl45p
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: bl45p
destination:
server: argus
namespace: bl45p
source:
path: apps
repoURL: https://github.com/epics-containers/bl45p.git
targetRevision: main
helm:
version: v3
syncPolicy:
automated:
prune: true
selfHeal: true
234 changes: 234 additions & 0 deletions apps/.manifest.spec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook
# You'll usually want to add your resources to the argocd namespace.
namespace: argocd
# Add this finalizer ONLY if you want these to cascade delete.
finalizers:
# The default behaviour is foreground cascading deletion
- resources-finalizer.argocd.argoproj.io
# Alternatively, you can use background cascading deletion
# - resources-finalizer.argocd.argoproj.io/background
# Add labels to your application object.
labels:
name: guestbook
spec:
# The project the application belongs to.
project: default

# Source of the application manifests
source:
repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
targetRevision: HEAD # For Helm, this refers to the chart version.
path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.

# helm specific config
chart: chart-name # Set this when pulling directly from a Helm repo. DO NOT set for git-hosted Helm charts.
helm:
passCredentials: false # If true then adds --pass-credentials to Helm commands to pass credentials to all domains
# Extra parameters to set (same as setting through values.yaml, but these take precedence)
parameters:
- name: "nginx-ingress.controller.service.annotations.external-dns\\.alpha\\.kubernetes\\.io/hostname"
value: mydomain.example.com
- name: "ingress.annotations.kubernetes\\.io/tls-acme"
value: "true"
forceString: true # ensures that value is treated as a string

# Use the contents of files as parameters (uses Helm's --set-file)
fileParameters:
- name: config
path: files/config.json

# Release name override (defaults to application name)
releaseName: guestbook

# Helm values files for overriding values in the helm chart
# The path is relative to the spec.source.path directory defined above
valueFiles:
- values-prod.yaml

# Ignore locally missing valueFiles when installing Helm chart. Defaults to false
ignoreMissingValueFiles: false

# Values file as block file. Prefer to use valuesObject if possible (see below)
values: |
ingress:
enabled: true
path: /
hosts:
- mydomain.example.com
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
labels: {}
tls:
- secretName: mydomain-tls
hosts:
- mydomain.example.com
# Values file as block file. This takes precedence over values
valuesObject:
ingress:
enabled: true
path: /
hosts:
- mydomain.example.com
annotations:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
labels: {}
tls:
- secretName: mydomain-tls
hosts:
- mydomain.example.com

# Skip custom resource definition installation if chart contains custom resource definitions. Defaults to false
skipCrds: false

# Optional Helm version to template with. If omitted it will fall back to look at the 'apiVersion' in Chart.yaml
# and decide which Helm binary to use automatically. This field can be either 'v2' or 'v3'.
version: v2

# kustomize specific config
kustomize:
# Optional kustomize version. Note: version must be configured in argocd-cm ConfigMap
version: v3.5.4
# Supported kustomize transformers. https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/
namePrefix: prod-
nameSuffix: -some-suffix
commonLabels:
foo: bar
commonAnnotations:
beep: boop-${ARGOCD_APP_REVISION}
# Toggle which enables/disables env variables substitution in commonAnnotations
commonAnnotationsEnvsubst: true
images:
- gcr.io/heptio-images/ks-guestbook-demo:0.2
- my-app=gcr.io/my-repo/my-app:0.1
namespace: custom-namespace
replicas:
- name: kustomize-guestbook-ui
count: 4

# directory
directory:
recurse: true
jsonnet:
# A list of Jsonnet External Variables
extVars:
- name: foo
value: bar
# You can use "code" to determine if the value is either string (false, the default) or Jsonnet code (if code is true).
- code: true
name: baz
value: "true"
# A list of Jsonnet Top-level Arguments
tlas:
- code: false
name: foo
value: bar
# Exclude contains a glob pattern to match paths against that should be explicitly excluded from being used during
# manifest generation. This takes precedence over the `include` field.
# To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{config.yaml,env-use2/*}'
exclude: 'config.yaml'
# Include contains a glob pattern to match paths against that should be explicitly included during manifest
# generation. If this field is set, only matching manifests will be included.
# To match multiple patterns, wrap the patterns in {} and separate them with commas. For example: '{*.yml,*.yaml}'
include: '*.yaml'

# plugin specific config
plugin:
# If the plugin is defined as a sidecar and name is not passed, the plugin will be automatically matched with the
# Application according to the plugin's discovery rules.
name: mypluginname
# environment variables passed to the plugin
env:
- name: FOO
value: bar
# Plugin parameters are new in v2.5.
parameters:
- name: string-param
string: example-string
- name: array-param
array: [item1, item2]
- name: map-param
map:
param-name: param-value

# Sources field specifies the list of sources for the application
sources:
- repoURL: https://github.com/argoproj/argocd-example-apps.git # Can point to either a Helm chart repo or a git repo.
targetRevision: HEAD # For Helm, this refers to the chart version.
path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git.
ref: my-repo # For Helm, acts as a reference to this source for fetching values files from this source. Has no meaning when under `source` field

# Destination cluster and namespace to deploy the application
destination:
# cluster API URL
server: https://kubernetes.default.svc
# or cluster name
# name: in-cluster
# The namespace will only be set for namespace-scoped resources that have not set a value for .metadata.namespace
namespace: guestbook

# Extra information to show in the Argo CD Application details tab
info:
- name: 'Example:'
value: 'https://example.com'

# Sync policy
syncPolicy:
automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
selfHeal: true # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
syncOptions: # Sync options which modifies sync behavior
- Validate=false # disables resource validation (equivalent to 'kubectl apply --validate=false') ( true by default ).
- CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
- PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
- PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
- RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
- ApplyOutOfSyncOnly=true # Only sync out-of-sync resources, rather than applying every object in the application
managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
labels: # The labels to set on the application namespace
any: label
you: like
annotations: # The annotations to set on the application namespace
the: same
applies: for
annotations: on-the-namespace

# The retry feature is available since v1.7
retry:
limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
backoff:
duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
factor: 2 # a factor to multiply the base duration after each failed retry
maxDuration: 3m # the maximum amount of time allowed for the backoff strategy

# Will ignore differences between live and desired states during the diff. Note that these configurations are not
# used during the sync process unless the `RespectIgnoreDifferences=true` sync option is enabled.
ignoreDifferences:
# for the specified json pointers
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
- kind: ConfigMap
jqPathExpressions:
- '.data["config.yaml"].auth'
# for the specified managedFields managers
- group: "*"
kind: "*"
managedFieldsManagers:
- kube-controller-manager
# Name and namespace are optional. If specified, they must match exactly, these are not glob patterns.
name: my-deployment
namespace: my-namespace

# RevisionHistoryLimit limits the number of items kept in the application's revision history, which is used for
# informational purposes as well as for rollbacks to previous versions. This should only be changed in exceptional
# circumstances. Setting to zero will store no history. This will reduce storage used. Increasing will increase the
# space used to store the history, so we do not recommend increasing it.
revisionHistoryLimit: 10
23 changes: 23 additions & 0 deletions apps/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: applications
description: Applications

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "1.0"
52 changes: 52 additions & 0 deletions apps/templates/all_apps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{- $currentScope := . -}}
{{- range $service, $settings := .Values.services -}}
# if there are no settings, make settings just {enabled: true)
{{- $settings := default (dict "enabled" true) $settings -}}
# set removed to true to take this application off of the cluster
{{ if ne $settings.removed true }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: {{ $service }}
namespace: {{ $currentScope.Release.Namespace }}
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: {{ default $currentScope.Release.Namespace $currentScope.Values.project }}
destination:
namespace: {{ $currentScope.Values.destination.namespace }}
name: {{ $currentScope.Values.destination.name }}
source:
repoURL: {{ default $currentScope.Values.source.repoURL $settings.repoURL }}
path: services/{{ default $service $settings.folder }}
targetRevision: {{ default $currentScope.Values.source.targetRevision $settings.targetRevision }}
helm:
version: v3
valueFiles:
- ../beamline_values.yaml
- values.yaml
{{- range $settings.files }}
fileParameters:
- name: global.files.{{ . | replace "." "_dot_" }}
path: config/{{ . }}
{{- end }}
{{- if eq $settings.enabled false }}
parameters:
- name: global.enabled
value: {{ $settings.enabled | quote }}
{{- end -}}
{{ if $settings.values -}}
values: |
{{ toYaml $settings.values | indent 8 }}
{{- end }}
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
# don't restart pods unless there has been a change
- ApplyOutOfSyncOnly=true
- RespectIgnoreDifferences=true
---
{{ end }}
{{- end -}}
50 changes: 50 additions & 0 deletions apps/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
project: bl45p
destination:
name: pollux
namespace: bl45p
source:
repoURL: https://github.com/epics-containers/bl45p.git
targetRevision: main

# list of services to deploy. Each item is of the form:
# - service: service name as it appears in K8S (statefulset/deployment name)
# enabled: set to false to turn off an IOC
# targetRevision: optional override for targetRevision above
# repoURL: optional override for helm chart repo or git repo
# chart: chart name if above is a helm repo (needs a token so let's not)
# folder: a subfolder of /services, defaults /services/service_name
# used this for shared, templated charts and add some values to customize
# values: A dict of key:value to pass as parameters to the target chart

services:
# shared epics services ######################################################
epics-pvcs:
epics-opis:

# daq services ###############################################################
daq-rabbitmq:
# this service always restarts if you don't pin it (must have a random seed)
targetRevision: 2024.7.5
daq-blueapi:
daq-nexus:

# epics iocs #################################################################

# example of epics templating in a local shared folder
bl45p-ea-dcam-01:
enabled: false
folder: dls-aravis
values:
P: BL45P-EA-MAP-01
ID: bl45p-ea-detector-01

bl45p-ea-dcam-02:
folder: dls-aravis
values:
P: BL45P-EA-DIFF-01
ID: bl45p-ea-detector-02


bl45p-mo-panda-01:
bl45p-mo-panda-02:
bl45p-mo-brick-01:

0 comments on commit 9017a29

Please sign in to comment.