Skip to content

Commit

Permalink
feat: Upgrade default kubernetes version to 1.25 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibordp authored Oct 1, 2022
1 parent 26aa027 commit fe7c287
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 251 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module "k8s" {
worker_server_type = "cx31"
worker_count = 2
kubernetes_version = "1.24.0"
kubernetes_version = "1.25.0"
}
output "kubeconfig" {
Expand All @@ -61,9 +61,9 @@ and check the access by viewing the created cluster nodes:
```cmd
$ kubectl get nodes --kubeconfig=kubeconfig.conf
NAME STATUS ROLES AGE VERSION
k8s-master-0 Ready control-plane 31m v1.24.0
k8s-worker-0 Ready <none> 31m v1.24.0
k8s-worker-1 Ready <none> 31m v1.24.0
k8s-master-0 Ready control-plane 31m v1.25.0
k8s-worker-0 Ready <none> 31m v1.25.0
k8s-worker-1 Ready <none> 31m v1.25.0
```

## Supported base images
Expand Down Expand Up @@ -137,7 +137,7 @@ module "k8s" {
version = "1.0.1"
...
kubeadm_host = "<ip address of another master node>"
}
```
Expand All @@ -157,7 +157,7 @@ TLS certificate credentials form the output can be used to chain other Terraform
provider "kubernetes" {
host = module.k8s.apiserver_url
# For a single-master cluster, this will be an IPv6 URL. For IPv4, this can
# also be used
# host = "https://${module.k8s.masters[0].ipv4_address}:6443"
Expand Down Expand Up @@ -203,6 +203,6 @@ In addition some caveats for dual-stack clusters in general:
- the apiserver Service (`kubernetes.default.svc.cluster.local`) has to be single-stack, as `--apiserver-advertise-address` does not support dual-stack yet. The default address family for the cluster can be selected with `primary_ip_family` variable (defaults to `ipv6`).


## Acknowledgements
## Acknowledgements

Some parts, including this README, adapted from [JWDobken/terraform-hcloud-kubernetes](https://github.com/JWDobken/terraform-hcloud-kubernetes) by Joost Döbken.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
source = "hetznercloud/hcloud"
version = "~> 1.31"
}
template = {
cloudinit = {
source = "hashicorp/cloudinit"
version = "2.2.0"
}
Expand Down
5 changes: 0 additions & 5 deletions scripts/install-addons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,4 @@ else
fi

kubectl apply -f hetzner_ccm.yaml

# Install storage provider
kubectl -n kube-system create secret generic hcloud-csi \
--from-literal=token="$HCLOUD_TOKEN" \
-o yaml --dry-run=client | kubectl apply -f-
kubectl apply -f hetzner_csi.yaml
15 changes: 8 additions & 7 deletions templates/hetzner_ccm.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ spec:
# cloud controller manages should be able to run on masters
- key: "node-role.kubernetes.io/master"
effect: NoSchedule
operator: Exists
operator: Exists
- key: "node-role.kubernetes.io/control-plane"
effect: NoSchedule
operator: Exists
operator: Exists
- key: "node.kubernetes.io/not-ready"
effect: "NoSchedule"
containers:
- image: hetznercloud/hcloud-cloud-controller-manager:v1.12.1
- image: hetznercloud/hcloud-cloud-controller-manager:v1.13.0
name: hcloud-cloud-controller-manager
command:
- "/bin/hcloud-cloud-controller-manager"
- "--cloud-provider=hcloud"
- "--leader-elect=false"
- "--allow-untagged-cloud"
%{ if use_hcloud_network ~}
%{ if use_hcloud_network ~}
- "--allocate-node-cidrs=true"
- "--cluster-cidr=${pod_cidr_ipv4}"
%{ endif ~}
%{ endif ~}
resources:
requests:
cpu: 100m
Expand All @@ -83,12 +83,13 @@ spec:
secretKeyRef:
name: hcloud
key: token
%{ if use_hcloud_network ~}
%{ if use_hcloud_network ~}
- name: HCLOUD_NETWORK
valueFrom:
secretKeyRef:
name: hcloud
key: network
%{ endif ~}
- name: HCLOUD_INSTANCES_ADDRESS_FAMILY
value: dualstack
value: dualstack
priorityClassName: system-cluster-critical
Loading

0 comments on commit fe7c287

Please sign in to comment.