introduction to argo with examples

This commit is contained in:
marcel-dempers 2019-11-02 12:56:08 +11:00
parent bfebd40a76
commit 6a43fbe890
8 changed files with 3026 additions and 0 deletions

14
argo/argo-cd/app.yaml Normal file
View 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

View 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

File diff suppressed because it is too large Load Diff

View 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

View 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

View 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)

View 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

View 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