Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(charts/injector): improve upgrade directions for cert reinstallation #125

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ff33f7e
refactor(charts/injector): cert expiration detection and automatic re…
sheldonhull Aug 9, 2024
d562c08
refactor(charts/injector): improve self-signed certificate expiration…
sheldonhull Aug 9, 2024
e0b51cf
refactor(charts/injector): improve self-signed certificate expiration…
sheldonhull Aug 10, 2024
d34b6c1
refactor(helm): simplify webhook tls handling and cleanup unused configs
sheldonhull Aug 12, 2024
ee8368b
fix(injector): replace fmt errors with standard errors package
sheldonhull Aug 12, 2024
f91785b
chore(trunk): 🔧 adjust trunk linter configs [skip ci]
sheldonhull Aug 12, 2024
ce8dc9e
chore(docs): update changelog, version bumps, cleanup [skip ci]
sheldonhull Aug 12, 2024
a583b87
chore(lint): tweak markdownlint rules [skip ci]
sheldonhull Aug 12, 2024
171aa7a
feat(charts): ✨ update dsv-injector and dsv-syncer helm charts with e…
sheldonhull Aug 12, 2024
f8c6437
refactor(injector): simplify config by removing unused cert and key f…
sheldonhull Aug 12, 2024
d4fd760
chore(markdown): 💅 update lint config [skip ci]
sheldonhull Aug 12, 2024
d67cc5f
chore(assets): simplify svg structure for better readability [skip ci]
sheldonhull Aug 12, 2024
fb09a30
chore(lint): update golangci config [skip ci]
sheldonhull Aug 12, 2024
9b74ec6
feat(injector): add tls cert and key paths, update go deps
sheldonhull Aug 12, 2024
a2aeb1b
refactor(injector): align struct tags for readability
sheldonhull Aug 12, 2024
d3d1899
chore(config): update node version [skip ci]
sheldonhull Aug 12, 2024
ccc3096
chore(docs): update svg files [skip ci]
sheldonhull Aug 12, 2024
ec75992
chore(docs): update svg markup [skip ci]
sheldonhull Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .changes/unreleased/🤖 CI & Build-20240608-002754.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions .changes/v1.2.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## v1.2.3 - 2024-08-12


### 🤖 CI & Build

- Add a buildName metadata to binary so easy to see if caching issue with container loading. Handle `dev.local/dsv-k8s` as standard image name to better reflect standard approach I've been using. Improve validation checks. Goreleaser upgrade schema and more. Lots of quality of life improvements for dev, and aqua updates.

### 🔨 Refactor

- Improve `values.yml` for the dsv-injector to expose the days till expiration of the self signed cert.
Include minor doc improvements to this as well to better handle.
115 changes: 66 additions & 49 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
---
output:
format: tab
formats:
- format: tab
linters-settings:
misspell:
locale: US
gomnd:
settings:
mnd:
checks: [argument, case, condition, return]
ignored-functions: strconv.ParseFloat,rsa.GenerateKey

nolintlint:
allow-unused: false
allow-leading-space: true
allow-no-explanation: []
require-explanation: true
require-specific: true
gofumpt:
lang-version: '1.18'
extra-rules: true
godox:
keywords:
Expand All @@ -33,45 +28,45 @@ linters-settings:
- ^[ ]*@
capital: true
depguard:
list-type: blacklist
include-go-root: true
includeGoStdLib: true
packages:
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: logging is allowed only by zerolog. Please use zerolog
- io/ioutil: 'io/ioutil was deprecated in Go 1.16: https://tip.golang.org/doc/go1.16'
gomodguard:
blocked:
modules:
- github.com/sirupsen/logrus:
recommendations:
- internal/logging
reason: logging is allowed only by zerolog. Please use zerolog
local_replace_directives: false
rules:
main:
deny:
- pkg: 'github.com/sirupsen/logrus'
desc: use zerolog
- pkg: log
desc: use zerolog
- pkg: 'github.com/pkg/errors'
desc: Should be replaced by standard lib errors package

# gomodguard:
# blocked:
# modules:
# - github.com/sirupsen/logrus:
# recommendations:
# - internal/logging
# reason: logging is allowed only by zerolog. Please use zerolog
# local_replace_directives: false
tagliatelle:
case:
use-field-name: true
rules:
json: kebab
json: snake
yaml: kebab
xml: camel
bson: camel
avro: snake
mapstructure: kebab
errcheck:
check-type-assertions: true
check-blank: false
ignore: fmt:.*,io/ioutil:^Read.*
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- io.Closer.Close
- io.Closer.Body.Close
errcheck:
check-type-assertions: true
check-blank: false
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
- io.Closer.Close
- io.Closer.Body.Close
govet:
enable-all: true
check-shadowing: true
disable:
- fieldalignment
settings:
Expand Down Expand Up @@ -99,18 +94,22 @@ linters-settings:
- ok
- zl
- fs
disable:
- fieldalignment

revive:
ignore-generated-header: true
enableAllRules: true
exclude:
- .*_test.go
enable-all-rules: true
rules:
- name: var-naming
severity: error
- name: line-length-limit
severity: warning
arguments:
- 400
- name: function-length
severity: warning
arguments: [20, 5000]

linters:
exclude-use-default: false
enable-all: true
disable:
- scopelint
Expand Down Expand Up @@ -143,14 +142,12 @@ linters:
- rowserrcheck # disabled due to generics, can enable in future if needed
- sqlclosecheck # disabled due to generics, can enable in future if needed
- wastedassign # disabled due to generics, can enable in future if needed
- funlen #OVERRIDE: ok using for bot, lots of quick long commands i worked on
- cyclop #OVERRIDE: ok using for bot, lots of quick long commands i worked on
- gocognit #OVERRIDE: ok using for bot, lots of quick long commands i worked on

run:
skip-dirs-use-default: true
skip-dirs:
- build
- artifacts
- _tools
- vendor
- vendor$
timeout: 5m
build-tags:
- mage
- tools
Expand Down Expand Up @@ -182,6 +179,17 @@ issues:
- maintidx
- deadcode
- gochecknoglobals
- path: magefile.go
linters:
- goerr113
- wrapcheck
- funlen
- gocyclo
- cyclop
- gocognit
- maintidx
- deadcode
- gochecknoglobals
- linters:
- goerr113
text: magefiles don't need to worry about wrapping in the same way
Expand All @@ -194,3 +202,12 @@ issues:
- godot
text: mocked files do not need to be checked
whole-files: false
exclude-dirs:
- build
- .artifacts
- .cache
- artifacts
- .trunk
- _tools
- vendor
- vendor$
7 changes: 2 additions & 5 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
#https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md#md002
comment: my-markdown-linting-rules

# enable all default tagged rules
default: true
Expand Down Expand Up @@ -43,13 +42,11 @@ MD025: true
# This is for maintainability and code diffs.
# Try applying semantic line break concept for breaking up longer phrases
# https://sembr.org/
MD013:
line_length: 200
MD013: false

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
# This tweaks to allow nested items to have duplicate headers.
MD024:
# Only check sibling headings
allow_different_nesting: true
# Only check sibling headings
siblings_only: true
MD034: false
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.15.0
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ lint:
- linters: [gitleaks]
level: high
disabled:
- gokart
- cspell
- gofmt
enabled:
- checkov@3.2.128
- gokart@0.5.1
- osv-scanner@1.7.4
- terrascan@1.19.1
- trivy@0.52.0
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).

## v1.2.3 - 2024-08-12

### 🤖 CI & Build

- Add a buildName metadata to binary so easy to see if caching issue with container loading. Handle `dev.local/dsv-k8s` as standard image name to better reflect standard approach I've been using. Improve validation checks. Goreleaser upgrade schema and more. Lots of quality of life improvements for dev, and aqua updates.

### 🔨 Refactor

- Improve `values.yml` for the dsv-injector to expose the days till expiration of the self signed cert.
Include minor doc improvements to this as well to better handle.

## v1.2.2 - 2024-01-15

### ⬆️ Dependencies
Expand Down
36 changes: 33 additions & 3 deletions charts/dsv-injector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: |
NAMESPACE='dsv'
CREDENTIALS_JSON_FILE='.cache/credentials.json' # replace with your credentials file
IMAGE_REPOSITORY='docker.io/delineaxpm/dsv-k8s'
IMAGE_TAG='v1.2.2' # use latest for test, but pin to a specific version for production
IMAGE_TAG='v1.2.3' # use latest for test, but pin to a specific version for production

helm install \
--namespace $NAMESPACE \
Expand All @@ -18,18 +18,48 @@ description: |
--set image.tag=${IMAGE_TAG} \
--atomic \
--timeout "5m" \
--debug -v4 \ # optional --values ./myvaluesfile/values.yaml \
--debug -v4 \ # optional for local test iteration --values .cache/charts/dsv-injector/values.yaml \
dsv-injector ./charts/dsv-injector
```

An upgrade to the existing deployment can be done with:

```shell
helm upgrade \
--namespace $NAMESPACE \
--atomic \
--timeout "5m" \
--debug -v4 \
dsv-injector ./charts/dsv-injector
```

To upgrade, ensuring that the current self signed cert that is deployed by default (if not using your own CA), run the commands below to ensure the prior hook and secret are removed so they can be recreated with the newly generated cert.

```shell
kubectl --namespace $NAMESPACE delete mutatingwebhookconfiguration dsv-injector \
&& kubectl --namespace $NAMESPACE delete secret --timeout "5m" dsv-injector-tls \
&& helm upgrade \
--namespace $NAMESPACE \
--atomic \
--timeout "5m" \
--debug -v4 \
dsv-injector ./charts/dsv-injector
```

To uninstall the deployment, you can run:

```shell
helm uninstall --namespace $NAMESPACE dsv-injector
```

keywords:
- Delinea
- DevOps
- DSV
- secrets
- vault
type: application
version: v1.2.2
version: v1.2.3
appVersion: latest
maintainers:
- name: Sheldon Hull
Expand Down
Loading