D10S0VSkY-OSS / Stack-Lifecycle-Deployment

OpenSource self-service infrastructure solution that defines and manages the complete lifecycle of resources used and provisioned into a cloud! It is a terraform UI with rest api for terraform and OpenTofu automation
MIT License
228 stars 34 forks source link

invalid username-password pair or user is disabled #183

Closed dehengxu closed 9 months ago

dehengxu commented 10 months ago

I use git clone https://username:gh_token@github.com/proj...., but got failed

D10S0VSkY-OSS commented 10 months ago

Hi @dehengxu , SLD is an open-source product and intends for everything developed to be open source, therefore it does not support private repos with nuances...

The way to use private git repos is to generate secrets from Kubernetes manifests... Stack-Lifecycle-Deployment/play-with-sld/kubernetes/k8s/sld-worker-squad1.yml create gitconfig

.gitconfig

[url "https://tokenxxxx@github.com"]
    insteadOf = https://github.com
kubectl create secret generic gitconfig-secret --from-file=.gitconfig=/path/to/your/.gitconfig

example worker mount path mountPath: /home/sld/.gitconfig

apiVersion: apps/v1
kind: Deployment
metadata:
  name: stack-deploy-worker-squad1
  labels:
    name: stack-deploy-worker-squad1
spec:
  replicas: 1 
  selector:
    matchLabels:
      name: stack-deploy-worker-squad1
  template:
    metadata:
      labels:
        name: stack-deploy-worker-squad1
    spec:
      subdomain: primary
      containers:
        - name: stack-deploy-worker-squad1
          image: d10s0vsky/sld-api:2.18.0
          imagePullPolicy: Always
          env:
            - name: TF_WARN_OUTPUT_ERRORS
              value: "1"
            - name: PATH
              value: "/home/sld/.asdf/shims:/home/sld/.asdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
          command: ["python", "-m", "celery", "--app", "src.worker.tasks.terraform_worker", "worker", "--loglevel=info", "-c", "8", "-E", "-Q", "any,squad1"]
          volumeMounts:
            - name: gitconfig-volume
              mountPath: /home/sld/.gitconfig
              subPath: .gitconfig
      volumes:
        - name: gitconfig-volume
          secret:
            secretName: gitconfig-secret

Regards!