这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@BachErik
Copy link
Owner

This PR introduces a new GitHub Actions workflow, Deploy Main to Kubernetes, that automatically deploys the main branch to a Kubernetes cluster upon the successful completion of the Build and Push Docker Image workflow. The deployment includes a namespace, deployment, service, and ingress configuration tailored for killedby-latest.


Key Changes

  1. Workflow Trigger:

    • Triggered on completion of the Build and Push Docker Image workflow.
  2. Namespace Management:

    • Ensures the killedby-latest namespace is created if it doesn't already exist.
  3. Kubernetes Configuration:

    • Automatically generates a deployment.yaml file in the k8s directory containing:
      • Deployment:
        • Deploys a single replica of the container image bacherik/killedby:latest.
        • Passes necessary environment variables, including GitHub metadata.
        • Exposes the container on port 8080.
      • Service:
        • Exposes the deployment via a ClusterIP service on port 80.
      • Ingress:
        • Configures an Ingress resource for external access using the hostname latest.killedby.bacherik.de.
        • Supports HTTPS using Let's Encrypt certificates via Cert-Manager.
        • Limits access to the IP range 192.168.0.0/16.
  4. Deployment Automation:

    • Utilizes kubectl to apply the generated configuration.

Workflow Steps

  1. Checkout Code:
    Ensures the repository is available in the workflow.

  2. Namespace Management:
    Creates the required namespace or confirms it already exists.

  3. Configuration Generation:
    Dynamically creates the Kubernetes deployment, service, and ingress configuration files.

  4. Deployment:
    Applies the configuration to the Kubernetes cluster using kubectl.

@BachErik BachErik self-assigned this Nov 21, 2024
@BachErik BachErik merged commit 9935dd6 into main Nov 21, 2024
4 checks passed
@BachErik BachErik deleted the BachErik-add-kubernetes-publish-latest branch November 21, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants