Skip to content

Commit 25b9516

Browse files
authored
Update installer logic and tagged version (#71)
* update installer logic and tagged version * update versions and hashes
1 parent 8f6800c commit 25b9516

File tree

5 files changed

+108
-67
lines changed

5 files changed

+108
-67
lines changed

Dockerfile

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
################################
2-
# UI Builder #
3-
#################################
4-
FROM node:14.17-alpine3.13 AS client-builder
5-
6-
WORKDIR /ui
7-
8-
# cache packages in layer
9-
COPY ui/package.json /ui/package.json
10-
COPY ui/package-lock.json /ui/package-lock.json
11-
RUN --mount=type=cache,target=/usr/src/app/.npm \
12-
npm set cache /usr/src/app/.npm && \
13-
npm ci
14-
15-
# build
16-
COPY ui /ui
17-
RUN npm run build
18-
19-
201
#################################
212
# Downloader for AMD64 binaries #
223
#################################
@@ -25,24 +6,24 @@ FROM alpine as downloader-amd64
256
RUN apk add --no-cache wget coreutils unzip
267

278
# https://github.com/helm/helm/releases
28-
ARG HELM_VERSION=3.12.2
9+
ARG HELM_VERSION=3.17.1
2910

30-
# https://get.helm.sh/helm-v3.12.2-darwin-amd64.tar.gz.sha256sum
31-
ARG HELM_CHECKSUM_DARWIN_AMD64=6e8bfc84a640e0dc47cc49cfc2d0a482f011f4249e2dff2a7e23c7ef2df1b64e
32-
# https://get.helm.sh/helm-v3.12.2-linux-amd64.tar.gz.sha256sum
33-
ARG HELM_CHECKSUM_LINUX_AMD64=2b6efaa009891d3703869f4be80ab86faa33fa83d9d5ff2f6492a8aebe97b219
34-
# https://get.helm.sh/helm-v3.12.2-windows-amd64.zip.sha256sum
35-
ARG HELM_CHECKSUM_WINDOWS_AMD64=35dc439baad85728dafd2be0edd4721ae5b770c5cf72c3adf9558b1415a9cae6
11+
# https://get.helm.sh/helm-v3.17.1-darwin-amd64.tar.gz.sha256sum
12+
ARG HELM_CHECKSUM_DARWIN_AMD64=aba59ba9511971a71943b5c76f15d52ace1681197bb3f71ed1f0b15caceacb2c
13+
# https://get.helm.sh/helm-v3.17.1-linux-amd64.tar.gz.sha256sum
14+
ARG HELM_CHECKSUM_LINUX_AMD64=3b66f3cd28409f29832b1b35b43d9922959a32d795003149707fea84cbcd4469
15+
# https://get.helm.sh/helm-v3.17.1-windows-amd64.zip.sha256sum
16+
ARG HELM_CHECKSUM_WINDOWS_AMD64=08281ee6d4d272835ff10c510b8b39736d112d9cb89dfbc853fe83913fbe48d0
3617

3718
# https://www.downloadkubernetes.com/
38-
ARG KUBECTL_VERSION=1.25.9
19+
ARG KUBECTL_VERSION=1.29.5
3920

40-
# https://dl.k8s.io/v1.25.9/bin/darwin/amd64/kubectl.sha256
41-
ARG KUBECTL_CHECKSUM_DARWIN_AMD64=a7a8af548747a6a059b0351a6b8af2ccd2c9726c650732e69059c0635cee5c6b
42-
# https://dl.k8s.io/v1.23.4/bin/linux/amd64/kubectl.sha256
43-
ARG KUBECTL_CHECKSUM_LINUX_AMD64=aaa5ea3b3630730d2b8a8ef3cccb14b47754602c7207c7b0717158ae83c7cb10
44-
# https://dl.k8s.io/v1.25.9/bin/windows/amd64/kubectl.exe.sha256
45-
ARG KUBECTL_CHECKSUM_WINDOWS_AMD64=ed404eb0c3b74341d2ff799e78f9c0352e2bbd5c1b645652de2725ec77c0a78e
21+
# https://dl.k8s.io/v1.29.5/bin/darwin/amd64/kubectl.sha256
22+
ARG KUBECTL_CHECKSUM_DARWIN_AMD64=395082ef84594ea4cb170d599056406ed2cf39555b53e92e0caee013c1ed5cdf
23+
# https://dl.k8s.io/v1.29.5/bin/linux/amd64/kubectl.sha256
24+
ARG KUBECTL_CHECKSUM_LINUX_AMD64=603c8681fc0d8609c851f9cc58bcf55eeb97e2934896e858d0232aa8d1138366
25+
# https://dl.k8s.io/v1.29.5/bin/windows/amd64/kubectl.exe.sha256
26+
ARG KUBECTL_CHECKSUM_WINDOWS_AMD64=8de419ccecdde90172345e7d12a63de42c217d28768d84c2398d932b44d73489
4627

4728
# https://github.com/epinio/epinio/releases
4829
ARG EPINIO_VERSION=1.11.0
@@ -97,20 +78,20 @@ FROM alpine as downloader-arm64
9778
RUN apk add --no-cache wget coreutils unzip
9879

9980
# https://github.com/helm/helm/releases
100-
ARG HELM_VERSION=3.12.2
81+
ARG HELM_VERSION=3.17.1
10182

102-
# https://get.helm.sh/helm-v3.12.2-darwin-arm64.tar.gz.sha256sum
103-
ARG HELM_CHECKSUM_DARWIN_ARM64=b60ee16847e28879ae298a20ba4672fc84f741410f438e645277205824ddbf55
104-
# https://get.helm.sh/helm-v3.12.2-linux-arm64.tar.gz.sha256sum
105-
ARG HELM_CHECKSUM_LINUX_ARM64=cfafbae85c31afde88c69f0e5053610c8c455826081c1b2d665d9b44c31b3759
83+
# https://get.helm.sh/helm-v3.17.1-darwin-arm64.tar.gz.sha256sum
84+
ARG HELM_CHECKSUM_DARWIN_ARM64=b823a213d8d7937222becc63d9c7bb3d15a090e7ecd1f70f3a583ed39657e21b
85+
# https://get.helm.sh/helm-v3.17.1-linux-arm64.tar.gz.sha256sum
86+
ARG HELM_CHECKSUM_LINUX_ARM64=c86c9b23602d4abbfae39d9634e25ab1d0ea6c4c16c5b154113efe316a402547
10687

10788
# https://www.downloadkubernetes.com/
108-
ARG KUBECTL_VERSION=1.25.9
89+
ARG KUBECTL_VERSION=1.29.5
10990

110-
# https://dl.k8s.io/v1.25.9/bin/darwin/arm64/kubectl.sha256
111-
ARG KUBECTL_CHECKSUM_DARWIN_ARM64=4166d293b4f58e5293363f1f91a285d929a54557bf0c1a1ae22243ef24a0f58a
112-
# https://dl.k8s.io/v1.25.9/bin/linux/arm64/kubectl.sha256
113-
ARG KUBECTL_CHECKSUM_LINUX_ARM64=741e65b681a22074aaf9459b57dbcef6a9e993472b3019a87f57c191bc68575f
91+
# https://dl.k8s.io/v1.29.5/bin/darwin/arm64/kubectl.sha256
92+
ARG KUBECTL_CHECKSUM_DARWIN_ARM64=23b09c126c0a0b71b58cc725a32cf84f1753242b3892dfd762511f2da6cce165
93+
# https://dl.k8s.io/v1.29.5/bin/linux/arm64/kubectl.sha256
94+
ARG KUBECTL_CHECKSUM_LINUX_ARM64=9ee9168def12ac6a6c0c6430e0f73175e756ed262db6040f8aa2121ad2c1f62e
11495

11596
# https://github.com/epinio/epinio/releases
11697
ARG EPINIO_VERSION=1.11.0
@@ -145,6 +126,23 @@ RUN wget -nv https://github.com/epinio/epinio/releases/download/v${EPINIO_VERSIO
145126

146127
FROM downloader-$TARGETARCH AS downloader
147128

129+
################################
130+
# UI Builder #
131+
#################################
132+
FROM node:14.17-alpine3.13 AS client-builder
133+
134+
WORKDIR /ui
135+
136+
# cache packages in layer
137+
COPY ui/package.json /ui/package.json
138+
COPY ui/package-lock.json /ui/package-lock.json
139+
RUN --mount=type=cache,target=/usr/src/app/.npm \
140+
npm set cache /usr/src/app/.npm && \
141+
npm ci
142+
143+
# build
144+
COPY ui /ui
145+
RUN npm run build
148146

149147
#################################
150148
# Final image #
@@ -153,7 +151,7 @@ FROM scratch
153151

154152
LABEL org.opencontainers.image.title="Epinio" \
155153
org.opencontainers.image.description="Push from source to Kubernetes in one step" \
156-
org.opencontainers.image.vendor="Rancher by SUSE" \
154+
org.opencontainers.image.vendor="Epinio by Krumware and SUSE" \
157155
com.docker.desktop.extension.icon="https://epinio.io/images/icon-epinio.svg" \
158156
com.docker.extension.publisher-url="https://epinio.io" \
159157
com.docker.extension.screenshots='[{"alt": "Epinio after Installation", "url": "https://epinio.io/images/epinio-docker-desktop-screenshot.png"}]' \

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,13 @@ To install on Rancher Desktop, use the Rancher Desktop CLI `rdctl`.
5252
* `Dockerfile `(download CLI, 2x `ARG EPINIO_VERSION`)
5353
* `ui/src/epinio/Installer.js` (helm chart, 1x `epinio/helm-charts/releases`)
5454
* `ui/src/App.js` (download endpoint, 2nd `DownloadIcon`)
55+
56+
### Troubleshooting
57+
58+
If having trouble installing Epinio, you may need to install it manually.
59+
60+
```
61+
helm upgrade --install epinio --create-namespace --namespace epinio --atomic --set global.domain=localdev.me https://github.com/epinio/helm-charts/releases/download/epinio-1.11.1/epinio-1.11.1.tgz
62+
```
63+
64+
If you receive a "Error: no cached repo found (try 'helm repo update')" error, you may need to try `helm repo update` first.

ui/.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
'react'
2323
],
2424
rules: {
25+
'no-unused-vars': 'off',
2526
'no-undef': 'off',
2627
'space-before-function-paren': [
2728
'error',

ui/src/KubernetesCheck.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ class KubernetesCheck extends React.Component {
2626

2727
async check() {
2828
try {
29-
const result = await window.ddClient.extension.host.cli.exec('kubectl', ['get', 'nodes', '-o', 'json'])
29+
const result = await window.ddClient.extension.host.cli.exec('kubectl', ['config', 'current-context'])
3030

31-
const obj = result.parseJsonObject()
32-
if (obj.items.length < 1) {
33-
this.setRunning(false, '', 'no nodes found in cluster')
31+
if (result.stderr.length > 0) {
32+
console.log(result.stderr)
33+
}
34+
if (result.stdout.length === 0) {
35+
this.setRunning(false, '', 'no kube context found')
3436
return
3537
}
3638

37-
const node = obj.items[0].metadata.name
39+
const node = result.stdout.trimEnd()
3840
this.setRunning(true, node, '')
3941
} catch (error) {
4042
if (error instanceof Error) {
@@ -55,13 +57,13 @@ class KubernetesCheck extends React.Component {
5557
}
5658

5759
function KubernetesOK(props) {
58-
if (props.node === 'docker-desktop') {
60+
if (props.node.endsWith('-desktop')) {
5961
return null
6062
}
6163

6264
return <Alert severity="info">
63-
Kubernetes is running, however you are not connected to a Docker Desktop node.
64-
The &quot;Install&quot; button might not work with other clusters.
65+
Kubernetes is running, however you are not connected to a Docker Desktop or Rancher Desktop node.
66+
The &quot;Install&quot; button might not work with other contexts.
6567
</Alert>
6668
}
6769

ui/src/epinio/Installer.js

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export default function EpinioInstaller({
1414
const helm = async (args) => {
1515
const result = await window.ddClient.extension.host.cli.exec('helm', args)
1616
console.debug(JSON.stringify(result))
17-
1817
if (result.stderr) {
1918
throw Error(result?.stderr)
2019
}
@@ -44,11 +43,13 @@ export default function EpinioInstaller({
4443
if (result.includes('STATUS: uninstalling')) {
4544
console.debug('uninstalling epinio release')
4645

46+
// alert('epinio not yet installed')
4747
setInstalled(null)
4848
} else {
4949
setInstalled(true)
5050
}
5151
} catch (error) {
52+
// alert('epinio check error' + error)
5253
setInstalled(false)
5354
}
5455
}
@@ -57,23 +58,31 @@ export default function EpinioInstaller({
5758
isEpinioInstalled()
5859
setInterval(async () => {
5960
await isEpinioInstalled()
60-
}, 3000)
61+
}, 10000)
6162
}
6263

6364
async function install() {
6465
try {
6566
setProgress(10)
66-
const isInstalled = await checkTraefik()
67-
if (!isInstalled) {
67+
const isTraefikInstalled = await checkTraefik()
68+
// alert(`Traefik is installed ${isTraefikInstalled}`)
69+
// todo: prompt for optional installation of traefik
70+
if (!isTraefikInstalled) {
71+
// alert('Traefik is not installed, installing')
6872
await installTraefik()
6973
}
7074
setProgress(30)
7175

76+
const isCertManagerInstalled = await checkCertManager()
77+
// alert(`CertManager is installed ${isCertManagerInstalled}`)
7278
setProgress(40)
73-
await installCertManager()
79+
if (!isCertManagerInstalled) {
80+
await installCertManager()
81+
}
7482
setProgress(50)
7583

7684
setProgress(60)
85+
// todo: Handle repo not found and "Error: no cached repo found (try 'helm repo update')"
7786
await installEpinio()
7887
setProgress(100)
7988

@@ -84,12 +93,13 @@ export default function EpinioInstaller({
8493
onInstallationChanged(false)
8594

8695
let message = 'Error installing Epinio'
96+
// todo: Fix error message reflection. It appears as though stderr is not being captured.
8797
if (error.stderr) {
8898
message = error.stderr
8999
}
90-
console.error(error)
100+
// alert(error)
91101

92-
onError(message)
102+
onError(message + '. \n' + error)
93103
} finally {
94104
setProgress(0)
95105
}
@@ -101,12 +111,14 @@ export default function EpinioInstaller({
101111
await uninstallEpinio()
102112
setProgress(25)
103113

114+
// todo: prompt for optional uninstallation of cert-manager
104115
setProgress(30)
105-
await uninstallCertManager()
116+
// await uninstallCertManager()
106117
setProgress(50)
107118

119+
// todo: prompt for optional uninstallation of traefik
108120
setProgress(60)
109-
await uninstallTraefik()
121+
// await uninstallTraefik()
110122
setProgress(100)
111123

112124
onInstallationChanged(true)
@@ -137,40 +149,58 @@ export default function EpinioInstaller({
137149
const installTraefik = async () => {
138150
console.log('installing traefik chart')
139151

140-
await helm([
152+
const result = await helm([
141153
'upgrade', '--install', '--atomic', 'traefik',
142154
'--create-namespace', '--namespace', 'ingress-traefik',
143155
'https://traefik.github.io/charts/traefik/traefik-19.0.3.tgz'
144156
])
145157

158+
// alert(JSON.stringify(result))
146159
console.log('installed: traefik')
147160
}
148161

162+
const checkCertManager = async () => {
163+
console.log('checking traefik installation')
164+
165+
const result = await kubectl([
166+
'get', 'deployment', '-A',
167+
'-l', 'app.kubernetes.io/name=cert-manager',
168+
'-o', 'json'
169+
])
170+
171+
const isInstalled = result.items.length > 0
172+
console.log(`cert-manager already installed: ${isInstalled}`)
173+
174+
return isInstalled
175+
}
176+
149177
const installCertManager = async () => {
150178
console.log('installing cert-manager chart')
151-
152-
await helm([
179+
// alert('installing cert-manager')
180+
const result = await helm([
153181
'upgrade', '--install', '--atomic', 'cert-manager',
154182
'--create-namespace', '--namespace', 'cert-manager',
155183
'--set', 'installCRDs=true',
156184
'--set', 'extraArgs[0]=--enable-certificate-owner-ref=true',
157185
'https://charts.jetstack.io/charts/cert-manager-v1.9.1.tgz'
158186
])
159187

188+
// alert(JSON.stringify(result))
160189
console.log('installed: cert-manager')
161190
}
162191

163192
const installEpinio = async () => {
164193
console.log('installing epinio chart')
165194

166-
await helm([
195+
// alert('installing epinio')
196+
const output = await helm([
167197
'upgrade', '--install', 'epinio',
168198
'--create-namespace', '--namespace', 'epinio',
169199
'--atomic',
170200
'--set', 'global.domain=' + domain,
171-
'https://github.com/epinio/helm-charts/releases/download/epinio-1.11.0/epinio-1.11.0.tgz'
201+
'https://github.com/epinio/helm-charts/releases/download/epinio-1.11.1/epinio-1.11.1.tgz'
172202
])
173-
203+
// alert(JSON.stringify(output))
174204
console.log('installed: epinio')
175205
}
176206

0 commit comments

Comments
 (0)