Skip to content
Open
Changes from all commits
Commits
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
119 changes: 94 additions & 25 deletions template/ubuntu-sshd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,59 @@ kind: Template
metadata:
name: ubuntu-sshd
spec:
title: 'docker-ubuntu-sshd'
url: 'https://github.com/takeyamajp/docker-ubuntu-sshd'
gitRepo: 'https://github.com/takeyamajp/docker-ubuntu-sshd'
author: 'Sealos'
description: 'Ubuntu image with SSH & SFTP'
readme: 'https://github.com/takeyamajp/docker-ubuntu-sshd/blob/master/README.md'
icon: 'https://avatars.githubusercontent.com/u/11237572?s=48&v=4'
title: sshd-web
url: https://github.com/PandaaKai/sshd-web
gitRepo: https://github.com/PandaaKai/sshd-web
author: Sealos
description: sshd-web
readme: https://github.com/PandaaKai/sshd-web/blob/main/README.md
icon: https://zhieasy.oss-cn-hangzhou.aliyuncs.com/zhiyilogo.jpg
templateType: inline
categories:
- tool
defaults:
app_name:
type: string
value: ubuntu-sshd-${{ random(8) }}
app_host:
type: string
value: ${{ random(8) }}
inputs:
IMAGE_TAG:
description: 'tag with takeyamajp/ubuntu-sshd'
PORT:
description: port
type: string
default: 'ubuntu22.04'
default: "8080"
required: true
ROOT_PASSWORD:
description: 'root password'
description: root password
type: string
default: 'root@qmywad'
default: root@sadazxc
required: true
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ${{ defaults.app_name }}
data:
default: |-
server {
listen 80;
server_name _;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;

proxy_pass http://localhost:${{ inputs.PORT }};
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${{ defaults.app_name }}
annotations:
originImageName: takeyamajp/ubuntu-sshd
originImageName: registry.cn-hangzhou.aliyuncs.com/pandak/ssh:latest
deploy.cloud.sealos.io/minReplicas: '1'
deploy.cloud.sealos.io/maxReplicas: '1'
labels:
Expand All @@ -46,20 +67,14 @@ spec:
selector:
matchLabels:
app: ${{ defaults.app_name }}
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
maxSurge: 0
template:
metadata:
labels:
app: ${{ defaults.app_name }}
spec:
automountServiceAccountToken: false
containers:
- name: ubuntu-sshd
image: takeyamajp/ubuntu-sshd:${{ inputs.IMAGE_TAG }}
- name: ${{ defaults.app_name }}
image: registry.cn-hangzhou.aliyuncs.com/pandak/ssh:latest
resources:
requests:
cpu: 100m
Expand All @@ -72,11 +87,21 @@ spec:
env:
- name: ROOT_PASSWORD
value: ${{ inputs.ROOT_PASSWORD }}
- name: WEB_PORT
value: ${{ inputs.PORT }}
ports:
- containerPort: 22
name: sshd
- containerPort: 80
name: web
imagePullPolicy: Always
volumeMounts: []
volumes: []
volumeMounts:
- name: default
mountPath: /etc/nginx/sites-available
volumes:
- name: default
configMap:
name: ${{ defaults.app_name }}
---
apiVersion: v1
kind: Service
Expand All @@ -89,5 +114,49 @@ spec:
ports:
- port: 22
targetPort: 22
name: sshd
- port: 80
targetPort: 80
name: web
selector:
app: ${{ defaults.app_name }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ${{ defaults.app_name }}
labels:
cloud.sealos.io/app-deploy-manager: ${{ defaults.app_name }}
cloud.sealos.io/app-deploy-manager-domain: ${{ defaults.app_host }}
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/proxy-body-size: 32m
nginx.ingress.kubernetes.io/server-snippet: |
client_header_buffer_size 64k;
large_client_header_buffers 4 128k;
nginx.ingress.kubernetes.io/ssl-redirect: 'false'
nginx.ingress.kubernetes.io/backend-protocol: HTTP
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/client-body-buffer-size: 64k
nginx.ingress.kubernetes.io/proxy-buffer-size: 64k
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($request_uri ~* \.(js|css|gif|jpe?g|png)) {
expires 30d;
add_header Cache-Control "public";
}
spec:
rules:
- host: ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
http:
paths:
- pathType: Prefix
path: /
backend:
service:
name: ${{ defaults.app_name }}
port:
number: 80
tls:
- hosts:
- ${{ defaults.app_host }}.${{ SEALOS_CLOUD_DOMAIN }}
secretName: ${{ SEALOS_CERT_SECRET_NAME }}