LoginSignup
0
0

おうちKubernetesでGitOps(1)

Posted at

やりたいこと

前回の続き
https://qiita.com/Rocky-6/items/22bf1248ba813af2a34b

  • ArgoCDの構築
  • Giteaの構築

ArgoCDの構築

公式通りインストールする
https://argo-cd.readthedocs.io/en/stable/getting_started/

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Ingressの設定

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

spec:
  ingressClassName: nginx
  rules:
    - host: argocd.example.com - 適宜変更
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: argocd-server
                port:
                  name: https
  tls:
    - hosts:
        - "*.example.com" - 適宜変更
        - argocd.example.com - 適宜変更
      secretName: argocd-server-tls

確認

$ kubectl get svc -n argocd
NAME                                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
argocd-applicationset-controller          ClusterIP   10.107.249.21    <none>        7000/TCP,8080/TCP            24d
argocd-dex-server                         ClusterIP   10.108.106.107   <none>        5556/TCP,5557/TCP,5558/TCP   24d
argocd-metrics                            ClusterIP   10.109.202.215   <none>        8082/TCP                     24d
argocd-notifications-controller-metrics   ClusterIP   10.111.201.227   <none>        9001/TCP                     24d
argocd-redis                              ClusterIP   10.102.87.35     <none>        6379/TCP                     24d
argocd-repo-server                        ClusterIP   10.107.229.91    <none>        8081/TCP,8084/TCP            24d
argocd-server                             ClusterIP   10.111.89.212    <none>        80/TCP,443/TCP               24d
argocd-server-metrics                     ClusterIP   10.102.42.206    <none>        8083/TCP                     24d

$ kubectl get ingress -n argocd
NAME                    CLASS   HOSTS                ADDRESS          PORTS     AGE
argocd-server-ingress   nginx   argocd.example.com   192.168.11.120   80, 443   20d

※ADDRESSはMetalLBがIngress-NGINXに対して払い出しているIPアドレス。
参考にしたサイト: https://ryusa.hatenablog.com/entry/2021/05/21/231844

実際にアクセスしてみる
argocd.png

できました。

Giteaの構築

HelmでGiteaをインストールする
https://gitea.com/gitea/helm-chart

チャートをカスタマイズする

helm inspect values gitea-charts/gitea > config.yaml
vim config.yaml # IngressとStorageClassの編集をする

スクリーンショット 2024-01-28 173246.png
スクリーンショット 2024-01-28 173304.png

VALUESの箇所にconfig.yamlの編集箇所をコピーする
スクリーンショット 2024-01-28 173318.png

ちゃんと動いてるっぽい
image.png

実際にアクセスしてみる
gitea.png
できました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0