Skip to content

Commit

Permalink
chore: update k3s image for development
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Jul 6, 2021
1 parent e04a487 commit 8bc534a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion conformance/v1.21/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ syncer:
- --disable-sync-resources=ingresses
```
Now create the vcluster with the [vcluster cli](https://github.com/loft-sh/vcluster/releases) (at least version v0.3.1 or newer):
Now create the vcluster with the [vcluster cli](https://github.com/loft-sh/vcluster/releases) (at least version v0.3.2 or newer):
```
# Create the vcluster
vcluster create vcluster -n vcluster -f values.yaml
Expand Down
2 changes: 1 addition & 1 deletion devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ vars:
- name: SYNCER_IMAGE
value: ghcr.io/loft-sh/loft-enterprise/dev-vcluster
- name: K3S_IMAGE
value: rancher/k3s:v1.20.5-k3s1
value: rancher/k3s:v1.21.2-k3s1
# Replace this with your clusters service CIDR, you can find it out via
# kubectl apply -f hack/wrong-cluster-ip-service.yaml
- name: SERVICE_CIDR
Expand Down
4 changes: 2 additions & 2 deletions pkg/server/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
"os"
)

func GenServingCerts(caCertFile, caKeyFile, certFile, keyFile string, SANs []string) (bool, error) {
func GenServingCerts(caCertFile, caKeyFile, certFile, keyFile, clusterDomain string, SANs []string) (bool, error) {
regen := false
commonName := "kube-apiserver"
extKeyUsage := []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}
altNames := &certhelper.AltNames{
DNSNames: []string{"kubernetes.default.svc", "kubernetes.default", "kubernetes", "localhost"},
DNSNames: []string{"kubernetes.default.svc." + clusterDomain, "kubernetes.default.svc", "kubernetes.default", "kubernetes", "localhost"},
IPs: []net.IP{net.ParseIP("127.0.0.1")},
}

Expand Down
6 changes: 5 additions & 1 deletion pkg/server/cert/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type Syncer interface {

func NewSyncer(ctx *ctrlcontext.ControllerContext) Syncer {
return &syncer{
clusterDomain: ctx.Options.ClusterDomain,

serverCaKey: ctx.Options.ServerCaKey,
serverCaCert: ctx.Options.ServerCaCert,

Expand All @@ -47,6 +49,8 @@ func NewSyncer(ctx *ctrlcontext.ControllerContext) Syncer {
}

type syncer struct {
clusterDomain string

serverCaCert string
serverCaKey string

Expand Down Expand Up @@ -158,7 +162,7 @@ func (s *syncer) regen(extraSANs []string) error {
klog.Infof("Generating serving cert for service ips: %v", extraSANs)
tlsCert := filepath.Join(certPath, "serving-tls.crt")
tlsKey := filepath.Join(certPath, "serving-tls.key")
_, err = GenServingCerts(s.serverCaCert, s.serverCaKey, tlsCert, tlsKey, extraSANs)
_, err = GenServingCerts(s.serverCaCert, s.serverCaKey, tlsCert, tlsKey, s.clusterDomain, extraSANs)
if err != nil {
return err
}
Expand Down

0 comments on commit 8bc534a

Please sign in to comment.