mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
introduction to argo with examples
This commit is contained in:
parent
bfebd40a76
commit
6a43fbe890
14
argo/argo-cd/app.yaml
Normal file
14
argo/argo-cd/app.yaml
Normal file
@ -0,0 +1,14 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: test2
|
||||
namespace: argocd
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://github.com/marcel-dempers/docker-development-youtube-series.git
|
||||
targetRevision: HEAD
|
||||
path: argo/example-app
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: test
|
28
argo/argo-cd/create-in-cluster-app.md
Normal file
28
argo/argo-cd/create-in-cluster-app.md
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
CLI
|
||||
```
|
||||
argocd app create --name test \
|
||||
--repo https://github.com/marcel-dempers/docker-development-youtube-series \
|
||||
--dest-server https://kubernetes.default.svc \
|
||||
--dest-namespace marcel --path kubernetes
|
||||
```
|
||||
|
||||
YAML
|
||||
|
||||
```
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: test
|
||||
namespace: marcel
|
||||
spec:
|
||||
project: default
|
||||
source:
|
||||
repoURL: https://github.com/marcel-dempers/docker-development-youtube-series.git
|
||||
targetRevision: HEAD
|
||||
path: argo/example-app
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: marcel
|
||||
```
|
||||
|
2870
argo/argo-cd/install.yaml
Normal file
2870
argo/argo-cd/install.yaml
Normal file
File diff suppressed because it is too large
Load Diff
10
argo/example-app/configmaps/configmap.yaml
Normal file
10
argo/example-app/configmaps/configmap.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: example-config
|
||||
data:
|
||||
config.json: |
|
||||
{
|
||||
"environment" : "dev"
|
||||
}
|
||||
# kubectl create configmap example-config --from-file ./golang/configs/config.json
|
53
argo/example-app/deployments/deployment.yaml
Normal file
53
argo/example-app/deployments/deployment.yaml
Normal file
@ -0,0 +1,53 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: example-deploy
|
||||
labels:
|
||||
app: example-app
|
||||
annotations:
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: example-app
|
||||
replicas: 2
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: example-app
|
||||
spec:
|
||||
containers:
|
||||
- name: example-app
|
||||
image: aimvector/python:1.0.0
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /status
|
||||
port: 5000
|
||||
initialDelaySeconds: 3
|
||||
periodSeconds: 3
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "500m"
|
||||
volumeMounts:
|
||||
- name: secret-volume
|
||||
mountPath: /secrets/
|
||||
- name: config-volume
|
||||
mountPath: /configs/
|
||||
volumes:
|
||||
- name: secret-volume
|
||||
secret:
|
||||
secretName: mysecret
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: example-config #name of our configmap object
|
28
argo/example-app/deployments/readme.md
Normal file
28
argo/example-app/deployments/readme.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Deployments
|
||||
|
||||
Build an example app:
|
||||
|
||||
```
|
||||
# Important!
|
||||
# make sure you are at root of the repository
|
||||
# in your terminal
|
||||
|
||||
# you can choose which app you want to build!
|
||||
|
||||
|
||||
# aimvector/golang:1.0.0
|
||||
docker-compose build golang
|
||||
|
||||
|
||||
# aimvector/csharp:1.0.0
|
||||
docker-compose build csharp
|
||||
|
||||
# aimvector/nodejs:1.0.0
|
||||
docker-compose build nodejs
|
||||
|
||||
# aimvector/python:1.0.0
|
||||
docker-compose build python
|
||||
|
||||
```
|
||||
|
||||
Take a look at example [deployment yaml](./deployment.yaml)
|
12
argo/example-app/secrets/secret.yaml
Normal file
12
argo/example-app/secrets/secret.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: mysecret
|
||||
type: Opaque
|
||||
stringData:
|
||||
secret.json: |-
|
||||
{
|
||||
"api_key" : "somesecretgoeshere"
|
||||
}
|
||||
|
||||
#kubectl create secret generic mysecret --from-file .\golang\secrets\secret.json
|
11
argo/example-app/services/service.yaml
Normal file
11
argo/example-app/services/service.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: example-service
|
||||
spec:
|
||||
selector:
|
||||
app: example-app
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 5000
|
Loading…
x
Reference in New Issue
Block a user