Skip to content

Commit 6a43fbe

Browse files
introduction to argo with examples
1 parent bfebd40 commit 6a43fbe

File tree

8 files changed

+3026
-0
lines changed

8 files changed

+3026
-0
lines changed

argo/argo-cd/app.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: Application
3+
metadata:
4+
name: test2
5+
namespace: argocd
6+
spec:
7+
project: default
8+
source:
9+
repoURL: https://github.com/marcel-dempers/docker-development-youtube-series.git
10+
targetRevision: HEAD
11+
path: argo/example-app
12+
destination:
13+
server: https://kubernetes.default.svc
14+
namespace: test
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
CLI
3+
```
4+
argocd app create --name test \
5+
--repo https://github.com/marcel-dempers/docker-development-youtube-series \
6+
--dest-server https://kubernetes.default.svc \
7+
--dest-namespace marcel --path kubernetes
8+
```
9+
10+
YAML
11+
12+
```
13+
apiVersion: argoproj.io/v1alpha1
14+
kind: Application
15+
metadata:
16+
name: test
17+
namespace: marcel
18+
spec:
19+
project: default
20+
source:
21+
repoURL: https://github.com/marcel-dempers/docker-development-youtube-series.git
22+
targetRevision: HEAD
23+
path: argo/example-app
24+
destination:
25+
server: https://kubernetes.default.svc
26+
namespace: marcel
27+
```
28+

argo/argo-cd/install.yaml

Lines changed: 2870 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: example-config
5+
data:
6+
config.json: |
7+
{
8+
"environment" : "dev"
9+
}
10+
# kubectl create configmap example-config --from-file ./golang/configs/config.json
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: example-deploy
5+
labels:
6+
app: example-app
7+
annotations:
8+
spec:
9+
selector:
10+
matchLabels:
11+
app: example-app
12+
replicas: 2
13+
strategy:
14+
type: RollingUpdate
15+
rollingUpdate:
16+
maxSurge: 1
17+
maxUnavailable: 0
18+
template:
19+
metadata:
20+
labels:
21+
app: example-app
22+
spec:
23+
containers:
24+
- name: example-app
25+
image: aimvector/python:1.0.0
26+
imagePullPolicy: Always
27+
ports:
28+
- containerPort: 5000
29+
livenessProbe:
30+
httpGet:
31+
path: /status
32+
port: 5000
33+
initialDelaySeconds: 3
34+
periodSeconds: 3
35+
resources:
36+
requests:
37+
memory: "64Mi"
38+
cpu: "50m"
39+
limits:
40+
memory: "256Mi"
41+
cpu: "500m"
42+
volumeMounts:
43+
- name: secret-volume
44+
mountPath: /secrets/
45+
- name: config-volume
46+
mountPath: /configs/
47+
volumes:
48+
- name: secret-volume
49+
secret:
50+
secretName: mysecret
51+
- name: config-volume
52+
configMap:
53+
name: example-config #name of our configmap object
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Deployments
2+
3+
Build an example app:
4+
5+
```
6+
# Important!
7+
# make sure you are at root of the repository
8+
# in your terminal
9+
10+
# you can choose which app you want to build!
11+
12+
13+
# aimvector/golang:1.0.0
14+
docker-compose build golang
15+
16+
17+
# aimvector/csharp:1.0.0
18+
docker-compose build csharp
19+
20+
# aimvector/nodejs:1.0.0
21+
docker-compose build nodejs
22+
23+
# aimvector/python:1.0.0
24+
docker-compose build python
25+
26+
```
27+
28+
Take a look at example [deployment yaml](./deployment.yaml)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: mysecret
5+
type: Opaque
6+
stringData:
7+
secret.json: |-
8+
{
9+
"api_key" : "somesecretgoeshere"
10+
}
11+
12+
#kubectl create secret generic mysecret --from-file .\golang\secrets\secret.json
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: example-service
5+
spec:
6+
selector:
7+
app: example-app
8+
ports:
9+
- protocol: TCP
10+
port: 80
11+
targetPort: 5000

0 commit comments

Comments
 (0)