kubestore

package
v1.83.0-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2025 License: BSD-3-Clause Imports: 16 Imported by: 5

Documentation

Overview

Package kubestore contains an ipn.StateStore implementation using Kubernetes Secrets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an ipn.StateStore that uses a Kubernetes Secret for persistence.

func New

func New(logf logger.Logf, secretName string) (*Store, error)

New returns a new Store that persists state to Kubernets Secret(s). Tailscale state is stored in a Secret named by the secretName parameter. TLS certs are stored and retrieved from state Secret or separate Secrets named after TLS endpoints if running in cert share mode.

func (*Store) ReadState

func (s *Store) ReadState(id ipn.StateKey) ([]byte, error)

ReadState implements the StateStore interface.

func (*Store) ReadTLSCertAndKey added in v1.82.0

func (s *Store) ReadTLSCertAndKey(domain string) (cert, key []byte, err error)

ReadTLSCertAndKey reads a TLS cert and key from memory or from a domain-specific Secret. It first checks the in-memory store, if not found in memory and running cert store in read-only mode, looks up a Secret. Note that write replicas of HA Ingress always retrieve TLS certs from Secrets.

func (*Store) SetDialer added in v1.40.0

func (s *Store) SetDialer(d func(ctx context.Context, network, address string) (net.Conn, error))

func (*Store) String

func (s *Store) String() string

func (*Store) WriteState

func (s *Store) WriteState(id ipn.StateKey, bs []byte) (err error)

WriteState implements the StateStore interface.

func (*Store) WriteTLSCertAndKey added in v1.82.0

func (s *Store) WriteTLSCertAndKey(domain string, cert, key []byte) (err error)

WriteTLSCertAndKey writes a TLS cert and key to domain.crt, domain.key fields of a Tailscale Kubernetes node's state Secret.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL