-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement workflow templates and workflows for decapod v2 #25
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8824649
add argocd workflow
estherk0 5195849
implement workflowtemplates for argocd
estherk0 2857f69
added new workflows for decapod-v2
estherk0 2388dd3
rename prepare-argocd wftpl
estherk0 f34d24e
remove unused parameter
estherk0 1c2e863
fix namespace for istio-system
estherk0 f282e2a
fix default site_name
estherk0 1a65385
fix namespace to elastic-system
estherk0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM alpine:3.7 | ||
RUN apk update && apk add --no-cache curl bash | ||
|
||
WORKDIR /workspace | ||
RUN curl -sSL -o /workspace/argocd https://github.com/argoproj/argo-cd/releases/download/v2.0.1/argocd-linux-amd64 | ||
RUN chmod +x /workspace/argocd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: WorkflowTemplate | ||
metadata: | ||
name: create-application | ||
spec: | ||
arguments: | ||
parameters: | ||
- name: site_name | ||
value: "hanu-deploy-apps" | ||
- name: app_name | ||
value: "lma" | ||
templates: | ||
- name: createApp | ||
inputs: | ||
parameters: | ||
- name: path | ||
- name: namespace | ||
activeDeadlineSeconds: 900 | ||
container: | ||
name: 'create' | ||
image: docker.io/sktdev/argocd:latest | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
# log into Argo CD server | ||
./argocd login $ARGO_SERVER --insecure --username $ARGO_USERNAME --password $ARGO_PASSWORD | ||
|
||
# check if app already exists. | ||
./argocd app get $PATH | ||
if [[ $? -ne 0 ]]; then | ||
# create new application if not exists. | ||
./argocd app create $PATH --repo $REPO --path $SITE_NAME/$APP_NAME/$PATH --dest-namespace $NAMESPACE --dest-name $SITE_NAME --directory-recurse | ||
fi | ||
|
||
./argocd app sync $PATH --async | ||
./argocd app wait $PATH --health | ||
envFrom: | ||
- secretRef: | ||
name: "decapod-argocd-config" | ||
env: | ||
- name: PATH | ||
value: "{{inputs.parameters.path}}" | ||
- name: SITE_NAME | ||
value: "{{workflow.parameters.site_name}}" | ||
- name: APP_NAME | ||
value: "{{workflow.parameters.app_name}}" | ||
- name: NAMESPACE | ||
value: "{{inputs.parameters.namespace}}" | ||
|
||
- name: AppGroup | ||
inputs: | ||
parameters: | ||
- name: list | ||
steps: | ||
- - name: "InstallAppGroup" | ||
template: createApp | ||
arguments: | ||
parameters: | ||
- {name: path, value: "{{item.path}}"} | ||
- {name: namespace, value: "{{item.namespace}}"} | ||
withParam: "{{inputs.parameters.list}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: WorkflowTemplate | ||
metadata: | ||
name: prepare-argocd | ||
spec: | ||
startpoint: configuration | ||
arguments: | ||
parameters: | ||
- name: repository_url | ||
value: "https://github.com/openinfradev/decapod-site-cd" | ||
- name: argo_server | ||
value: "192.168.97.192:30080" | ||
- name: argo_username | ||
value: "admin" | ||
- name: argo_password | ||
value: "password" | ||
templates: | ||
- name: configuration | ||
activeDeadlineSeconds: 120 | ||
container: | ||
name: 'config' | ||
image: k8s.gcr.io/hyperkube:v1.18.8 | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
kubectl get secret decapod-argocd-config -nargo | ||
|
||
if [[ $? =~ 0 ]]; then | ||
kubectl delete secret decapod-argocd-config -nargo | ||
fi | ||
|
||
kubectl create secret generic decapod-argocd-config -nargo \ | ||
--from-literal=ARGO_SERVER=$ARGO_SERVER \ | ||
--from-literal=ARGO_USERNAME=$ARGO_USERNAME \ | ||
--from-literal=ARGO_PASSWORD=$ARGO_PASSWORD \ | ||
--from-literal=REPO=$REPO | ||
|
||
env: | ||
- name: ARGO_SERVER | ||
value: "{{workflow.parameters.argo_server}}" | ||
- name: ARGO_USERNAME | ||
value: "{{workflow.parameters.argo_username}}" | ||
- name: ARGO_PASSWORD | ||
value: "{{workflow.parameters.argo_password}}" | ||
- name: REPO | ||
value: "{{workflow.parameters.repository_url}}" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: lma-federation- | ||
namespace: argo | ||
spec: | ||
entrypoint: deploy | ||
arguments: | ||
parameters: | ||
- name: site_name | ||
value: "hanu-deploy-apps" | ||
- name: app_name | ||
value: "lma" | ||
templates: | ||
- name: deploy | ||
dag: | ||
tasks: | ||
- name: operator | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "prometheus-operator", "namespace": "lma" }, | ||
{ "path": "eck-operator", "namespace": "lma" }, | ||
{ "path": "fluentbit-operator", "namespace": "lma" } | ||
] | ||
dependencies: [] | ||
- name: logging | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "eck-resource", "namespace": "lma" }, | ||
{ "path": "fluentbit", "namespace": "lma" }, | ||
{ "path": "kubernetes-event-exporter", "namespace": "lma" } | ||
] | ||
dependencies: [operator] | ||
- name: prepare-lma | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "thanos-config", "namespace": "lma" } | ||
] | ||
dependencies: [operator] | ||
|
||
- name: prometheus | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "prometheus", "namespace": "lma" }, | ||
{ "path": "kube-state-metrics", "namespace": "lma" }, | ||
{ "path": "prometheus-process-exporter", "namespace": "lma" }, | ||
{ "path": "prometheus-pushgateway", "namespace": "lma" }, | ||
{ "path": "prometheus-node-exporter", "namespace": "lma" }, | ||
{ "path": "prometheus-adapter", "namespace": "lma" }, | ||
{ "path": "addons", "namespace": "lma" } | ||
] | ||
dependencies: [prepare-lma] | ||
|
||
- name: federation | ||
templateRef: | ||
name: create-application | ||
template: ChartGroup | ||
arguments: | ||
parameters: | ||
- name: chart_list | ||
value: | | ||
[ | ||
{ "path": "prometheus-fed-master", "namespace": "fed" }, | ||
{ "path": "fed-addons", "namespace": "fed" }, | ||
{ "path": "thanos", "namespace": "fed" } | ||
] | ||
dependencies: [prometheus,logging] | ||
|
||
- name: grafana | ||
templateRef: | ||
name: create-application | ||
template: ChartGroup | ||
arguments: | ||
parameters: | ||
- name: chart_list | ||
value: | | ||
[ | ||
{ "path": "grafana", "namespace": "fed" } | ||
] | ||
dependencies: [federation] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: lma- | ||
namespace: argo | ||
spec: | ||
entrypoint: deploy | ||
arguments: | ||
parameters: | ||
- name: site_name | ||
value: "hanu-deploy-apps" | ||
- name: app_name | ||
value: "lma" | ||
templates: | ||
- name: deploy | ||
dag: | ||
tasks: | ||
- name: operator | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "prometheus-operator", "namespace": "lma" }, | ||
{ "path": "eck-operator", "namespace": "lma" }, | ||
{ "path": "fluentbit-operator", "namespace": "lma" } | ||
] | ||
dependencies: [] | ||
- name: logging | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "eck-resource", "namespace": "lma" }, | ||
{ "path": "fluentbit", "namespace": "lma" }, | ||
{ "path": "kubernetes-event-exporter", "namespace": "lma" } | ||
] | ||
dependencies: [operator] | ||
- name: prepare-lma | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "thanos-config", "namespace": "lma" } | ||
] | ||
dependencies: [operator] | ||
|
||
- name: prometheus | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "prometheus", "namespace": "lma" }, | ||
{ "path": "kube-state-metrics", "namespace": "lma" }, | ||
{ "path": "prometheus-process-exporter", "namespace": "lma" }, | ||
{ "path": "prometheus-pushgateway", "namespace": "lma" }, | ||
{ "path": "prometheus-node-exporter", "namespace": "lma" }, | ||
{ "path": "prometheus-adapter", "namespace": "lma" }, | ||
{ "path": "addons", "namespace": "lma" } | ||
] | ||
dependencies: [prepare-lma] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: openstack-components- | ||
namespace: argo | ||
spec: | ||
entrypoint: deploy | ||
arguments: | ||
parameters: | ||
- name: site_name | ||
value: "hanu-deploy-apps" | ||
- name: app_name | ||
value: "openstack" | ||
templates: | ||
- name: deploy | ||
dag: | ||
tasks: | ||
- name: base | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "keystone", "namespace": "openstack" }, | ||
{ "path": "glance", "namespace": "openstack" }, | ||
{ "path": "cinder", "namespace": "openstack" } | ||
] | ||
dependencies: [] | ||
- name: compute-kit | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "libvirt", "namespace": "openstack" }, | ||
{ "path": "nova", "namespace": "openstack" }, | ||
{ "path": "neutron", "namespace": "openstack" } | ||
] | ||
dependencies: [base] | ||
- name: addon | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "horizon", "namespace": "openstack" }, | ||
{ "path": "heat", "namespace": "openstack" }, | ||
{ "path": "prometheus-openstack-exporter", "namespace": "openstack" } | ||
] | ||
dependencies: [base,compute-kit] | ||
- name: sona | ||
templateRef: | ||
name: create-application | ||
template: AppGroup | ||
arguments: | ||
parameters: | ||
- name: list | ||
value: | | ||
[ | ||
{ "path": "horizon", "namespace": "openstack" }, | ||
] | ||
dependencies: [addon] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eck-operator 는 generated yaml 에서 설치될 namespace 를 elastic-system 으로 정의되어 있어 namespace 를 lma 에서 elastic-system 으로 바꿔야 합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정하였습니다