Commit graph

10481 commits

Author SHA1 Message Date
Jesse Suen
8fa46b02b0
Remove SyncPolicy (issue #190) 2018-05-15 03:05:34 -07:00
Jesse Suen
92c481330d
App creation was not defaulting to server and namespace defined in app.yaml 2018-05-15 01:35:43 -07:00
Jesse Suen
2664db3e40
Refactor application controller sync/apply loop (#202)
* Refactor application controller sync/apply loop
* always run kubectl apply --dry-run before the actual apply
* remove incorrect logic skip apply if comparator reported Synced
* rename status to phase
* distinguish failures from errors
* consolidate fields between OperationState and SyncOperationResult
* Disable migration code which referenced removed fields
2018-05-15 00:36:11 -07:00
Andrew Merenbach
6b554e5f4e
Add 0.3.0 to 0.4.0 migration utility (#186)
* Add temp migrate utility

* Fix errors, separate out migrate for now

* Update script with suggestions from @jessesuen

* Check for localhost, server address now; print with log, not fmt

* Add more log lines, standardize output, fix args

* Improve feedback, thanks @alexmt

* Rename migration script, thanks @jessesuen

* Don't run UpdateSpec unless a change has occurred

* Move migrate => hack/migrate, thanks @jessesuen
2018-05-14 14:35:01 -07:00
Alexander Matyushentsev
2bc0dff135
Issue #146 - Render health status information in 'app list' and 'app get' commands (#198) 2018-05-14 13:21:06 -07:00
Jesse Suen
c61795f71a
Add 'database' library for CRUD operations against repos and clusters. Redact sensitive information (#196) 2018-05-14 11:36:08 -07:00
Alexander Matyushentsev
9e3727a037 Issue #189 - switch to Spec.Destination.Server/Namespace fields 2018-05-14 10:53:09 -07:00
Alexander Matyushentsev
6721909257 Issue #118 - Provide return URL during sso authentication 2018-05-14 10:47:03 -07:00
Alexander Matyushentsev
26ffea9bed Issue #191 - ArgoCD UI s/rollback/history/ and s/deploy/sync/ 2018-05-14 10:15:02 -07:00
Alexander Matyushentsev
d8fb318253 Render health status icon on application details page 2018-05-14 10:11:46 -07:00
Jesse Suen
a8a7491bf0
Handle potential panic when argo install settings run against an empty configmap 2018-05-11 18:47:45 -07:00
Alexander Matyushentsev
d1c7c4fcaf
Issue #187 - implement argo settings install command (#193) 2018-05-11 11:50:53 -07:00
Alexander Matyushentsev
3dbbcf8918
Move sync logic to contoller (#180)
* Issue #119 - Move sync logic to contoller

* Implement app compare/sycn e2e test

* Fix panic in kube ApplyResource method

* Apply reviewer notes: add separate rollback operation instead of reusing sync for sync and rollback
2018-05-11 11:50:32 -07:00
Jesse Suen
0cfd1ad05f
Update feature list with SSO and Webhook integration 2018-05-10 17:51:51 -07:00
Jesse Suen
bfa4e233b7
cli will look to spec.destination.server and namespace when displaying apps 2018-05-10 17:39:13 -07:00
Jesse Suen
dc662da3d6
Support OAuth2 login flow from CLI (resolves #172) (#181)
* Support OAuth2 login flow from CLI (resolves #172)
* Refactor SessionManager to handle local and OAuth2 logins.
* argo login will request permanent credentials after OAuth2 flow
* Implement proper OIDC app state nonce. Add explicit `--sso` flag to `argo login`
2018-05-10 15:43:58 -07:00
Jesse Suen
4107d2422b
Fix linting errors 2018-05-08 16:42:12 -07:00
Andrew Merenbach
b83eac5dc2
Make ApplicationSpec.Destination non-optional, non-pointer (#177)
* Make Destination a non-pointer field

* Rm nil checks for destination; update initialization

* Update codegen

* Rm ResolveServerNamespace function, thanks @jessesuen
2018-05-08 14:09:33 -07:00
Jesse Suen
bb51837c56
Do not delete namespace or CRD during uninstall unless explicitly stated (resolves #167) (#173) 2018-05-08 12:56:59 -07:00
Jesse Suen
5bbb4fe1a1
Cache kubernetes API resource discovery (resolves #170) (#176) 2018-05-08 12:56:15 -07:00
Andrew Merenbach
b5c20e9b46
Trim spaces server-side in GitHub usernames (#171) 2018-05-07 14:56:48 -07:00
Andrew Merenbach
1e1ab636e0
Don't fail when new app has same spec as old (#168) 2018-05-07 13:20:38 -07:00
Jesse Suen
7348553897
Improve CI build stability 2018-05-07 12:44:14 -07:00
Jesse Suen
5f65a5128a
Introduce caching layer to repo server to improve query response times (#165) 2018-05-07 11:31:00 -07:00
Alexander Matyushentsev
d9c12e7271
Issue #146 - ArgoCD applications should have a rolled up health status (#164)
* Issue #146 - ArgoCD applications should have a rolled up health status

* Apply reviewer notes: rename healthState to health; rename HealthState to HealthStatus
2018-05-07 08:38:25 -07:00
Jesse Suen
fb2d6b4aff
Refactor repo server and git client (#163)
* added a general purpose GetFile RPC and remove GetKsonnetApp RPC
* reposerver did not talk to kubernetes -- removed all k8s imports
* git client refactored to simply method signatures
2018-05-06 20:51:17 -07:00
Andrew Merenbach
3f4ec0ab22
Expand Git repo URL normalization (#162)
* Expand unit tests for Git functions

* Update tests for IsSSHUrl

* Add TODO

* Add EnsureSuffix tests

* Add EnsureSuffix function

* Lowercase repo name in secret name

* Expand normalization and related tests

* Add tests for EnsurePrefix

* Rm redundant strings.ToLower

* Update repository names to fix broken tests

* Expand tests some more to include missing .git suffix, thanks @jessesuen

* Add additional repository tests, thanks @jessesuen

* Fix typo in comment
2018-05-04 17:31:04 -07:00
Jesse Suen
ac938fe8a3
Add GitHub webhook handling to fast-track controller application reprocessing (#160)
* Add GitHub webhook handling to fast-track application controller reprocessing
* Add GitLab and Bitbucket webhook support. Add unit tests.
2018-05-04 17:01:57 -07:00
Alexander Matyushentsev
dc1e8796fb Disable authentication for settings service 2018-05-04 16:13:22 -07:00
Alexander Matyushentsev
8c5d59c60c
Issue #157 - If argocd token is expired server should return 401 instead of 500 (#158) 2018-05-04 09:48:46 -07:00
Alexander Matyushentsev
bb5dde23b8 SSO Login Button 2018-05-04 09:15:53 -07:00
Jesse Suen
13558b7ce8
Revert change to redact credentials since logic is reused by controller 2018-05-03 16:42:21 -07:00
Alexander Matyushentsev
3b2b3dacf5 Update version 2018-05-03 15:58:09 -07:00
Alexander Matyushentsev
1b2f89995c
Issue #155 - Application update failes due to concurrent access (#156) 2018-05-03 15:55:01 -07:00
Jesse Suen
0479fcdf82
Add settings endpoint so frontend can show/hide SSO login button. Rename config to settings (#153) 2018-05-03 11:18:44 -07:00
Andrew Merenbach
a04465466d
Add workflow for blue-green deployments (#148)
* Add prototype script and temp README

* Clean up code and support command-line args

* Flesh out logic more now

* Start workflow

* Update Blue-Green workflow

* Rm original example script

* Update comments

* Add argo parameters; use compact output for jq

* Fix some missing values, use workflow parameters

* Separate out necessary parameters/outputs

* Get bluegreen workflow working

* Mv bluegreen.yaml to workflows/, thanks @jessesuen

* Rm TODO statements
2018-05-03 09:52:46 -07:00
Jesse Suen
670921df90
SSO Support (#152)
This change implements SSO support.

dex is run as a sidecar to the ArgoCD API server, which fronts dex using a reverse proxy. The end result is that the ArgoCD acts as an OIDC provider serving under /api/dex. The login flow begins at /auth/login, which redirects to the Dex's OAuth2 consent page and ultimately directed to the IdP provider's login page, where they enter their credentials. After logging in, the OAuth2 redirect flows back to the client app, ultimately reaching /auth/callback, where the OIDC token claims are signed, and persisted in the users's cookie.

The dex configuration YAML is formulated during startup (through the argocd-util utility), with the configuration values taken from the argocd-cm configmap and the argocd-secret.

The build process was refactored to build argocd-util statically, so that it could be run inside off-the-shelf dex, which is built from alpine. Also, build speed was improved by expanding the default make targets in the Dockerfile, to avoid rebuilding each binary from scratch

Session management was refactored to use more bare-bones jwt library constructs, so we could reuse code from the user/password flow vs. OAuth2 flow.

* Initial SSO support. Run dex as sidecar. Generate dex config from ArgoCD cm and secret
* Sign and write SSO claims to JWT cookie during SSO login. Refactor session manager
* Build argo-util statically so it can run in dex sidecar. Redirect after SSO login
* Simplify app creation process to not require communication to dex gRPC server
2018-05-02 22:02:26 -07:00
Edward Lee
18f7e17d7a Added OWNERS file 2018-05-02 18:24:50 -07:00
Andrew Merenbach
a2aede0441
Redact sensitive repo/cluster information upon retrieval (#150)
* Redact sensitive cluster information upon retrieval

* Redact git username for now, too

* Revert "Redact git username for now, too"

This reverts commit d9e2eba37e.
2018-05-01 16:58:03 -07:00
Alexander Matyushentsev
1d876c7729 Fix compilation error 2018-05-01 11:09:13 -07:00
Alexander Matyushentsev
70465a0520
Issue #147 - Use patch to update recentDeployments field (#149) 2018-05-01 11:05:56 -07:00
Alexander Matyushentsev
3c9845719f
Issue #139 - Application sync should delete 'unexpected' resources (#144)
* Issue #139 - Application sync should delete 'unexpected' resources

* Issue #139 - Add --prune flag to app sync and rollback commands

* Apply reviewer notes: s/skipped/ignored/g; take pruned flag into consideration in dry mode
2018-05-01 10:32:46 -07:00
Alexander Matyushentsev
a36cc8946c
Issue #136 - Use custom formatter to get desired state of deployment and service (#145)
* Issue #136 - Use custom formatter to get desired state of deployment and service

* Remove unnecessary break, document default removals
2018-04-30 13:29:35 -07:00
Jesse Suen
9567b539d1 Improve comparator to fall back to looking up a resource by name 2018-04-30 12:03:20 -07:00
Jesse Suen
fdf9515de2 Refactor git library:
* store credentials in files (instead of encoded in URL) to prevent leakage during git errors
* fix issue where HEAD would not track updates from origin/HEAD (resolves #133)
* refactor git library to promote code reuse, and remove shell invocations
2018-04-30 11:01:40 -07:00
Jesse Suen
b320238487
ksonnet util was not locating a ksonnet app dir correctly 2018-04-28 02:57:03 -07:00
Jesse Suen
7872a60499
Update ksonnet to v0.10.1 2018-04-28 01:59:50 -07:00
Jesse Suen
5fea3846d1
Adding clusters should always go through argocd-manager service account creation 2018-04-28 01:27:40 -07:00
Jesse Suen
86a4e0baaa
RoleBindings do not need to specify service account namespace in subject 2018-04-28 01:26:46 -07:00
Alexander Matyushentsev
917f1df250
Populated 'unexpected' resources while comparing target and live states (#137)
* Make sure endpoints resources is detected as child resource for correspoinding service

* Issue #104 - Populated 'unexpected' resources while comparing target and live states

* Add comments to comparator CompareAppState method
2018-04-27 13:57:09 -07:00