Skip to content

Commit

Permalink
override sidecar image
Browse files Browse the repository at this point in the history
  • Loading branch information
qrkourier committed Jan 21, 2025
1 parent b9f400e commit 9ffcdb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,21 @@ jobs:
shell: bash
env:
ZITI_AGENT_IMAGE: netfoundry/ziti-k8s-agent:${{ github.run_id }}
ZITI_AGENT_NAMESPACE: ziti # must be new because of the way this test is written
ZITI_AGENT_NAMESPACE: ziti-agent # this test assumes the namespace does not exist and will be created during the test
ZITI_AGENT_LOG_LEVEL: 4
SIDECAR_IMAGE: ${{ vars.SIDECAR_IMAGE || 'docker.io/openziti/ziti-tunnel' }}
SIDECAR_IMAGE_VERSION: ${{ vars.SIDECAR_IMAGE_VERSION || 'latest' }}
run: |
set -o pipefail
set -o xtrace
# run the shell script to generate the k8s manifests, consuming env vars as configuration
# IDENTITY_FILE exported in prior step create-nf-network-services
# ZITI_AGENT_IMAGE exported in this step environment
# ZITI_AGENT_NAMESPACE exported in this step environment
# ZITI_AGENT_LOG_LEVEL exported in this step environment
# SIDECAR_IMAGE exported in this step environment
# SIDECAR_IMAGE_VERSION exported in this step environment
SIDECAR_SELECTORS=namespace \
./generate-ziti-agent-manifest.bash > ziti-k8s-agent-namespace-selector.yaml
SIDECAR_SELECTORS=pod \
Expand Down
4 changes: 3 additions & 1 deletion generate-ziti-agent-manifest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ spec:
- containerPort: 9443
args:
- webhook
- --v=2
- --v=${ZITI_AGENT_LOG_LEVEL:-2}
- --sidecar-image="${SIDECAR_IMAGE:-docker.io/openziti/ziti-tunnel}"
- --sidecar-image-version="${SIDECAR_IMAGE_VERSION:-latest}"
env:
- name: TLS_CERT
valueFrom:
Expand Down
3 changes: 3 additions & 0 deletions ziti-agent/cmd/webhook/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var (
sidecarImage string
sidecarImageVersion string
sidecarPrefix string
sidecarIdentityDir string
zitiCtrlMgmtApi string
zitiCtrlClientCertFile string
zitiCtrlClientKeyFile string
Expand Down Expand Up @@ -52,6 +53,8 @@ and takes appropriate actions, i.e. create/delete ziti identity, secret, etc.`,
"Image Varsion of sidecar")
webhookCmd.Flags().StringVar(&sidecarPrefix, "sidecar-prefix", "zt",
"Used in creation of ContainerName to be used as injected sidecar")
webhookCmd.Flags().StringVar(&sidecarIdentityDir, "sidecar-identity-dir", "/ziti-tunnel",
"Directory where sidecar container will store identity files")
webhookCmd.Flags().StringVar(&zitiCtrlMgmtApi, "ziti-ctrl-addr", "",
"Ziti Controller Management URL, i.e. https://{FQDN}:{PORT}/edge/management/v1 ")
webhookCmd.Flags().StringVar(&zitiCtrlClientCertFile, "ziti-ctrl-client-cert-file", "",
Expand Down

0 comments on commit 9ffcdb3

Please sign in to comment.