Compare commits
2 Commits
82ffed1333
...
50fb41b107
Author | SHA1 | Date | |
---|---|---|---|
50fb41b107 | |||
46cfabff85 |
20
argocd/argocd-ingress.yaml
Normal file
20
argocd/argocd-ingress.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: argocd-ingress
|
||||||
|
namespace: argocd
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: argocd.marcin00.pl
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: argocd-server
|
||||||
|
port:
|
||||||
|
number: 80
|
51
argocd/readme.md
Normal file
51
argocd/readme.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# Instrukcje konfiguracji ArgoCD
|
||||||
|
|
||||||
|
## Instalacja:
|
||||||
|
Aby wdrożyć ArgoCD wykonujemy komendy:
|
||||||
|
```
|
||||||
|
kubectl create namespace argocd
|
||||||
|
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
||||||
|
```
|
||||||
|
W celu zalogowania sekret wydobywamy komendą:
|
||||||
|
```
|
||||||
|
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 -d
|
||||||
|
```
|
||||||
|
Następnie wdrażamy obiekt Ingress z tego folderu.
|
||||||
|
```
|
||||||
|
kubectl apply -f argocd-ingress.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
## Jak wyłączyć HTTPS
|
||||||
|
Aby wyłączyć HTTPS w ArgoCD należy otworzyć configmap:
|
||||||
|
```
|
||||||
|
kubectl edit configmap argocd-cmd-params-cm -n argocd
|
||||||
|
```
|
||||||
|
i dodać do configmap następujący tekst:
|
||||||
|
```
|
||||||
|
data:
|
||||||
|
server.insecure: "true"
|
||||||
|
```
|
||||||
|
Aby przeładować serwer zniszcz poda:
|
||||||
|
```
|
||||||
|
kubectl delete pod -n argocd argocd-server-<xxx>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Jak ustawić wartość sekretu dla Webhooka Gitea
|
||||||
|
Zapisujemy sekret do zmiennej środowiskowej GITEA_WEBHOOK_SECRET.
|
||||||
|
Następnie tworzymy sekret za pomocą poniższej komendy
|
||||||
|
```
|
||||||
|
kubectl create secret generic gitea-webhook-secret \
|
||||||
|
--namespace argocd \
|
||||||
|
--from-literal=webhook.secret="$GITEA_WEBHOOK_SECRET" \
|
||||||
|
--type=Opaque \
|
||||||
|
--label=app.kubernetes.io/part-of=argocd \
|
||||||
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
```
|
||||||
|
Potem modyfikujemy argocd-secret, otwieramy go komendą:
|
||||||
|
```
|
||||||
|
kubectl edit secret argocd-secret -n argocd
|
||||||
|
```
|
||||||
|
dodajemy pod klucz `data` taką oto linię:
|
||||||
|
```
|
||||||
|
webhook.gitea.secret: "$gitea-webhook-secret:webhook.secret"
|
||||||
|
```
|
17
fluxcd/flux-receiver.yaml
Normal file
17
fluxcd/flux-receiver.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: notification.toolkit.fluxcd.io/v1
|
||||||
|
kind: Receiver
|
||||||
|
metadata:
|
||||||
|
name: gitea-receiver
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
type: generic
|
||||||
|
events:
|
||||||
|
- "ping"
|
||||||
|
- "push"
|
||||||
|
secretRef:
|
||||||
|
name: webhook-token
|
||||||
|
resources:
|
||||||
|
- apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
name: user-microservice-repo
|
||||||
|
namespace: flux-system
|
7
fluxcd/fluxcd-secret.yaml
Normal file
7
fluxcd/fluxcd-secret.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: webhook-token
|
||||||
|
namespace: flux-system
|
||||||
|
stringData:
|
||||||
|
token: ${GITEA_WEBHOOK_SECRET}
|
20
fluxcd/ingress.yaml
Normal file
20
fluxcd/ingress.yaml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: webhook-receiver
|
||||||
|
namespace: flux-system
|
||||||
|
annotations:
|
||||||
|
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: flux.marcin00.pl
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: webhook-receiver
|
||||||
|
port:
|
||||||
|
number: 80
|
13
fluxcd/kustomization.yaml
Normal file
13
fluxcd/kustomization.yaml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: user-microservice
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
path: ./apps/user-microservice
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: user-microservice-repo
|
||||||
|
targetNamespace: user-microservice
|
10
fluxcd/source.yaml
Normal file
10
fluxcd/source.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: user-microservice-repo
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 1m
|
||||||
|
url: https://gitea.marcin00.pl/pikram/user-microservice-deploy.git
|
||||||
|
ref:
|
||||||
|
branch: argoworkflow-fluxcd
|
Reference in New Issue
Block a user