-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9827bbb
commit f74c9df
Showing
8 changed files
with
246 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
180 changes: 90 additions & 90 deletions
180
sky/templates/kubernetes-sshjump.yml.j2 → sky/templates/kubernetes-ssh-jump.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,90 +1,90 @@ | ||
pod_spec: | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ name }} | ||
labels: | ||
component: {{ name }} | ||
parent: skypilot | ||
spec: | ||
serviceAccountName: sky-sshjump-sa | ||
volumes: | ||
- name: secret-volume | ||
secret: | ||
secretName: {{ secret }} | ||
containers: | ||
- name: {{ name }} | ||
imagePullPolicy: Always | ||
image: {{ image }} | ||
command: ["python3", "-u", "/skypilot/sky/utils/kubernetes/sshjump_lcm.py"] | ||
ports: | ||
- containerPort: 22 | ||
volumeMounts: | ||
- name: secret-volume | ||
readOnly: true | ||
mountPath: /etc/secret-volume | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: ["/bin/bash", "-c", "mkdir -p ~/.ssh && cp /etc/secret-volume/ssh-publickey ~/.ssh/authorized_keys && sudo service ssh restart"] | ||
env: | ||
- name: MY_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: MY_POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: ALERT_THRESHOLD | ||
# seconds | ||
value: "600" | ||
- name: RETRY_INTERVAL | ||
# seconds | ||
value: "60" | ||
terminationGracePeriodSeconds: 0 | ||
service_spec: | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ name }} | ||
labels: | ||
parent: skypilot | ||
spec: | ||
type: {{ service_type }} | ||
selector: | ||
component: {{ name }} | ||
ports: | ||
- protocol: TCP | ||
port: 22 | ||
targetPort: 22 | ||
# The following ServiceAccount/Role/RoleBinding sets up an RBAC for life cycle | ||
# management of the jump pod/service | ||
service_account: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: sky-sshjump-sa | ||
parent: skypilot | ||
role: | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: sky-sshjump-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "pods/status", "pods/exec", "services"] | ||
verbs: ["get", "list", "create", "delete"] | ||
role_binding: | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: sky-sshjump-rb | ||
parent: skypilot | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sky-sshjump-sa | ||
roleRef: | ||
kind: Role | ||
name: sky-sshjump-role | ||
apiGroup: rbac.authorization.k8s.io | ||
pod_spec: | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ name }} | ||
labels: | ||
component: {{ name }} | ||
parent: skypilot | ||
spec: | ||
serviceAccountName: sky-ssh-jump-sa | ||
volumes: | ||
- name: secret-volume | ||
secret: | ||
secretName: {{ secret }} | ||
containers: | ||
- name: {{ name }} | ||
imagePullPolicy: Always | ||
image: {{ image }} | ||
command: ["python3", "-u", "/skypilot/sky/utils/kubernetes/ssh_jump_lifecycle_manager.py"] | ||
ports: | ||
- containerPort: 22 | ||
volumeMounts: | ||
- name: secret-volume | ||
readOnly: true | ||
mountPath: /etc/secret-volume | ||
lifecycle: | ||
postStart: | ||
exec: | ||
command: ["/bin/bash", "-c", "mkdir -p ~/.ssh && cp /etc/secret-volume/ssh-publickey ~/.ssh/authorized_keys && sudo service ssh restart"] | ||
env: | ||
- name: MY_POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: MY_POD_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: ALERT_THRESHOLD | ||
# seconds | ||
value: "600" | ||
- name: RETRY_INTERVAL | ||
# seconds | ||
value: "60" | ||
terminationGracePeriodSeconds: 0 | ||
service_spec: | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ name }} | ||
labels: | ||
parent: skypilot | ||
spec: | ||
type: {{ service_type }} | ||
selector: | ||
component: {{ name }} | ||
ports: | ||
- protocol: TCP | ||
port: 22 | ||
targetPort: 22 | ||
# The following ServiceAccount/Role/RoleBinding sets up an RBAC for life cycle | ||
# management of the jump pod/service | ||
service_account: | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: sky-ssh-jump-sa | ||
parent: skypilot | ||
role: | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: sky-ssh-jump-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["pods", "pods/status", "pods/exec", "services"] | ||
verbs: ["get", "list", "create", "delete"] | ||
role_binding: | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: sky-ssh-jump-rb | ||
parent: skypilot | ||
subjects: | ||
- kind: ServiceAccount | ||
name: sky-ssh-jump-sa | ||
roleRef: | ||
kind: Role | ||
name: sky-ssh-jump-role | ||
apiGroup: rbac.authorization.k8s.io |
Oops, something went wrong.