Skip to content

Commit

Permalink
Update helm chart and fix docker build (#154)
Browse files Browse the repository at this point in the history
* Fix tag when building the image

* Update chart based on the latest image

* Update CRD

* Update example secret

* Update ArgoCD

* Update variables

* Fix argocd address

* Fix leader election permissions

* Update README

* Install ArgoCD
  • Loading branch information
maruina authored Jan 19, 2022
1 parent aa45abb commit 249631d
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 65 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/lint-test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
lint-test-chart:
runs-on: ubuntu-latest
env:
ARGOCD_VERSION: v1.8.6
ARGOCD_VERSION: v2.2.3
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down Expand Up @@ -44,14 +44,14 @@ jobs:
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Install ArgoCD Application CRD
run: kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/$ARGOCD_VERSION/manifests/crds/application-crd.yaml
- name: Install ArgoCD
run: |
kubectl create namespace argocd
kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-cd/$ARGOCD_VERSION/manifests/install.yaml -n argocd
if: steps.list-changed.outputs.changed == 'true'

- name: Install external secret for chart testing
run: |
kubectl create namespace argocd
kubectl apply -f charts/applicationset-progressive-sync/ci/external-secret.yaml
run: kubectl apply -f charts/applicationset-progressive-sync/ci/external-secret.yaml
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ jobs:
# list of Docker images to use as base name for tags
images: |
ghcr.io/skyscanner/applicationset-progressive-sync
flavor: |
latest=auto
# generate Docker tags based on the following events/attributes
tags: |
type=ref,event=tag
type=sha
type=sha,format=long
type=ref,event=branch
type=semver,pattern={{raw}}
- name: Login to GitHub Packages
uses: docker/[email protected]
Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions charts/applicationset-progressive-sync/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ 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.5.2-prealpha
version: 0.6.0-prealpha

# 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.
# It is recommended to use it with quotes.
appVersion: "v0.5.0-prealpha"
appVersion: "sha-f70b92b"

keywords:
- argoproj
Expand Down
16 changes: 5 additions & 11 deletions charts/applicationset-progressive-sync/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# applicationset-progressive-sync

![Version: 0.5.0-prealpha](https://img.shields.io/badge/Version-0.5.0--prealpha-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.4.0-prealpha](https://img.shields.io/badge/AppVersion-v0.4.0--prealpha-informational?style=flat-square)
![Version: 0.6.0-prealpha](https://img.shields.io/badge/Version-0.6.0--prealpha-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: sha-f70b92b](https://img.shields.io/badge/AppVersion-sha--f70b92b-informational?style=flat-square)

A Helm chart to install the applicationset-progressive-sync controller.

Expand All @@ -14,24 +14,19 @@ To install the chart with the release name `my-release`:
helm repo add applicationset-progressive-sync https://skyscanner.github.io/applicationset-progressive-sync/
helm upgrade -i my-release applicationset-progressive-sync/applicationset-progressive-sync --namespace argocd
```

### Helm v2 Compatibility

Users of Helm v2 should use `--set installCRDs=true` to install the CRDs.

## Values

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| args.argoNamespace | string | `"argocd"` | The namespace where ArgoCD and the ApplicationSet controller are deployed to. |
| args.enableLeaderElection | bool | `false` | Enable leader election for controller manager. |
| args.metricsAddr | string | `":8080"` | The address the metric endpoint binds to. |
| config | object | `{"argoCDAuthToken":"example-token","argoCDInsecure":"true","argoCDServerAddr":"argocd-server"}` | Config options |
| args.leaderElect | bool | `false` | Enable leader election for controller manager. |
| args.metricsBindAddress | string | `":8080"` | The address the metric endpoint binds to. |
| config | object | `{"argoCDAuthToken":"example-token","argoCDInsecure":"true","argoCDPlaintext":"false","argoCDServerAddr":"argocd-server"}` | Config options |
| config.argoCDAuthToken | string | `"example-token"` | ArgoCD token |
| config.argoCDInsecure | string | `"true"` | Allow insecure connection with ArgoCD server |
| config.argoCDPlaintext | string | `"false"` | Allow http connection with ArgoCD server |
| config.argoCDServerAddr | string | `"argocd-server"` | ArgoCD server service address |
| configSecret | object | `{"annotations":{},"name":""}` | configSecret is a secret object which supplies tokens, configs, etc. |
| configSecret.name | string | `""` | If this value is not provided, a secret will be generated |
Expand All @@ -40,7 +35,6 @@ Users of Helm v2 should use `--set installCRDs=true` to install the CRDs.
| image.repository | string | `"ghcr.io/skyscanner/applicationset-progressive-sync"` | |
| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. |
| imagePullSecrets | list | `[]` | |
| installCRDs | bool | `false` | |
| nameOverride | string | `""` | |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
Expand Down
5 changes: 0 additions & 5 deletions charts/applicationset-progressive-sync/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ To install the chart with the release name `my-release`:
helm repo add {{ template "chart.name" . }} https://skyscanner.github.io/applicationset-progressive-sync/
helm upgrade -i my-release {{ template "chart.name" . }}/{{ template "chart.name" . }} --namespace argocd
```

### Helm v2 Compatibility

Users of Helm v2 should use `--set installCRDs=true` to install the CRDs.

## Values

{{ template "chart.valuesSection" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ metadata:
type: Opaque
data:
ARGOCD_AUTH_TOKEN: dG9rZW4=
ARGOCD_SERVER_ADDR: YXJnby1jZC1hcmdvY2Qtc2VydmVy
ARGOCD_SERVER_ADDR: YXJnb2NkLXNlcnZlci5hcmdvY2Q6NDQz
ARGOCD_INSECURE: dHJ1ZQ==
ARGOCD_PLAINTEXT: ZmFsc2U=
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
replicaCount: 3
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,14 @@ spec:
spec:
description: ProgressiveSyncSpec defines the desired state of ProgressiveSync
properties:
sourceRef:
description: SourceRef defines the resource, example an ApplicationSet,
which owns ArgoCD Applications
appSetRef:
description: AppSetRef point to the ApplicationSet which owns ArgoCD
Applications
properties:
apiGroup:
description: APIGroup is the group for the resource being referenced.
If APIGroup is not specified, the specified Kind must be in
the core API group. For any other third-party types, APIGroup
is required.
type: string
kind:
description: Kind is the type of resource being referenced
type: string
name:
description: Name is the name of resource being referenced
description: Name of the referent
type: string
required:
- kind
- name
type: object
stages:
Expand Down Expand Up @@ -137,13 +127,13 @@ spec:
type: object
type: array
required:
- sourceRef
- appSetRef
type: object
status:
description: ProgressiveSyncStatus defines the observed state of ProgressiveSync
properties:
conditions:
description: Conditions holds the condition for the ProgressiveSync.
description: Conditions holds the condition for the ProgressiveSync
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
Expand Down Expand Up @@ -213,14 +203,14 @@ spec:
type: object
type: array
lastSyncedStage:
description: LastSyncedStage is the name of the last synced stage.
description: LastSyncedStage is the name of the last synced stage
type: string
lastSyncedStageStatus:
description: LastSyncedStageStatus is the status of the last synced
stage.
stage
type: string
observedGeneration:
description: ObservedGeneration is the last observed generation.
description: ObservedGeneration is the last observed generation
format: int64
type: integer
type: object
Expand Down
6 changes: 0 additions & 6 deletions charts/applicationset-progressive-sync/templates/crds.yaml

This file was deleted.

11 changes: 5 additions & 6 deletions charts/applicationset-progressive-sync/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,21 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
command:
- /manager
- --metrics-addr={{ .Values.args.metricsAddr }}
- --metrics-bind-address={{ .Values.args.metricsBindAddress }}
{{- if or (gt ( .Values.replicaCount | int64) 1) .Values.args.enableLeaderElection }}
- --enable-leader-election=true
- --leader-elect=true
{{- end }}
- --ctrl-namespace={{ .Release.Namespace }}
- --argo-namespace={{ .Values.args.argoNamespace }}
- --namespace={{ .Release.Namespace }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http-metrics
containerPort: {{ (split ":" .Values.args.metricsAddr)._1 }}
containerPort: {{ (split ":" .Values.args.metricsBindAddress)._1 }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /etc/prcconfig
- mountPath: /etc/applicationset-progressive-sync
{{- if .Values.configSecret.name }}
name: {{ .Values.configSecret.name }}
{{- else }}
Expand Down
12 changes: 12 additions & 0 deletions charts/applicationset-progressive-sync/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ rules:
- patch
- update
- watch
- apiGroups:
- "coordination.k8s.io"
resources:
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
Expand Down
8 changes: 2 additions & 6 deletions charts/applicationset-progressive-sync/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

replicaCount: 1

installCRDs: false

image:
repository: ghcr.io/skyscanner/applicationset-progressive-sync
pullPolicy: IfNotPresent
Expand All @@ -14,11 +12,9 @@ image:

args:
# -- The address the metric endpoint binds to.
metricsAddr: :8080
metricsBindAddress: :8080
# -- Enable leader election for controller manager.
enableLeaderElection: false
# -- The namespace where ArgoCD and the ApplicationSet controller are deployed to.
argoNamespace: argocd
leaderElect: false

imagePullSecrets: []
nameOverride: ""
Expand Down

0 comments on commit 249631d

Please sign in to comment.