Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #93 from simonostendorf/dev
Browse files Browse the repository at this point in the history
Release Version 1.2.0
  • Loading branch information
simonostendorf authored Oct 10, 2022
2 parents 8a7e0eb + 1b3daf8 commit da6195a
Show file tree
Hide file tree
Showing 13 changed files with 117 additions and 43 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Needed help
url: https://github.com/simonostendorf/k3s-hetzner/discussions/categories/q-a
about: Please ask questions here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Closes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Test A
- [ ] Test B

**Test Configuration**:
* k3s version:
* Hardware:

# Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v5
- uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'his issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
Expand Down
Binary file added docs/assets/home/meets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/deployment/other/nginx.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ You can name the subdomain whatever you want, i will keep it test in this scenar
## Create deployment
Create a new file on your machine with the following command:
```bash
mkdir -p deployment/nginx
nano deployment/nginx/example-deployment.yml
mkdir -p deployments/nginx
nano deployments/nginx/example-deployment.yml
```

Fill the file with the following content.
Expand Down
37 changes: 2 additions & 35 deletions docs/deployment/required/cert-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ kubectl get certificates
## Configure Helm Values
Create a new helm values file for cert-manager with the following command:
```bash
mkdir -p deployments/cert-manager
nano deployments/cert-manager/values.yml
```

Expand Down Expand Up @@ -68,7 +67,6 @@ As described in the [cloudflare step](../../../prerequisites/dns-provider/#creat

Create a new kubernetes secret with the following command:
```bash
mkdir -p deployments/cert-manager
nano deployments/cert-manager/cloudflare-secret.yml
```

Expand Down Expand Up @@ -97,7 +95,6 @@ As described previously we first use staging certificates to test our environmen
#### Create CerificateIssuer
Create a new certificate issuer with the following command:
```bash
mkdir -p deployments/cert-manager
nano deployments/cert-manager/letsencrypt-staging-issuer.yml
```

Expand Down Expand Up @@ -139,7 +136,6 @@ The next step is to create a certificate.

Create a new certificate with the following command:
```bash
mkdir -p deployments/cert-manager
nano deployments/cert-manager/example-com-staging-tls.yml #(1)!
```

Expand Down Expand Up @@ -224,38 +220,10 @@ kubectl delete -f deployments/cert-manager/example-com-staging-tls.yml --namespa
The setup will be similar to the staging environment. Copy the staging issuer file:
```bash
cp deployments/cert-manager/letsencrypt-staging-issuer.yml deployments/cert-manager/letsencrypt-production-issuer.yml
nano deployments/cert-manager/letsencrypt-production-issuer.yml
sed -i 's/letsencrypt-staging/letsencrypt-production/g' deployments/cert-manager/letsencrypt-production-issuer.yml
sed -i 's/-staging-/-/g' deployments/cert-manager/letsencrypt-production-issuer.yml
```

Edit the file and replace the following values:

```yaml linenums="1"
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-production #(1)!
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory #(2)!
email: your_email_should_already_be_here
privateKeySecretRef:
name: letsencrypt-production #(3)!
solvers:
- dns01:
cloudflare:
email: your_email_should_already_be_here
apiTokenSecretRef:
name: cloudflare-token-secret
key: cloudflare-token
selector:
dnsZones:
- your_dns_names_should_already_be_here
```

1. Replace `letsencrypt-staging` with `letsencrypt-production`.
2. Replace the old staging endpoint with the new one: `https://acme-v02.api.letsencrypt.org/directory`.
3. Replace `letsencrypt-staging` with `letsencrypt-production`.

Apply the issuer to the cluster with the following command:
```bash
kubectl apply -f deployments/cert-manager/letsencrypt-production-issuer.yml
Expand All @@ -266,7 +234,6 @@ Now we will create separate certificates for traefik and all other pods. In this

Create a new certificate with the following command:
```bash
mkdir -p deployments/cert-manager
nano deployments/cert-manager/traefik-example-com-tls.yml #(1)!
```

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/required/cluster-autoscaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ You can create the secret from the commandline with the following command:

!!! danger "Replace values"
You have to replace `DOCKER_USERNAME` with your docker username, created in the [prerequisite step](../../../prerequisites/container-registry/#create-account).
You have to replace `DOCKER_TOKEN` with your docker token, created in the [prerequisite step](../../../prerequisites/container-registry/#create-token). Be shure to change the read-only token (named `k8s-hetzner` in this example)
You have to replace `DOCKER_TOKEN` with your docker token, created in the [prerequisite step](../../../prerequisites/container-registry/#create-token). Be shure to choose the read-only token (named `k8s-hetzner` in this example)

```bash
kubectl create secret docker-registry -n kube-system dockerhub --docker-server=docker.io --docker-username=DOCKER_USERNAME --docker-password=DOCKER_TOKEN
Expand Down
13 changes: 11 additions & 2 deletions docs/deployment/required/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ service:
enabled: true
type: LoadBalancer
annotations: {
load-balancer.hetzner.cloud/name: "k8s-ingress", #(1)!
load-balancer.hetzner.cloud/location: "nbg1",
load-balancer.hetzner.cloud/name: k8s-ingress #(1)!
load-balancer.hetzner.cloud/location: nbg1
load-balancer.hetzner.cloud/use-private-ip: true
}
labels: {}
Expand All @@ -89,6 +89,15 @@ To validate all running services in the cluster, run the following command:
kubectl get svc --all-namespaces -o wide
```

!!! warning "Attention"
You need to check if the loadbalancer is connected with the k8s-service. View the annotations of the service with `kubectl describe service traefik -n traefik` and check the annotations. You should see the annotations given in the helm-values file.
If there are no annotations, you have to add them manually with the following commands:
```bash
kubectl annotate service traefik load-balancer.hetzner.cloud/use-private-ip=true -n traefik
kubectl annotate service traefik load-balancer.hetzner.cloud/name=k8s-ingress -n traefik
kubectl annotate service traefik load-balancer.hetzner.cloud/location=nbg1 -n traefik
```

## Setup default Middleware
Create a new middleware file for traefik with the following command:
```bash
Expand Down
10 changes: 8 additions & 2 deletions docs/home/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Home

<img src="https://cncf-branding.netlify.app/img/projects/k3s/horizontal/color/k3s-horizontal-color.svg" alt="k3s logo" width="200"/>
<img src="https://cncf-branding.netlify.app/img/projects/k3s/horizontal/color/k3s-horizontal-color.svg" alt="k3s-logo" width="150"/>
<img src="../../assets/home/meets.png" alt="meets" width="130"/>
<img src="https://www.hetzner.com/assets/Uploads/hetzner-logo3.svg" alt="Hetzner-logo" width="370"/>

## Introduction
In this documentation you will find a step by step solution to deploy a high-available, auto scalable and loadbalanced [k3s](https://k3s.io/) cluster to servers inside the Hetzner-Cloud.
Expand Down Expand Up @@ -33,4 +35,8 @@ This guide covers:

## Files
By following this guide you will need deployment files to change them to fit your needs and to deploy them to your cluster.
You will find the the original files references in the download command.
You will find the the original files references in the download command.

## Disclaimer
This guide is not an official guide from Hetzner or k3s.
If you want help, do not contant the official support of Hetzner or k3s. Instead you can open an issue in the [github repository](https://github.com/simonostendorf/k3s-hetzner/issues).
3 changes: 3 additions & 0 deletions docs/installation/k3s.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ INSTALL_K3S_EXEC="server \

This installation disables or customises many parameters to fit the needs of this setup.

!!! error "Attention"
You have to wait for the loadbalancer to report the status "mixed". So that the loadbalancer is ready to accept traffic. Otherwise the installation of the other nodes will fail because they cant communicate with the cluster.

### Install other Servers
To install k3s on the other controlplane nodes (in this example control-plane-hel1-1 and control-plane-ngb1-1), run the following command on the server:

Expand Down
1 change: 1 addition & 0 deletions scripts/setup-agent-nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def find_used_ips(network, ip_begin):
def attach_to_network(nw, ip, srv, retrys=0):
if retrys >= 5:
print("Failed to attach server to network. Max retrys reached. Exiting.")
srv.delete()
return

try:
Expand Down

0 comments on commit da6195a

Please sign in to comment.