Skip to content

Commit

Permalink
Upgrade the VS Code image
Browse files Browse the repository at this point in the history
  • Loading branch information
luxas committed May 5, 2022
1 parent 429c57e commit a68c747
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 54 deletions.
44 changes: 2 additions & 42 deletions charts/core-workshop-infra/templates/code-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,6 @@ metadata:
name: code-server
namespace: workshopctl
---
apiVersion: v1
kind: ConfigMap
metadata:
name: code-server
namespace: workshopctl
labels:
app: code-server
data:
config: |-
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
server: https://kubernetes.default
name: default
contexts:
- context:
cluster: default
namespace: default
user: default
name: default
current-context: default
users:
- name: default
user:
tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -64,8 +36,8 @@ spec:
spec:
serviceAccountName: code-server
containers:
- image: luxas/k8s-web-ide:v2.1.1
# TODO: In the future: ghcr.io/cloud-native-nordics/k8s-web-ide:v0.2.0
- image: luxas/k8s-web-ide:v4.3.0
# TODO: In the future: ghcr.io/cloud-native-nordics/k8s-web-ide:v4.3.0
imagePullPolicy: Always
name: code-server
ports:
Expand All @@ -87,18 +59,6 @@ spec:
secretKeyRef:
name: workshopctl
key: CLUSTER_PASSWORD
volumeMounts:
- name: kubeconfig
mountPath: /home/coder/.kube
- name: docker
mountPath: /var/run/docker.sock
volumes:
- name: kubeconfig
configMap:
name: code-server
- name: docker
hostPath:
path: /var/run/docker.sock
---
apiVersion: v1
kind: Service
Expand Down
1 change: 1 addition & 0 deletions charts/kubernetes-dashboard/external-chart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://kubernetes.github.io/dashboard/kubernetes-dashboard
13 changes: 13 additions & 0 deletions charts/kubernetes-dashboard/values-override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
metricsScraper:
enabled: true

metrics-server:
enabled: true

ingress:
enabled: true
annotations:
external-dns.alpha.kubernetes.io/ttl: "30s"
className: traefik
hosts:
- "dashboard.{{ .workshopctl.CLUSTER_DOMAIN }}"
File renamed without changes.
12 changes: 7 additions & 5 deletions images/k8s-web-ide/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This image has VS Code v1.50.0
FROM codercom/code-server:3.6.1
# This image has VS Code v1.65.2, built 2022-04-14
FROM codercom/code-server:4.3.0

# Install needed utilities, e.g. Git is essential for the IDE
USER root
Expand All @@ -8,17 +8,17 @@ RUN apt-get update && \
git \
curl \
nano \
docker.io && \
jq && \
apt-get clean

# Install kubectl
ENV K8S_VERSION=v1.18.10
ENV K8S_VERSION=v1.22.8
RUN curl -sSL https://dl.k8s.io/release/${K8S_VERSION}/bin/linux/amd64/kubectl > /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl

# Install helm
ENV HELM_HOME=/root/.helm
ENV HELM_VERSION=v3.4.0
ENV HELM_VERSION=v3.8.2
RUN curl -sSL https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz | sudo tar -xz -C /usr/local/bin linux-amd64/helm --strip-components=1

USER coder
Expand All @@ -30,5 +30,7 @@ RUN for ext in ${EXTENSIONS}; do code-server --install-extension ${ext}; done

COPY --chown=coder:coder entrypoint.sh /
COPY --chown=coder:coder settings.json /home/coder/.local/share/code-server/User/settings.json
COPY --chown=coder:coder kubeconfig.yaml /home/coder/.kube/config
COPY --chown=coder:coder .bash_aliases /home/coder/.bash_aliases

ENTRYPOINT ["dumb-init", "/entrypoint.sh"]
2 changes: 1 addition & 1 deletion images/k8s-web-ide/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=v2.1.1
VERSION=v4.3.0
all: build
build:
docker build --pull -t luxas/k8s-web-ide:$(VERSION) .
Expand Down
4 changes: 1 addition & 3 deletions images/k8s-web-ide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ A Docker image that builds upon [cdr/code-server](https://github.com/cdr/code-se

- `kubectl` -- the Kubernetes CLI
- `helm` -- the Kubernetes package manager
- `docker` -- the Docker client in order to be able to push and pull images
- Kubernetes syntax highlighting for YAML files (from the [YAML VSCode extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml))
- Docker integration available to see images, containers, etc. (from the [Docker VSCode extension](https://github.com/microsoft/vscode-docker/tree/v0.6.2/))
- Common development utilities -- `curl`, `nano` and `git`
- Common development utilities -- `curl`, `nano`, `jq`, and `git`
2 changes: 0 additions & 2 deletions images/k8s-web-ide/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ if [[ ${TUTORIALS_REPO} != "" ]]; then
DEFAULT_DIRECTORY="/home/coder/project"
fi

sudo chown $(id -u):$(id -g) /var/run/docker.sock

# By default run behind a Let's Encrypt proxy, so expose this traffic using insecure HTTP
exec code-server --host=0.0.0.0 --auth=password --disable-telemetry ${DEFAULT_DIRECTORY}
18 changes: 18 additions & 0 deletions images/k8s-web-ide/kubeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: Config
clusters:
- cluster:
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
server: https://kubernetes.default
name: default
contexts:
- context:
cluster: default
namespace: default
user: default
name: default
current-context: default
users:
- name: default
user:
tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
3 changes: 2 additions & 1 deletion images/k8s-web-ide/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"yaml.schemas": {
"kubernetes": "*.yaml"
},
"workbench.colorTheme": "Default Dark+"
"workbench.colorTheme": "Default Dark+",
"redhat.telemetry.enabled": false
}

0 comments on commit a68c747

Please sign in to comment.